Tabnine Logo
EnvUtil
Code IndexAdd Tabnine to your IDE (free)

How to use
EnvUtil
in
org.jboss.errai.config.rebind

Best Java code snippets using org.jboss.errai.config.rebind.EnvUtil (Showing top 20 results out of 315)

origin: org.jboss.errai/errai-marshalling

 @Override
 protected boolean isRelevantClass(final MetaClass clazz) {
  return EnvUtil.isPortableType(clazz);
 }
}
origin: errai/errai

public static void recordEnvironmentState() {
 isJUnitTest();
 isDevMode();
 isProdMode();
}
origin: org.jboss.errai/errai-marshalling

public static boolean isUseStaticMarshallers() {
 if (isForceStaticMarshallers())
  return true;
 if (EnvUtil.isDevMode() && !EnvUtil.isJUnitTest())
  return false;
 if (System.getProperty(USE_STATIC_MARSHALLERS) != null) {
  return Boolean.getBoolean(USE_STATIC_MARSHALLERS);
 }
 final Map<String, String> frameworkProperties = EnvUtil.getEnvironmentConfig().getFrameworkProperties();
 if (frameworkProperties.containsKey(USE_STATIC_MARSHALLERS)) {
  return "true".equals(frameworkProperties.get(USE_STATIC_MARSHALLERS));
 }
 else {
  return !EnvUtil.isDevMode();
 }
}
origin: errai/errai

public static boolean isProdMode() {
 if (_isProdMode != null) return _isProdMode;
 return _isProdMode = Boolean.valueOf(!isDevMode() && !isJUnitTest());
}
origin: org.jboss.errai/errai-weld-integration

@SuppressWarnings({ "unchecked", "rawtypes" })
public void processObserverMethod(@Observes final ProcessObserverMethod processObserverMethod) {
 final Type t = processObserverMethod.getObserverMethod().getObservedType();
 Class type = null;
 if (t instanceof Class) {
  type = (Class) t;
 }
 ClassScanner.setReflectionsScanning(true);
 if (type != null && EnvUtil.isPortableType(type) && !EnvUtil.isLocalEventType(type)) {
  final Set<Annotation> annotations = processObserverMethod.getObserverMethod().getObservedQualifiers();
  final Annotation[] methodQualifiers = annotations.toArray(new Annotation[annotations.size()]);
  for (final Annotation qualifier : methodQualifiers) {
   eventQualifiers.put(qualifier.annotationType().getName(), qualifier);
  }
  observableEvents.add(type.getName());
 }
}
origin: org.jboss.errai/errai-cdi-client

 callBackBlock = getJsTypeSubscriptionCallback(decorable, controller);
