org.jboss.ha.httpsession.server
Interface ClusteredHTTPSessionServiceMBean

All Superinterfaces:
Service (src) , ServiceMBean (src)
All Known Implementing Classes:
ClusteredHTTPSessionService (src)

public interface ClusteredHTTPSessionServiceMBean
extends ServiceMBean (src)

Service that provide unified access to clustered HTTPSessions for servlets.

See Also:
ClusteredHTTPSession (src) , ClusteredHTTPSessionHome (src)

Field Summary
 
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
 
Method Summary
 SerializableHttpSession (src) getHttpSession(java.lang.String sessionId, java.lang.ClassLoader tcl)
          Return the HttpSession associated to a session id.
 java.lang.String getSessionId()
          Generates a new session id available cluster-wide
 long getSessionTimeout()
          Indicate the duration, in ms, after which the session can be cleaned if no access occurs.
 boolean getUseLocalBean()
           
 void removeHttpSession(java.lang.String sessionId)
          Remove an HttpSession from the cluster (log off for example)
 void setHttpSession(java.lang.String sessionId, SerializableHttpSession (src)  session)
          Associate a new session with the session id.
 void setSessionTimeout(long miliseconds)
          Indicate the duration, in ms, after which the session can be cleaned if no access occurs.
 void setUseLocalBean(boolean useLocal)
          Indicates whether the service should use the local and home interfaces of the entity bean or the remote and remote home interfaces (depending if they are in the same JVM).
 
Methods inherited from interface org.jboss.system.ServiceMBean (src)
getName, getState, getStateString, jbossInternalLifecycle
 
Methods inherited from interface org.jboss.system.Service (src)
create, destroy, start, stop
 

Method Detail

getHttpSession

public SerializableHttpSession (src)  getHttpSession(java.lang.String sessionId,
                                              java.lang.ClassLoader tcl)
                                       throws EJBException (src) 
Return the HttpSession associated to a session id. As all session id are shared for all Web Applications, all sessions ids accross all applications and all nodes must be distincts! The creation and last access time of the session may not be correct if they are the only thing that has been modified on a distant node (and no attribute). See setHttpSession for more information.

Throws:
EJBException (src)

setHttpSession

public void setHttpSession(java.lang.String sessionId,
                           SerializableHttpSession (src)  session)
                    throws EJBException (src) 
Associate a new session with the session id. To reduce the cluster communication, if the only thing that has changed in the session is the last accessed time, the new session is kept in cache but not replicated on the other nodes. Thus, if you use a front-end load-balancer that support sticky session, that is not a problem because a client will always target the same node and receive the updated session available in cache. Nevertheless, as soon as an attribute is modified in the session, it is replicated in the cluster.

Throws:
EJBException (src)

removeHttpSession

public void removeHttpSession(java.lang.String sessionId)
                       throws EJBException (src) 
Remove an HttpSession from the cluster (log off for example)

Throws:
EJBException (src)

getSessionId

public java.lang.String getSessionId()
Generates a new session id available cluster-wide


getSessionTimeout

public long getSessionTimeout()
Indicate the duration, in ms, after which the session can be cleaned if no access occurs.


setSessionTimeout

public void setSessionTimeout(long miliseconds)
Indicate the duration, in ms, after which the session can be cleaned if no access occurs.


setUseLocalBean

public void setUseLocalBean(boolean useLocal)
Indicates whether the service should use the local and home interfaces of the entity bean or the remote and remote home interfaces (depending if they are in the same JVM).


getUseLocalBean

public boolean getUseLocalBean()