Save This Page
Home » jboss-5.0.0.CR1-src » org » jboss » ejb » plugins » [javadoc | source]
org.jboss.ejb.plugins
public class: CleanShutdownInterceptor [javadoc | source]
java.lang.Object
   org.jboss.ejb.plugins.AbstractInterceptor
      org.jboss.ejb.plugins.CleanShutdownInterceptor

All Implemented Interfaces:
    Interceptor

Track the incoming invocations and when shuting down a container (stop or destroy), waits for current invocations to finish before returning the stop or destroy call. This interceptor can be important in clustered environment where shuting down a node doesn't necessarly mean that an application cannot be reached: other nodes may still be servicing. Consequently, it is important to have a clean shutdown to keep a coherent behaviour cluster-wide. To avoid strange or inefficient behaviour, the facade session bean (if any) should be stopped first thus not blocking invocations in a middle-step (i.e. facade making multiple invocations to "sub-beans": if a "sub-bean" is shut down, the facade will get an exception in the middle of its activity)
Nested Class Summary:
class  CleanShutdownInterceptor.StateChangeListener   
Field Summary
protected  Container container     
protected  EjbModule ejbModule     
protected  String ejbModuleName     
protected  boolean allowInvocations     
protected  boolean allowRemoteInvocations     
protected  boolean isDebugEnabled     
public  long runningInvocations     
public  long runningHomeInvocations     
public  long shutdownTimeout     
public  long readAcquireTimeMs     
protected  ReentrantWriterPreferenceReadWriteLock rwLock     
Fields inherited from org.jboss.ejb.plugins.AbstractInterceptor:
nextInterceptor,  log,  container
Constructor:
 public CleanShutdownInterceptor() 
Method from org.jboss.ejb.plugins.CleanShutdownInterceptor Summary:
containerIsAboutToStop,   create,   destroy,   forbidInvocations,   getContainer,   getOrigin,   invoke,   invokeHome,   onlyAllowLocalInvocations,   purgeRunningInvocations,   revertOrigin,   setContainer,   setOrigin,   start,   stop,   waitForNoMoreInvocations
Methods from org.jboss.ejb.plugins.AbstractInterceptor:
create,   destroy,   getContainer,   getNext,   invoke,   invokeHome,   isAppException,   setContainer,   setNext,   start,   stop
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.jboss.ejb.plugins.CleanShutdownInterceptor Detail:
 protected  void containerIsAboutToStop() 
 public  void create() throws Exception 
 public  void destroy() 
 protected  void forbidInvocations() 
 public Container getContainer() 
 protected String getOrigin(Invocation mi) 
 public Object invoke(Invocation mi) throws Exception 
 public Object invokeHome(Invocation mi) throws Exception 
 public  void onlyAllowLocalInvocations() 
 protected  void purgeRunningInvocations() 
 protected  void revertOrigin(Invocation mi,
    String origin) 
 public  void setContainer(Container con) 
    This callback is set by the container so that the plugin may access it
 protected  void setOrigin(Invocation mi) 
 public  void start() throws Exception 
 public  void stop() 
 public  void waitForNoMoreInvocations()