else if (EnvUtil.isPortableType(eventType) && !EnvUtil.isLocalEventType(eventType)) {
 subscribeMethod = "subscribe";
 callBackBlock = getSubscriptionCallback(decorable, controller);
for (final Class<?> cls : EnvUtil.getAllPortableConcreteSubtypes(eventType.asClass())) {
 if (!EnvUtil.isLocalEventType(cls)) {
  final ContextualStatementBuilder routingSubStmt = Stmt.invokeStatic(ErraiBus.class, "get").invoke("subscribe",
      CDI.getSubjectNameByType(cls.getName()), Stmt.loadStatic(CDI.class, "ROUTING_CALLBACK"));
origin: errai/errai

public static boolean isForceStaticMarshallers() {
 if (System.getProperty(FORCE_STATIC_MARSHALLERS) != null) {
  return Boolean.getBoolean(FORCE_STATIC_MARSHALLERS);
 }
 final Map<String, String> frameworkProperties = EnvUtil.getEnvironmentConfig().getFrameworkProperties();
 if (frameworkProperties.containsKey(FORCE_STATIC_MARSHALLERS)) {
  return "true".equals(frameworkProperties.get(FORCE_STATIC_MARSHALLERS));
 }
 else {
  return false;
 }
}
origin: errai/errai

@Override
protected boolean isCacheValid() {
 // This ensures the logged total build time of factories is reset even if
 // the BootstrapperImpl is not regenerated.
 FactoryGenerator.resetTotalTime();
 Collection<MetaClass> newOrUpdated = MetaClassFactory.getAllNewOrUpdatedClasses();
 // filter out generated IOC environment config
 if (newOrUpdated.size() == 1) {
  MetaClass clazz = newOrUpdated.iterator().next();
  if (clazz.isAssignableTo(IOCEnvironment.class)) {
   newOrUpdated.clear();
  }
 }
 boolean hasAnyChanges =  !newOrUpdated.isEmpty() || !MetaClassFactory.getAllDeletedClasses().isEmpty();
 return hasGenerationCache() && (EnvUtil.isProdMode() || !hasAnyChanges);
}
origin: errai/errai

EnvUtil.clearCache();
final EnvironmentConfig environmentConfig = getEnvironmentConfig();
final Set<MetaClass> envExposedClasses = environmentConfig.getExposedClasses();
origin: errai/errai

private static void maybeLoadBootstrapClassCollection(final GeneratorContext context) {
 if (bootstrapClassCollection == null || EnvUtil.isJUnitTest()) {
  bootstrapClassCollection = ClassScanner.getTypesAnnotatedWith(IOCBootstrapTask.class, context);
 }
}
origin: org.jboss.errai/errai-config

private static void processErraiAppPropertiesFiles(final Map<String, String> frameworkProps, final Map<String, String> mappingAliases,
    final Set<MetaClass> exposedClasses, final Set<MetaClass> nonportableClasses, final Set<String> explicitTypes) {
 for (final URL url : getErraiAppPropertiesFilesUrls()) {
  InputStream inputStream = null;
  try {
   log.debug("checking " + url.getFile() + " for configured types ...");
   inputStream = url.openStream();
   final ResourceBundle props = new PropertyResourceBundle(inputStream);
   processErraiAppPropertiesBundle(frameworkProps, mappingAliases, exposedClasses, nonportableClasses, explicitTypes, props);
  }
  catch (final IOException e) {
   throw new RuntimeException("error reading ErraiApp.properties", e);
  }
  finally {
   if (inputStream != null) {
    try {
     inputStream.close();
    }
    catch (final IOException e) {
     //
    }
   }
  }
 }
}
origin: org.jboss.errai/errai-data-binding

configuredNonBindableTypes = new HashSet<>();
final Collection<URL> erraiAppProperties = EnvUtil.getErraiAppPropertiesFilesUrls();
for (final URL url : erraiAppProperties) {
 InputStream inputStream = null;
origin: errai/errai

protected boolean getPropertyValue(final String propName,
                  final String matchValue,
                  final boolean matchByDefault,
                  final boolean caseSensitive) {
 final String propertyValue = EnvUtil.getEnvironmentConfig().getFrameworkOrSystemProperty(propName);
 if (propertyValue == null) {
  return matchByDefault;
 } else {
  return caseSensitive ? propertyValue.equals(matchValue) : propertyValue.equalsIgnoreCase(matchValue);
 }
}
origin: org.jboss.errai/errai-cdi-client

@Override
protected String generate(final TreeLogger treeLogger, final GeneratorContext context) {
 logger.info("Generating {}.{}...", SERIALIZER_PACKAGE_NAME, SERIALIZER_CLASS_NAME);
 final String source = NonGwtEventQualifierSerializerGenerator.generateSource(TranslatableAnnotationUtils.getTranslatableQualifiers(context.getTypeOracle()));
 logger.info("Generating class file for server.");
 if (EnvUtil.isProdMode()) {
  if (OutputDirectoryUtil.OUTPUT_DIR.isPresent()) {
   logger.info("Output directory set to {}. Attempting to write class file to this directory.", OutputDirectoryUtil.OUTPUT_DIR.get());
   generateAndWriteToDir(OutputDirectoryUtil.OUTPUT_DIR.get(), source);
  }
  else {
   logger.info("No output directory set. Attempting to discover target directory and write class file.");
   generateAndWriteToDiscoveredDirs(context, source);
  }
 }
 else {
  logger.info("Running in JUnit or Classic Dev Mode. Attempting to generate class in tmp directory {}", OUTPUT_TMP);
  final String tmpPath = new File(OUTPUT_TMP).getAbsolutePath();
  OutputDirectoryUtil.generateClassFileInTmpDir(SERIALIZER_PACKAGE_NAME, SERIALIZER_CLASS_NAME, source, tmpPath);
 }
 return source;
}
origin: org.jboss.errai/errai-config

public static boolean isProdMode() {
 if (_isProdMode != null) return _isProdMode;
 return _isProdMode = Boolean.valueOf(!isDevMode() && !isJUnitTest());
}
origin: org.jboss.errai/errai-marshalling

EnvUtil.clearCache();
final EnvironmentConfig environmentConfig = getEnvironmentConfig();
final Set<MetaClass> envExposedClasses = environmentConfig.getExposedClasses();
origin: errai/errai

private static void maybeLoadExtensionConfigurators(final MetaDataScanner scanner) {
 if (iocExtensions == null || extensionConfigurators == null || EnvUtil.isJUnitTest()) {
  iocExtensions = scanner
      .getTypesAnnotatedWith(org.jboss.errai.ioc.client.api.IOCExtension.class);
  extensionConfigurators = new ArrayList<IOCExtensionConfigurator>();
  try {
   for (final Class<?> clazz : iocExtensions) {
    final Class<? extends IOCExtensionConfigurator> configuratorClass
    = clazz.asSubclass(IOCExtensionConfigurator.class);
    final IOCExtensionConfigurator configurator = configuratorClass.newInstance();
    extensionConfigurators.add(configurator);
   }
  }
  catch (Exception e) {
   throw new ErraiBootstrapFailure("unable to load IOC Extension Configurator: " + e.getMessage(), e);
  }
 }
}
origin: errai/errai

private static void processErraiAppPropertiesFiles(final Map<String, String> frameworkProps, final Map<String, String> mappingAliases,
    final Set<MetaClass> exposedClasses, final Set<MetaClass> nonportableClasses, final Set<String> explicitTypes) {
 for (final URL url : getErraiAppPropertiesFilesUrls()) {
  InputStream inputStream = null;
  try {
   log.debug("checking " + url.getFile() + " for configured types ...");
   inputStream = url.openStream();
   final ResourceBundle props = new PropertyResourceBundle(inputStream);
   processErraiAppPropertiesBundle(frameworkProps, mappingAliases, exposedClasses, nonportableClasses, explicitTypes, props);
  }
  catch (final IOException e) {
   throw new RuntimeException("error reading ErraiApp.properties", e);
  }
  finally {
   if (inputStream != null) {
    try {
     inputStream.close();
    }
    catch (final IOException e) {
     //
    }
   }
  }
 }
}
origin: errai/errai

configuredNonBindableTypes = new HashSet<>();
final Collection<URL> erraiAppProperties = EnvUtil.getErraiAppPropertiesFilesUrls();
for (final URL url : erraiAppProperties) {
 InputStream inputStream = null;
origin: errai/errai

 @Override
 protected boolean isRelevantClass(final MetaClass clazz) {
  return EnvUtil.isPortableType(clazz);
 }
}
org.jboss.errai.config.rebindEnvUtil

Most used methods

  • isPortableType
  • isProdMode
  • getEnvironmentConfig
  • isJUnitTest
  • getErraiAppPropertiesFilesUrls
  • isDevMode
  • isLocalEventType
  • recordEnvironmentState
  • addExposedInnerClasses
  • addMappingAliases
  • addNonSerializableTypes
  • addSerializableTypes
  • addNonSerializableTypes,
  • addSerializableTypes,
  • clearCache,
  • fillInInterfacesAndSuperTypes,
  • getAllPortableConcreteSubtypes,
  • isBuiltinPortableType,
  • isListValuedProperty,
  • isString,
  • isUserPortableType,
  • processEnvironmentConfigExtensions

Popular in Java

  • Making http post requests using okhttp
  • setScale (BigDecimal)
  • scheduleAtFixedRate (Timer)
  • findViewById (Activity)
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now