JBoss.org Community Documentation
The StatefulSessionPersistenceManager
is responsible for the persistence of stateful SessionBeans
. This includes the following:
Creating stateful sessions in a storage
Activating stateful sessions from a storage
Passivating stateful sessions to a storage
Removing stateful sessions from a storage
The StatefulSessionPersistenceManager
interface is shown below.
public interface StatefulSessionPersistenceManager extends ContainerPlugin { public void createSession(Method m, Object[] args, StatefulSessionEnterpriseContext ctx) throws Exception; public void activateSession(StatefulSessionEnterpriseContext ctx) throws RemoteException; public void passivateSession(StatefulSessionEnterpriseContext ctx) throws RemoteException; public void removeSession(StatefulSessionEnterpriseContext ctx) throws RemoteException, RemoveException; public void removePassivated(Object key); }
Example 11.10. The org.jboss.ejb.StatefulSessionPersistenceManager interface
The default implementation of the StatefulSessionPersistenceManager
interface is org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager
. As its name implies, StatefulSessionFilePersistenceManager
utilizes the file system to persist stateful session beans. More specifically, the persistence manager serializes beans in a flat file whose name is composed of the bean name and session id with a .ser
extension. The persistence manager restores a bean's state during activation and respectively stores its state during passivation from the bean's .ser
file.