public static boolean isProdMode() { if (_isProdMode != null) return _isProdMode; return _isProdMode = Boolean.valueOf(!isDevMode() && !isJUnitTest()); }
public static boolean isProdMode() { if (_isProdMode != null) return _isProdMode; return _isProdMode = Boolean.valueOf(!isDevMode() && !isJUnitTest()); }
private static void maybeLoadBootstrapClassCollection(final GeneratorContext context) { if (bootstrapClassCollection == null || EnvUtil.isJUnitTest()) { bootstrapClassCollection = ClassScanner.getTypesAnnotatedWith(IOCBootstrapTask.class, context); } }
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); } } }
public static void recordEnvironmentState() { isJUnitTest(); isDevMode(); isProdMode(); }
public static void recordEnvironmentState() { isJUnitTest(); isDevMode(); isProdMode(); }
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(); } }
@SuppressWarnings("rawtypes") private static void maybeValidateDecorators(final MetaDataScanner scanner) { if (decoratorMap == null || EnvUtil.isJUnitTest()) { decoratorMap = new HashMap<Class<? extends IOCDecoratorExtension>, Class<? extends Annotation>>(); final Set<Class<?>> decorators = scanner.getTypesAnnotatedWith(CodeDecorator.class); try { for (final Class<?> clazz : decorators) { final Class<? extends IOCDecoratorExtension> decoratorClass = clazz.asSubclass(IOCDecoratorExtension.class); Class<? extends Annotation> annoType = null; final Type t = decoratorClass.getGenericSuperclass(); if (!(t instanceof ParameterizedType)) { throw new ErraiBootstrapFailure("code decorator must extend IOCDecoratorExtension<@AnnotationType>"); } final ParameterizedType pType = (ParameterizedType) t; if (IOCDecoratorExtension.class.equals(pType.getRawType())) { if (pType.getActualTypeArguments().length == 0 || !Annotation.class.isAssignableFrom((Class<?>) pType.getActualTypeArguments()[0])) { throw new ErraiBootstrapFailure("code decorator must extend IOCDecoratorExtension<@AnnotationType>"); } // noinspection unchecked annoType = ((Class<?>) pType.getActualTypeArguments()[0]).asSubclass(Annotation.class); } decoratorMap.put(decoratorClass, annoType); } } catch (Exception e) { throw new ErraiBootstrapFailure("unable to load code decorator: " + e.getMessage(), e); } } }
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(); } }