|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.ejb.plugins.AbstractInterceptor (src)
org.jboss.ejb.plugins.CleanShutdownInterceptor
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)
Field Summary | |
protected boolean |
allowInvocations
|
protected boolean |
allowRemoteInvocations
|
protected Container (src) |
container
|
protected EjbModule (src) |
ejbModule
|
protected java.lang.String |
ejbModuleName
|
protected boolean |
isDebugEnabled
|
long |
readAcquireTimeMs
|
long |
runningHomeInvocations
|
long |
runningInvocations
|
protected ReentrantWriterPreferenceReadWriteLock |
rwLock
|
long |
shutdownTimeout
|
Fields inherited from class org.jboss.ejb.plugins.AbstractInterceptor (src) |
log, nextInterceptor |
Constructor Summary | |
CleanShutdownInterceptor()
|
Method Summary | |
protected void |
containerIsAboutToStop()
|
void |
create()
create the service, do expensive operations etc |
void |
destroy()
destroy the service, tear down |
protected void |
forbidInvocations()
|
Container (src) |
getContainer()
|
protected java.lang.String |
getOrigin(Invocation (src) mi)
|
java.lang.Object |
invoke(Invocation (src) mi)
??? |
java.lang.Object |
invokeHome(Invocation (src) mi)
??? |
void |
onlyAllowLocalInvocations()
|
protected void |
purgeRunningInvocations()
|
protected void |
revertOrigin(Invocation (src) mi,
java.lang.String origin)
|
void |
setContainer(Container (src) con)
This callback is set by the container so that the plugin may access it |
protected void |
setOrigin(Invocation (src) mi)
|
void |
start()
start the service, create is already called |
void |
stop()
stop the service |
void |
waitForNoMoreInvocations()
|
Methods inherited from class org.jboss.ejb.plugins.AbstractInterceptor (src) |
getNext, setNext |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Container (src) container
protected EjbModule (src) ejbModule
protected java.lang.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
Constructor Detail |
public CleanShutdownInterceptor()
Method Detail |
public void onlyAllowLocalInvocations()
public void waitForNoMoreInvocations()
public void create() throws java.lang.Exception
Service (src)
create
in interface Service (src)
create
in class AbstractInterceptor (src)
java.lang.Exception
public void start() throws java.lang.Exception
Service (src)
start
in interface Service (src)
start
in class AbstractInterceptor (src)
java.lang.Exception
public void stop()
Service (src)
stop
in interface Service (src)
stop
in class AbstractInterceptor (src)
public void destroy()
Service (src)
destroy
in interface Service (src)
destroy
in class AbstractInterceptor (src)
public java.lang.Object invokeHome(Invocation (src) mi) throws java.lang.Exception
Interceptor (src)
invokeHome
in interface Interceptor (src)
invokeHome
in class AbstractInterceptor (src)
java.lang.Exception
public java.lang.Object invoke(Invocation (src) mi) throws java.lang.Exception
Interceptor (src)
invoke
in interface Interceptor (src)
invoke
in class AbstractInterceptor (src)
java.lang.Exception
public Container (src) getContainer()
getContainer
in class AbstractInterceptor (src)
public void setContainer(Container (src) con)
setContainer
in interface ContainerPlugin (src)
setContainer
in class AbstractInterceptor (src)
con
- The container using this plugin.protected void forbidInvocations()
protected void purgeRunningInvocations()
protected java.lang.String getOrigin(Invocation (src) mi)
protected void setOrigin(Invocation (src) mi)
protected void revertOrigin(Invocation (src) mi, java.lang.String origin)
protected void containerIsAboutToStop()
|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |