|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.mx.util.JBossNotificationBroadcasterSupport org.jboss.system.ServiceMBeanSupport 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 String |
DEFAULT_STORE_DIRECTORY_NAME
The default store directory name ("sessions"). |
Fields inherited from class org.jboss.system.ServiceMBeanSupport |
log, server, SERVICE_CONTROLLER_SIG, serviceName |
Fields inherited from interface org.jboss.system.ServiceMBean |
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 ctx)
Restores session state from the serialized file & invokes SessionBean.ejbActivate() on the target bean. |
void |
createdSession(StatefulSessionEnterpriseContext ctx)
Non-operation. |
Object |
createId(StatefulSessionEnterpriseContext 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. |
File |
getStoreDirectory()
Returns the directory used to store session passivation state files. |
String |
getStoreDirectoryName()
Get the sub-directory name under the server data directory where session data is stored. |
void |
passivateSession(StatefulSessionEnterpriseContext ctx)
Invokes SessionBean.ejbPassivate() on the target bean and saves the
state of the session to a file. |
void |
removePassivated(Object id)
Removes the saved state file (if any) for the given session id. |
void |
removeSession(StatefulSessionEnterpriseContext ctx)
Invokes SessionBean.ejbRemove() on the target bean. |
void |
setContainer(Container con)
Saves a reference to the StatefulSessionContainer for
its bean type. |
void |
setPurgeEnabled(boolean flag)
Set the stale session state purge enabled flag. |
void |
setStoreDirectoryName(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 |
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 |
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 |
create, destroy, start, stop |
Methods inherited from interface org.jboss.system.ServiceMBean |
getName, getState, getStateString, jbossInternalLifecycle |
Field Detail |
public static final String DEFAULT_STORE_DIRECTORY_NAME
Constructor Detail |
public StatefulSessionFilePersistenceManager()
Method Detail |
public void setContainer(Container con)
StatefulSessionContainer
for
its bean type.
setContainer
in interface ContainerPlugin
con
- The container using this plugin. This may be null if the
plugin is being disassociated from a container.
ClassCastException
- Container is not a StatefulSessionContainer.public void setStoreDirectoryName(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.
setStoreDirectoryName
in interface StatefulSessionFilePersistenceManagerMBean
dirName
- A sub-directory name.public String getStoreDirectoryName()
setStoreDirectoryName(java.lang.String)
public void setPurgeEnabled(boolean flag)
flag
- The toggle flag to enable or disable purging.public boolean getPurgeEnabled()
public File getStoreDirectory()
protected void createService() throws Exception
Purges any existing session data found.
Exception
protected void destroyService() throws Exception
Exception
public Object createId(StatefulSessionEnterpriseContext ctx) throws Exception
StatefulSessionPersistenceManager
createId
in interface StatefulSessionPersistenceManager
ctx
- The context of the SFSB to create an unique identifier for.
UID
.
Exception
- Failed to create unique identifier.public void createdSession(StatefulSessionEnterpriseContext ctx) throws Exception
createdSession
in interface StatefulSessionPersistenceManager
ctx
- The context of the SFSB which was created.
Exception
public void activateSession(StatefulSessionEnterpriseContext ctx) throws RemoteException
SessionBean.ejbActivate()
on the target bean.
activateSession
in interface StatefulSessionPersistenceManager
ctx
- The context of the SFSB to activate.
RemoteException
public void passivateSession(StatefulSessionEnterpriseContext ctx) throws RemoteException
SessionBean.ejbPassivate()
on the target bean and saves the
state of the session to a file.
passivateSession
in interface StatefulSessionPersistenceManager
ctx
- The context of the SFSB to passivate.
RemoteException
public void removeSession(StatefulSessionEnterpriseContext ctx) throws RemoteException, javax.ejb.RemoveException
SessionBean.ejbRemove()
on the target bean.
removeSession
in interface StatefulSessionPersistenceManager
ctx
- The context of the SFSB to remove.
RemoteException
javax.ejb.RemoveException
public void removePassivated(Object id)
removePassivated
in interface StatefulSessionPersistenceManager
id
- The identifier of the SFSB to remove passivate state for.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |