@Override public void afterCompletion(int status) { //Close the seam call we started if it is still active. if(ScopeType.APPLICATION.isContextActive()) { log.debug("Ending Transactional Seam Call"); Lifecycle.endCall(); } else { log.warn("Spring started a transactional Seam call but somebody else closed before it before the transaction committed."); } } }
public static FacesMessages instance() { Component component = Component.forName(StatusMessages.COMPONENT_NAME); if(component != null && !component.getScope().isContextActive()) { throw new IllegalStateException("No active "+component.getScope().name()+" context"); } //Attempting to get the instance anyway for backwards compatibility with some potential hack situations. return (FacesMessages) Component.getInstance(StatusMessages.COMPONENT_NAME); } }
public static StatusMessages instance() { Component component = Component.forName(StatusMessages.COMPONENT_NAME); if(component != null && !component.getScope().isContextActive()) { throw new IllegalStateException("No active "+component.getScope().name()+" context"); } //Attempting to get the instance anyway for backwards compatibility with some potential hack situations. return (StatusMessages) Component.getInstance(COMPONENT_NAME); }
protected static void runTasks() { Component component = Component.forName(StatusMessages.COMPONENT_NAME); if( component != null && !component.getScope().isContextActive() ) { return; } //Attempting to get the instance anyway for backwards compatibility with some potential hack situations. StatusMessages statusMessages = instance(); if ( statusMessages != null ) { statusMessages.doRunTasks(); } }
/** * Starts a Seam Call if one is not available and if executing within a Spring * Transaction. */ public static void beginTransactionalSeamCall() { if (ScopeType.APPLICATION.isContextActive()) { log.debug("Application available. Won't start a new call"); return; } if (TransactionSynchronizationManager.isSynchronizationActive()) { TransactionSynchronizationManager .registerSynchronization(new SeamLifecycleSynchronization()); log.debug("Beginning Transactional Seam Call"); Lifecycle.beginCall(); return; } throw new IllegalStateException( "Seam application context not available and cannot be started. " + "Seam Managed Persistence Context not available. " + "Try placing the spring bean call inside of a spring transaction or try making the spring bean " + "a Seam Component using <seam:component/>."); }
component.getScope(); if ( enforceRequired || outScope.isContextActive() )
else if ( component.getScope().isContextActive() )
Init.FactoryExpression methodBinding = init.getFactoryMethodExpression(name); Init.FactoryExpression valueBinding = init.getFactoryValueExpression(name); if (methodBinding != null && getOutScope(methodBinding.getScope(), null).isContextActive()) else if (valueBinding != null && getOutScope(valueBinding.getScope(), null).isContextActive()) else if (factoryMethod != null && getOutScope(factoryMethod.getScope(), factoryMethod.getComponent()).isContextActive())
if ( enforceRequired || in.scope().isContextActive() )
if ( scope!=ScopeType.STATELESS && scope.isContextActive() )