org.jboss.ejb.plugins
Class StatefulHASessionPersistenceManager

java.lang.Object
  extended byorg.jboss.mx.util.JBossNotificationBroadcasterSupport (src) 
      extended byorg.jboss.system.ServiceMBeanSupport (src) 
          extended byorg.jboss.ejb.plugins.StatefulHASessionPersistenceManager
All Implemented Interfaces:
AllowedOperationsFlags (src) , ContainerPlugin (src) , HAPersistentManager (src) , HASessionState.HASessionStateListener (src) , MBeanRegistration (src) , NotificationBroadcaster (src) , NotificationEmitter (src) , Service (src) , ServiceMBean (src) , StatefulSessionPersistenceManager (src)

public class StatefulHASessionPersistenceManager
extends ServiceMBeanSupport (src)
implements StatefulSessionPersistenceManager (src) , HASessionState.HASessionStateListener (src) , HAPersistentManager (src)

This persistence manager work with an underlying HASessionState to get clustered state.

See Also:
HASessionState (src) , HASessionStateImpl (src)

Field Summary
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport (src)
log, server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.ejb.AllowedOperationsFlags (src)
IN_AFTER_BEGIN, IN_AFTER_COMPLETION, IN_BEFORE_COMPLETION, IN_BUSINESS_METHOD, IN_EJB_ACTIVATE, IN_EJB_CREATE, IN_EJB_FIND, IN_EJB_HOME, IN_EJB_LOAD, IN_EJB_PASSIVATE, IN_EJB_POST_CREATE, IN_EJB_REMOVE, IN_EJB_STORE, IN_EJB_TIMEOUT, IN_INTERCEPTOR_METHOD, IN_SERVICE_ENDPOINT_METHOD, IN_SET_ENTITY_CONTEXT, IN_SET_MESSAGE_DRIVEN_CONTEXT, IN_SET_SESSION_CONTEXT, IN_UNSET_ENTITY_CONTEXT, NOT_ALLOWED
 
Fields inherited from interface org.jboss.system.ServiceMBean (src)
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Constructor Summary
StatefulHASessionPersistenceManager()
          Creates new StatefulHASessionPersistenceManager
 
Method Summary
 void activateSession(StatefulSessionEnterpriseContext (src)  ctx)
          Activate the SFSB for the given context.
 void createdSession(StatefulSessionEnterpriseContext (src)  ctx)
          Called after the SFSB's ejbCreate method has been successfully invoked to allow the PM to perform an post creation setup.
 java.lang.Object createId(StatefulSessionEnterpriseContext (src)  ctx)
          Create a unique identifier for the given SFSB context.
protected  void createService()
          Sub-classes should override this method to provide custum 'create' logic.
 void newSessionStateTopology(HAPartition (src)  haSubPartition)
           
 void passivateSession(StatefulSessionEnterpriseContext (src)  ctx)
          Passivate the SFSB for the given context.
 void removePassivated(java.lang.Object key)
          Remove any passivated state for the given SFSB identifier.
 void removeSession(StatefulSessionEnterpriseContext (src)  ctx)
          Remove the SFSB for the given context.
 void sessionExternallyModified(PackagedSession (src)  session)
           
 void setContainer(Container (src)  c)
          This callback is set by the container so that the plugin may access it
protected  void stopService()
          Sub-classes should override this method to provide custum 'stop' logic.
 void synchroSession(StatefulSessionEnterpriseContext (src)  ctx)
           
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport (src)
create, destroy, destroyService, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister, start, startService, stop
 
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport (src)
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.system.Service (src)
create, destroy, start, stop
 

Constructor Detail

StatefulHASessionPersistenceManager

public StatefulHASessionPersistenceManager()
Creates new StatefulHASessionPersistenceManager

Method Detail

setContainer

public void setContainer(Container (src)  c)
Description copied from interface: ContainerPlugin (src)
This callback is set by the container so that the plugin may access it

Specified by:
setContainer in interface ContainerPlugin (src)
Parameters:
c - The container using this plugin. This may be null if the plugin is being disassociated from a container.

createService

protected void createService()
                      throws java.lang.Exception
Description copied from class: ServiceMBeanSupport (src)
Sub-classes should override this method to provide custum 'create' logic.

This method is empty, and is provided for convenience when concrete service classes do not need to perform anything specific for this state change.

Overrides:
createService in class ServiceMBeanSupport (src)
Throws:
java.lang.Exception

stopService

protected void stopService()
Description copied from class: ServiceMBeanSupport (src)
Sub-classes should override this method to provide custum 'stop' logic.

This method is empty, and is provided for convenience when concrete service classes do not need to perform anything specific for this state change.

Overrides:
stopService in class ServiceMBeanSupport (src)

createId

public java.lang.Object createId(StatefulSessionEnterpriseContext (src)  ctx)
                          throws java.lang.Exception
Description copied from interface: StatefulSessionPersistenceManager (src)
Create a unique identifier for the given SFSB context.

Specified by:
createId in interface StatefulSessionPersistenceManager (src)
Parameters:
ctx - The context of the SFSB to create an unique identifier for.
Returns:
A unique identifier.
Throws:
java.lang.Exception - Failed to create unique identifier.

createdSession

public void createdSession(StatefulSessionEnterpriseContext (src)  ctx)
                    throws java.lang.Exception
Description copied from interface: StatefulSessionPersistenceManager (src)
Called after the SFSB's ejbCreate method has been successfully invoked to allow the PM to perform an post creation setup.

Specified by:
createdSession in interface StatefulSessionPersistenceManager (src)
Parameters:
ctx - The context of the SFSB which was created.
Throws:
java.lang.Exception

activateSession

public void activateSession(StatefulSessionEnterpriseContext (src)  ctx)
                     throws java.rmi.RemoteException
Description copied from interface: StatefulSessionPersistenceManager (src)
Activate the SFSB for the given context.

Implementation is responsible for invoking the bean's SessionBean.ejbActivate() method.

Specified by:
activateSession in interface StatefulSessionPersistenceManager (src)
Parameters:
ctx - The context of the SFSB to activate.
Throws:
java.rmi.RemoteException

passivateSession

public void passivateSession(StatefulSessionEnterpriseContext (src)  ctx)
                      throws java.rmi.RemoteException
Description copied from interface: StatefulSessionPersistenceManager (src)
Passivate the SFSB for the given context.

Implementation is responsible for invoking the bean's SessionBean.ejbPassivate() method.

Specified by:
passivateSession in interface StatefulSessionPersistenceManager (src)
Parameters:
ctx - The context of the SFSB to passivate.
Throws:
java.rmi.RemoteException

synchroSession

public void synchroSession(StatefulSessionEnterpriseContext (src)  ctx)
                    throws java.rmi.RemoteException
Specified by:
synchroSession in interface HAPersistentManager (src)
Throws:
java.rmi.RemoteException

removeSession

public void removeSession(StatefulSessionEnterpriseContext (src)  ctx)
                   throws java.rmi.RemoteException,
                          RemoveException (src) 
Description copied from interface: StatefulSessionPersistenceManager (src)
Remove the SFSB for the given context.

Implementation is responsible for invoking the bean's SessionBean.ejbRemove() method.

Specified by:
removeSession in interface StatefulSessionPersistenceManager (src)
Parameters:
ctx - The context of the SFSB to remove.
Throws:
java.rmi.RemoteException
RemoveException (src)

removePassivated

public void removePassivated(java.lang.Object key)
Description copied from interface: StatefulSessionPersistenceManager (src)
Remove any passivated state for the given SFSB identifier.

This is called by the instance cache impl to clean up the state for an old session.

Specified by:
removePassivated in interface StatefulSessionPersistenceManager (src)
Parameters:
key - The identifier of the SFSB to remove passivate state for.

sessionExternallyModified

public void sessionExternallyModified(PackagedSession (src)  session)
Specified by:
sessionExternallyModified in interface HASessionState.HASessionStateListener (src)

newSessionStateTopology

public void newSessionStateTopology(HAPartition (src)  haSubPartition)