站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 cluster API Documentation 英文版文档

ClusteredHTTPSessionServiceMBean (JBoss Cluster API) - JBoss 4.0.1 sp1 cluster API Documentation 英文版文档


org.jboss.ha.httpsession.server
Interface ClusteredHTTPSessionServiceMBean

All Superinterfaces:
org.jboss.system.Service, org.jboss.system.ServiceMBean
All Known Implementing Classes:
ClusteredHTTPSessionService

public interface ClusteredHTTPSessionServiceMBean
extends org.jboss.system.ServiceMBean

Service that provide unified access to clustered HTTPSessions for servlets.

Version:
$Revision: 1.3 $

Revisions:

31. d锟絚embre 2001 Sacha Labourey:

  • First implementation
Author:
Sacha Labourey.
See Also:
ClusteredHTTPSession, ClusteredHTTPSessionHome

Field Summary
 
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
 
Method Summary
 SerializableHttpSession getHttpSession(String sessionId, ClassLoader tcl)
          Return the HttpSession associated to a session id.
 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(String sessionId)
          Remove an HttpSession from the cluster (log off for example)
 void setHttpSession(String sessionId, SerializableHttpSession 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
getName, getState, getStateString, jbossInternalLifecycle
 
Methods inherited from interface org.jboss.system.Service
create, destroy, start, stop
 

Method Detail

getHttpSession

public SerializableHttpSession getHttpSession(String sessionId,
                                              ClassLoader tcl)
                                       throws javax.ejb.EJBException
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:
javax.ejb.EJBException

setHttpSession

public void setHttpSession(String sessionId,
                           SerializableHttpSession session)
                    throws javax.ejb.EJBException
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:
javax.ejb.EJBException

removeHttpSession

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

Throws:
javax.ejb.EJBException

getSessionId

public 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()


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.