|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.mx.util.JBossNotificationBroadcasterSupport (src)
org.jboss.system.ServiceMBeanSupport (src)
org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager
A file-based stateful session bean persistence manager.
Reads and writes session bean objects to files by using the standard Java serialization mechanism.
Passivated state files are stored under: jboss-server-data-dir/storeDirectoryName/ejb-name-unique-id.
Since ejb-name is not unique across deployments we generate a unique-id to make sure that beans with the same EJB name do not collide.
Field Summary | |
static java.lang.String |
DEFAULT_STORE_DIRECTORY_NAME
The default store directory name ("sessions"). |
Fields inherited from class org.jboss.system.ServiceMBeanSupport (src) |
log, server, SERVICE_CONTROLLER_SIG, serviceName |
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 | |
StatefulSessionFilePersistenceManager()
|
Method Summary | |
void |
activateSession(StatefulSessionEnterpriseContext (src) ctx)
Restores session state from the serialized file & invokes SessionBean.ejbActivate() on the target bean. |
void |
createdSession(StatefulSessionEnterpriseContext (src) ctx)
Non-operation. |
java.lang.Object |
createId(StatefulSessionEnterpriseContext (src) ctx)
Create a unique identifier for the given SFSB context. |
protected void |
createService()
Setup the session data storage directory. |
protected void |
destroyService()
Purge any data in the store, and then the store directory too. |
boolean |
getPurgeEnabled()
Get the stale session state purge enabled flag. |
java.io.File |
getStoreDirectory()
Returns the directory used to store session passivation state files. |
java.lang.String |
getStoreDirectoryName()
Get the sub-directory name under the server data directory where session data is stored. |
void |
passivateSession(StatefulSessionEnterpriseContext (src) ctx)
Invokes SessionBean.ejbPassivate() on the target bean and saves the
state of the session to a file. |
void |
removePassivated(java.lang.Object id)
Removes the saved state file (if any) for the given session id. |
void |
removeSession(StatefulSessionEnterpriseContext (src) ctx)
Invokes SessionBean.ejbRemove() on the target bean. |
void |
setContainer(Container (src) con)
Saves a reference to the StatefulSessionContainer (src) for
its bean type. |
void |
setPurgeEnabled(boolean flag)
Set the stale session state purge enabled flag. |
void |
setStoreDirectoryName(java.lang.String dirName)
Set the sub-directory name under the server data directory where session data will be stored. |
Methods inherited from class org.jboss.system.ServiceMBeanSupport (src) |
create, destroy, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister, start, startService, stop, stopService |
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 |
Field Detail |
public static final java.lang.String DEFAULT_STORE_DIRECTORY_NAME
Constructor Detail |
public StatefulSessionFilePersistenceManager()
Method Detail |
public void setContainer(Container (src) con)
StatefulSessionContainer
(src) for
its bean type.
setContainer
in interface ContainerPlugin (src)
con
- The container using this plugin. This may be null if the
plugin is being disassociated from a container.
java.lang.ClassCastException
- Container is not a StatefulSessionContainer.public void setStoreDirectoryName(java.lang.String dirName)
This value will be appened to the value of jboss-server-data-dir.
This value is only used during creation and will not dynamically change the store directory when set after the create step has finished.
dirName
- A sub-directory name.public java.lang.String getStoreDirectoryName()
setStoreDirectoryName(java.lang.String)
public void setPurgeEnabled(boolean flag)
flag
- The toggle flag to enable or disable purging.public boolean getPurgeEnabled()
public java.io.File getStoreDirectory()
protected void createService() throws java.lang.Exception
Purges any existing session data found.
createService
in class ServiceMBeanSupport (src)
java.lang.Exception
protected void destroyService() throws java.lang.Exception
destroyService
in class ServiceMBeanSupport (src)
java.lang.Exception
public java.lang.Object createId(StatefulSessionEnterpriseContext (src) ctx) throws java.lang.Exception
StatefulSessionPersistenceManager (src)
createId
in interface StatefulSessionPersistenceManager (src)
ctx
- The context of the SFSB to create an unique identifier for.
UID
(src) .
java.lang.Exception
- Failed to create unique identifier.public void createdSession(StatefulSessionEnterpriseContext (src) ctx) throws java.lang.Exception
createdSession
in interface StatefulSessionPersistenceManager (src)
ctx
- The context of the SFSB which was created.
java.lang.Exception
public void activateSession(StatefulSessionEnterpriseContext (src) ctx) throws java.rmi.RemoteException
SessionBean.ejbActivate()
on the target bean.
activateSession
in interface StatefulSessionPersistenceManager (src)
ctx
- The context of the SFSB to activate.
java.rmi.RemoteException
public void passivateSession(StatefulSessionEnterpriseContext (src) ctx) throws java.rmi.RemoteException
SessionBean.ejbPassivate()
on the target bean and saves the
state of the session to a file.
passivateSession
in interface StatefulSessionPersistenceManager (src)
ctx
- The context of the SFSB to passivate.
java.rmi.RemoteException
public void removeSession(StatefulSessionEnterpriseContext (src) ctx) throws java.rmi.RemoteException, RemoveException (src)
SessionBean.ejbRemove()
on the target bean.
removeSession
in interface StatefulSessionPersistenceManager (src)
ctx
- The context of the SFSB to remove.
java.rmi.RemoteException
RemoveException (src)
public void removePassivated(java.lang.Object id)
removePassivated
in interface StatefulSessionPersistenceManager (src)
id
- The identifier of the SFSB to remove passivate state for.
|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |