public static void endApplication(Map<String,Object> app) { log.debug("Shutting down application and destroying contexts"); Context tempApplicationContext = new ApplicationContext( app ); Contexts.applicationContext.set(tempApplicationContext); Contexts.destroy(tempApplicationContext); Contexts.applicationContext.set(null); Contexts.eventContext.set(null); Contexts.sessionContext.set(null); Contexts.conversationContext.set(null); application = null; }
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"); }
public static void endCall() { try { Contexts.destroy( Contexts.getSessionContext() ); Contexts.flushAndDestroyContexts(); if ( Manager.instance().isLongRunningConversation() ) { throw new IllegalStateException("Do not start long-running conversations in direct calls to EJBs"); } } finally { clearThreadlocals(); log.debug( "<<< End call" ); } }
/** * Destroy a conversation context that is not currently bound to the request, called * due to a timeout. * * @param session the current session, to which both current and destroyed conversation belong * @param conversationId the conversation id of the conversation to be destroyed */ static void destroyConversationContext(Map<String, Object> session, String conversationId) { Context current = getConversationContext(); ServerConversationContext temp = new ServerConversationContext(session, conversationId); conversationContext.set(temp); try { destroy(temp); if ( !Session.instance().isInvalid() ) //its also unnecessary during a session timeout { temp.clear(); temp.flush(); } } finally { conversationContext.set(current); } }