Methods Summary |
---|
public org.jboss.ejb.Container | getContainer()
return container;
|
public java.lang.Object | invoke(org.jboss.invocation.Invocation mi)
EnterpriseContext ctx = (EnterpriseContext)mi.getEnterpriseContext ();
try
{
// Invoke through interceptors
return getNext ().invoke (mi);
}
catch (RemoteException e)
{
ctx = null;
throw e;
}
catch (RuntimeException e)
{
ctx = null;
throw e;
}
catch (Error e)
{
ctx = null;
throw e;
}
finally
{
if ( (ctx != null) && (ctx.getId () != null) )
// Still a valid instance and instance not removed
//
{
// Everything went ok (at least no J2EE problem) and the instance will most probably be called
// many more times. Consequently, we need to synchronize the state of our bean instance with
// our persistant store (which will forward this to its HASessionState implementation) for clustering
// behaviour.
//
if(isModified == null)
{
synchronizeState (ctx);
}
else
{
Boolean modified = (Boolean) isModified.invoke (ctx.getInstance (), new Object[0]);
if (modified.booleanValue ())
synchronizeState (ctx);
}
}
}
|
public java.lang.Object | invokeHome(org.jboss.invocation.Invocation mi)
EnterpriseContext ctx = (EnterpriseContext)mi.getEnterpriseContext ();
try
{
// Invoke through interceptors
return getNext ().invokeHome (mi);
}
finally
{
if ( (ctx != null) && (ctx.getId () != null) )
// Still a valid instance and instance not removed
//
{
// Everything went ok (at least no J2EE problem) and the instance will most probably be called
// many more times. Consequently, we need to synchronize the state of our bean instance with
// our persistant store (which will forward this to its HASessionState implementation) for clustering
// behaviour. This is only necessary for "create" calls (which is the case because ctx.getId() != null)
//
synchronizeState (ctx);
}
}
|
public void | setContainer(org.jboss.ejb.Container container)This callback is set by the container so that the plugin may access it
this.container = (StatefulSessionContainer)container;
|
public void | start()
// Lookup the isModified method if it exists
//
try
{
isModified = this.container.getBeanClass().getMethod("isModified", new Class[0]);
if (!isModified.getReturnType().equals(Boolean.TYPE)) {
isModified = null; // Has to have "boolean" as return type!
log.warn("Found isModified method, but return type is not boolean; ignoring");
}
else
{
log.debug("Using isModified method: " + isModified);
}
}
catch (NoSuchMethodException ignored) {}
|
protected void | synchronizeState(org.jboss.ejb.EnterpriseContext ctx)
((HAPersistentManager)container.getPersistenceManager ()).synchroSession ((StatefulSessionEnterpriseContext)ctx);
|