use of javax.faces.application.ProjectStage in project deltaspike by apache.
the class DeltaSpikeFacesContextWrapper method init.
private synchronized void init() {
// switch into paranoia mode
if (this.initialized == null) {
this.beanManager = BeanManagerProvider.getInstance().getBeanManager();
this.jsfModuleConfig = BeanProvider.getContextualReference(this.beanManager, JsfModuleConfig.class, false);
if (ClassDeactivationUtils.isActivated(JsfRequestBroadcaster.class)) {
this.jsfRequestBroadcaster = BeanProvider.getContextualReference(JsfRequestBroadcaster.class, true);
}
ViewConfigResolver viewConfigResolver = BeanProvider.getContextualReference(ViewConfigResolver.class);
// deactivate it, if there is no default-error-view available
this.defaultErrorViewExceptionHandlerActivated = viewConfigResolver.getDefaultErrorViewConfigDescriptor() != null && ClassDeactivationUtils.isActivated(DefaultErrorViewAwareExceptionHandlerWrapper.class);
this.bridgeExceptionHandlerActivated = ClassDeactivationUtils.isActivated(BridgeExceptionHandlerWrapper.class);
this.bridgeExceptionQualifier = AnnotationInstanceProvider.of(jsfModuleConfig.getExceptionQualifier());
this.preDestroyViewMapEventFilterMode = ClassDeactivationUtils.isActivated(SecurityAwareViewHandler.class);
this.isNavigationAwareApplicationWrapperActivated = ClassDeactivationUtils.isActivated(NavigationHandlerAwareApplication.class);
org.apache.deltaspike.core.api.projectstage.ProjectStage dsProjectStage = ProjectStageProducer.getInstance().getProjectStage();
for (ProjectStage ps : ProjectStage.values()) {
if (ps.name().equals(dsProjectStage.getClass().getSimpleName())) {
this.projectStage = ps;
break;
}
}
if (this.projectStage == null && dsProjectStage instanceof TestStage) {
this.projectStage = ProjectStage.Development;
}
if (this.projectStage == ProjectStage.Production) {
// reset it to force the delegation to the default handling
this.projectStage = null;
}
this.initialized = true;
}
}
Aggregations