public static void endReinitialization() { Contexts.startup(ScopeType.APPLICATION); Events.instance().raiseEvent("org.jboss.seam.postReInitialization"); // Clean up contexts used during reinitialization Contexts.destroy( Contexts.getConversationContext() ); Contexts.conversationContext.set(null); Contexts.destroy( Contexts.getEventContext() ); Contexts.eventContext.set(null); Contexts.sessionContext.set(null); Contexts.applicationContext.set(null); log.debug("<<< End re-initialization"); }
public static void endInitialization() { Contexts.startup(ScopeType.APPLICATION); Events.instance().raiseEvent("org.jboss.seam.postInitialization"); // Clean up contexts used during initialization Contexts.destroy( Contexts.getConversationContext() ); Contexts.conversationContext.set(null); Contexts.destroy( Contexts.getEventContext() ); Contexts.eventContext.set(null); Contexts.sessionContext.set(null); Contexts.applicationContext.set(null); log.debug("<<< End initialization"); }
Contexts.startup(ScopeType.SESSION);
/** * Startup all @Startup components in the given scope */ static void startup(ScopeType scopeType) { Context context = Contexts.getApplicationContext(); for ( String name: context.getNames() ) { Object object = context.get(name); if ( object!=null && (object instanceof Component) ) { Component component = (Component) object; if ( component.isStartup() && component.getScope()==scopeType ) { startup(component); } } } }
/** * Startup a component and all its dependencies */ static void startup(Component component) { if ( component.isStartup() ) { for ( String dependency: component.getDependencies() ) { Component dependentComponent = Component.forName(dependency); if (dependentComponent!=null) { startup(dependentComponent); } } } if ( !component.getScope().getContext().isSet( component.getName() ) ) { log.debug( "starting up: " + component.getName() ); component.newInstance(); } }