org.jboss.ejb.plugins
abstract public class: AbstractPassivationJob [javadoc |
source]
java.lang.Object
org.jboss.ejb.plugins.AbstractPassivationJob
All Implemented Interfaces:
Executable
Abstract class for passivation jobs.
Subclasses should implement
#execute synchronizing it in some way because
the execute method is normally called in the passivation thread,
while the cancel method is normally called from another thread.
To avoid that subclasses override methods of this class without
make them synchronized (except execute of course), they're declared final.
- author:
< - a href="mailto:simone.bordet@compaq.com">Simone Bordet
- author:
Scott.Stark - @jboss.org
- version:
$ - Revision: 37459 $
| Field Summary |
|---|
| protected EnterpriseContext | ctx | |
| protected Object | key | |
| protected boolean | isCancelled | |
| protected boolean | isExecuted | |
| Method from org.jboss.ejb.plugins.AbstractPassivationJob Detail: |
final synchronized void cancel() {
isCancelled = true;
}
Mark this job for cancellation. |
final synchronized void executed() {
isExecuted = true;
}
Mark this job as executed |
final EnterpriseContext getEnterpriseContext() {
return ctx;
}
Returns the EnterpriseContext associated with this passivation job,
so the bean that will be passivated.
No need to synchronize access to this method, since the returned
reference is immutable |
final Object getKey() {
return key;
}
(Bill Burke) We can't rely on the EnterpriseContext to provide PassivationJob
with a valid key because it may get freed to the InstancePool, then
reused before the PassivationJob executes. |
final synchronized boolean isCancelled() {
return isCancelled;
}
Returns whether this job has been marked for cancellation |
final synchronized boolean isExecuted() {
return isExecuted;
}
Returns whether this job has been executed |