/** * Resolves resources outside of CDI for the given class. * @param targetType target type * @param defaultImplementation default implementation * @param <T> current type * @return configured artifact or null if there is no result */ public static <T extends Serializable> T lookupFromEnvironment(Class<T> targetType, T... defaultImplementation) { return lookupFromEnvironment(targetType, null, defaultImplementation); }
/** * Resolves resources outside of CDI for the given class. * @param targetType target type * @param defaultImplementation default implementation * @param <T> current type * @return configured artifact or null if there is no result */ public static <T extends Serializable> T lookupFromEnvironment(Class<T> targetType, T... defaultImplementation) { return lookupFromEnvironment(targetType, null, defaultImplementation); }
/** * Resolves resources outside of CDI for the given key and class. * @param key key for identifying the resource which has to be resolved * @param targetType target type * @param defaultImplementation default implementation * @param <T> current type * @return configured artifact or null if there is no result */ public static <T extends Serializable> T lookupFromEnvironment(String key, Class<T> targetType, T... defaultImplementation) { return lookupFromEnvironment(key, targetType, null, defaultImplementation); }
/** * Resolves resources outside of CDI for the given class. * @param targetType target type * @param defaultImplementation default implementation * @param <T> current type * @return configured artifact or null if there is no result */ public static <T extends Serializable> T lookupFromEnvironment(Class<T> targetType, T... defaultImplementation) { return lookupFromEnvironment(targetType, null, defaultImplementation); }
/** * Resolves resources outside of CDI for the given key and class. * @param key key for identifying the resource which has to be resolved * @param targetType target type * @param defaultImplementation default implementation * @param <T> current type * @return configured artifact or null if there is no result */ public static <T extends Serializable> T lookupFromEnvironment(String key, Class<T> targetType, T... defaultImplementation) { return lookupFromEnvironment(key, targetType, null, defaultImplementation); }
/** * Resolves resources outside of CDI for the given key and class. * @param key key for identifying the resource which has to be resolved * @param targetType target type * @param defaultImplementation default implementation * @param <T> current type * @return configured artifact or null if there is no result */ public static <T extends Serializable> T lookupFromEnvironment(String key, Class<T> targetType, T... defaultImplementation) { return lookupFromEnvironment(key, targetType, null, defaultImplementation); }
/** * Resolves resources outside of CDI for the given class. * @param targetType target type which is also used as key (the simple name of it) * @param aggregatable allows to aggregate multiple results * @param defaultImplementation default implementation * @param <T> current type * @return configured artifact or an aggregated instance if there are multiple results or null if there is no result */ public static <T extends Serializable> T lookupFromEnvironment(Class<T> targetType, Aggregatable<T> aggregatable, T... defaultImplementation) { return lookupFromEnvironment(targetType.getSimpleName(), targetType, aggregatable, defaultImplementation); }
/** * Resolves resources outside of CDI for the given class. * @param targetType target type which is also used as key (the simple name of it) * @param aggregatable allows to aggregate multiple results * @param defaultImplementation default implementation * @param <T> current type * @return configured artifact or an aggregated instance if there are multiple results or null if there is no result */ public static <T extends Serializable> T lookupFromEnvironment(Class<T> targetType, Aggregatable<T> aggregatable, T... defaultImplementation) { return lookupFromEnvironment(targetType.getSimpleName(), targetType, aggregatable, defaultImplementation); }
/** * Resolves resources outside of CDI for the given class. * @param targetType target type which is also used as key (the simple name of it) * @param aggregatable allows to aggregate multiple results * @param defaultImplementation default implementation * @param <T> current type * @return configured artifact or an aggregated instance if there are multiple results or null if there is no result */ public static <T extends Serializable> T lookupFromEnvironment(Class<T> targetType, Aggregatable<T> aggregatable, T... defaultImplementation) { return lookupFromEnvironment(targetType.getSimpleName(), targetType, aggregatable, defaultImplementation); }
/** * Constructor for wrapping the given {@link RenderKitFactory} * @param wrapped render-kit-factory which will be wrapped */ public CodiRenderKitFactory(RenderKitFactory wrapped) { this.wrapped = wrapped; this.deactivated = !isActivated(); if(!this.deactivated) { this.renderKitWrapperFactory = CodiUtils.lookupFromEnvironment(RenderKitWrapperFactory.class); } }
/** * Constructor for wrapping the given {@link RenderKitFactory} * @param wrapped render-kit-factory which will be wrapped */ public CodiRenderKitFactory(RenderKitFactory wrapped) { this.wrapped = wrapped; this.deactivated = !isActivated(); if(!this.deactivated) { this.renderKitWrapperFactory = CodiUtils.lookupFromEnvironment(RenderKitWrapperFactory.class); } }
private ViewConfigExtractor getViewConfigExtractor() { ViewConfigExtractor defaultViewConfigExtractor = new DefaultViewConfigExtractor(); ViewConfigExtractor viewConfigExtractor = CodiUtils.lookupFromEnvironment(ViewConfigExtractor.class, defaultViewConfigExtractor); if(viewConfigExtractor == null) { viewConfigExtractor = defaultViewConfigExtractor; } return viewConfigExtractor; }
/** * Resolves the project-stage configured for codi * @return the resolved {@link ProjectStage} or <code>null</code> if none defined. */ protected ProjectStage resolveProjectStage() { String stageName = CodiUtils.lookupFromEnvironment("ProjectStage", String.class); if (stageName != null) { return ProjectStage.valueOf(stageName); } return null; }
/** * Constructor for wrapping the given {@link RenderKitFactory} * @param wrapped render-kit-factory which will be wrapped */ public CodiRenderKitFactory(RenderKitFactory wrapped) { this.wrapped = wrapped; this.deactivated = !isActivated(); if(!this.deactivated) { this.renderKitWrapperFactory = CodiUtils.lookupFromEnvironment(RenderKitWrapperFactory.class); } }
private ViewConfigExtractor getViewConfigExtractor() { ViewConfigExtractor defaultViewConfigExtractor = new DefaultViewConfigExtractor(); ViewConfigExtractor viewConfigExtractor = CodiUtils.lookupFromEnvironment(ViewConfigExtractor.class, defaultViewConfigExtractor); if(viewConfigExtractor == null) { viewConfigExtractor = defaultViewConfigExtractor; } return viewConfigExtractor; }
private ViewConfigExtractor getViewConfigExtractor() { ViewConfigExtractor defaultViewConfigExtractor = new DefaultViewConfigExtractor(); ViewConfigExtractor viewConfigExtractor = CodiUtils.lookupFromEnvironment(ViewConfigExtractor.class, defaultViewConfigExtractor); if(viewConfigExtractor == null) { viewConfigExtractor = defaultViewConfigExtractor; } return viewConfigExtractor; }
/** * Resolves the project-stage configured for codi * @return the resolved {@link ProjectStage} or <code>null</code> if none defined. */ protected ProjectStage resolveProjectStage() { String stageName = CodiUtils.lookupFromEnvironment("ProjectStage", String.class); if (stageName != null) { return ProjectStage.valueOf(stageName); } return null; }
/** * Constructor for wrapping the given {@link RenderKitFactory} * @param wrapped render-kit-factory which will be wrapped */ public CodiRenderKitFactory(RenderKitFactory wrapped) { this.wrapped = wrapped; this.deactivated = !isActivated(); if(!this.deactivated) { this.renderKitWrapperFactory = CodiUtils.lookupFromEnvironment(RenderKitWrapperFactory.class); } }
/** * Resolves the project-stage configured for codi * @return the resolved {@link ProjectStage} or <code>null</code> if none defined. */ protected ProjectStage resolveProjectStage() { String stageName = CodiUtils.lookupFromEnvironment("ProjectStage", String.class); if (stageName != null) { return ProjectStage.valueOf(stageName); } return null; }
private static ClassDeactivator getClassDeactivator() { ClassDeactivator classDeactivator = CodiUtils.lookupFromEnvironment(ClassDeactivator.class, new ClassDeactivatorAggregator(), null); // use default deactivator if (classDeactivator == null) { classDeactivator = createClassDeactivatorPlaceholder(); } else { LOGGER.info("used class deactivator: " + classDeactivator.toString()); // display deactivated classes here once // NOTE that isClassActivated() will be called many times for the same class for (Class<?> deactivatedClass : classDeactivator.getDeactivatedClasses()) { LOGGER.info("deactivate: " + deactivatedClass); } } ClassDeactivatorStorage.setClassDeactivator(classDeactivator); return classDeactivator; }