org.jboss.web.tomcat.service.session
Class SessionBasedClusteredSipApplicationSession

java.lang.Object
  extended by org.mobicents.servlet.sip.core.session.SipApplicationSessionImpl
      extended by org.jboss.web.tomcat.service.session.ClusteredSipApplicationSession
          extended by org.jboss.web.tomcat.service.session.JBossCacheClusteredSipApplicationSession
              extended by org.jboss.web.tomcat.service.session.SessionBasedClusteredSipApplicationSession
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, SipApplicationSession, MobicentsSipApplicationSession

public class SessionBasedClusteredSipApplicationSession
extends JBossCacheClusteredSipApplicationSession

Implementation of a clustered sip application session for the JBossCacheManager. This class is based on the following Jboss class org.jboss.web.tomcat.service.session.SessionBasedClusteredSession JBOSS AS 4.2.2 Tag The replication granularity level is session based; that is, we replicate per whole session object. We use JBossCache for our internal replicated data store. The internal structure in JBossCache is as follows:

 /SIPSESSION
    /hostname
       /sip_app_name    (path + session id is unique)
          /sipapplicationsessionid    Map(id, session)         
                    (VERSION_KEY, version)  // Used for version tracking. version is an Integer.
 

Note that the isolation level of the cache dictates the concurrency behavior.

Author:
Ben Wang, Brian Stansberry, Jean Deruelle
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.mobicents.servlet.sip.core.session.SipApplicationSessionImpl
SipApplicationSessionImpl.SipApplicationSessionTimerTask
 
Nested classes/interfaces inherited from interface javax.servlet.sip.SipApplicationSession
SipApplicationSession.Protocol
 
Field Summary
protected static java.lang.String info
          Descriptive information describing this Session implementation.
 
Fields inherited from class org.jboss.web.tomcat.service.session.JBossCacheClusteredSipApplicationSession
proxy_
 
Fields inherited from class org.jboss.web.tomcat.service.session.ClusteredSipApplicationSession
alwaysReplicateMetadata, excludedAttributes, firstAccess, futureExpirationTimeOnPassivation, hasActivationListener, httpSessionsOnPassivation, invalidationPolicy, isSessionModifiedSinceLastSave, lastReplicated, maxUnreplicatedFactor, maxUnreplicatedInterval, outdatedTime, outdatedVersion, replicationExcludes, sessionAttributesDirty, sessionMetadataDirty, sipSessionsOnPassivation, sm, version
 
Fields inherited from class org.mobicents.servlet.sip.core.session.SipApplicationSessionImpl
creationTime, currentRequestHandler, executorService, expirationTimerFuture, expirationTimerTask, expired, httpSessions, invalidateWhenReady, isValid, key, lastAccessedTime, readyToInvalidate, servletTimers, sipApplicationSessionAttributeMap, sipContext, sipSessions
 
Fields inherited from interface org.mobicents.servlet.sip.core.session.MobicentsSipApplicationSession
SIP_APPLICATION_KEY_PARAM_NAME
 
Constructor Summary
SessionBasedClusteredSipApplicationSession(SipApplicationSessionKey key, SipContext sipContext)
           
 
Method Summary
protected  java.lang.Object getJBossInternalAttribute(java.lang.String name)
           
protected  java.util.Map getJBossInternalAttributes()
           
 boolean getReplicateSessionBody()
          Overrides the superclass version to return true if either the metadata or the attributes are dirty.
protected  void populateAttributes()
          Does nothing -- all attributes are populated already
 void readExternal(java.io.ObjectInput in)
          Overrides the superclass version by additionally reading the attributes map.
protected  java.lang.Object removeJBossInternalAttribute(java.lang.String name, boolean localCall, boolean localOnly)
           
 void removeMyself()
          Remove myself from the internal store.
 void removeMyselfLocal()
          Remove myself from the local internal store.
protected  java.lang.Object setJBossInternalAttribute(java.lang.String name, java.lang.Object value)
           
 java.lang.String toString()
          Return a string representation of this object.
 void writeExternal(java.io.ObjectOutput out)
          Overrides the superclass version by appending the attributes map.
 
Methods inherited from class org.jboss.web.tomcat.service.session.JBossCacheClusteredSipApplicationSession
establishProxy, initAfterLoad, processSessionRepl, removeAttributeInternal, removeFromManager, removeJBossInternalAttribute
 
Methods inherited from class org.jboss.web.tomcat.service.session.ClusteredSipApplicationSession
access, activate, canAttributeBeReplicated, clearOutdated, expire, expire, getAttribute, getAttributeInternal, getAttributeNames, getAttributesInternal, getExceedsMaxUnreplicatedInterval, getLastReplicated, getMaxUnreplicatedFactor, getMaxUnreplicatedInterval, getSessionAttributesDirty, getSessionMetadataDirty, getUseJK, getVersion, incrementVersion, isGetDirty, isMutable, isNewData, isOutdated, isSessionDirty, isValid, isValid, keys, passivate, removeAttributeInternal, removeAttributeInternal, removeExcludedAttributes, sessionAttributesDirty, sessionDirty, sessionMetadataDirty, setAttribute, setInternalAttribute, setIsOutdated, setMaxUnreplicatedFactor, setMaxUnreplicatedInterval, setOutdatedVersion, setVersion, updateAccessTimeFromOutdatedTime, updateLastReplicated
 
Methods inherited from class org.mobicents.servlet.sip.core.session.SipApplicationSessionImpl
addHttpSession, addServletTimer, addSipSession, encodeURI, encodeURL, findHttpSession, getApplicationName, getCreationTime, getCurrentRequestHandler, getExecutorService, getExpirationTime, getId, getInvalidateWhenReady, getKey, getLastAccessedTime, getSession, getSessions, getSessions, getSipContext, getSipSession, getTimer, getTimers, hasTimerListener, invalidate, isExpired, isReadyToInvalidate, notifySipApplicationSessionListeners, onSipSessionReadyToInvalidate, removeAttribute, removeHttpSession, removeServletTimer, removeSipSession, setCurrentRequestHandler, setExpired, setExpires, setInvalidateWhenReady, setKey, tryToInvalidate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

info

protected static final java.lang.String info
Descriptive information describing this Session implementation.

See Also:
Constant Field Values
Constructor Detail

SessionBasedClusteredSipApplicationSession

public SessionBasedClusteredSipApplicationSession(SipApplicationSessionKey key,
                                                  SipContext sipContext)
Parameters:
key -
sipFactoryImpl -
mobicentsSipApplicationSession -
Method Detail

toString

public java.lang.String toString()
Return a string representation of this object.

Overrides:
toString in class ClusteredSipApplicationSession

removeMyself

public void removeMyself()
Description copied from class: ClusteredSipApplicationSession
Remove myself from the internal store.

Specified by:
removeMyself in class ClusteredSipApplicationSession

removeMyselfLocal

public void removeMyselfLocal()
Description copied from class: ClusteredSipApplicationSession
Remove myself from the local internal store.

Specified by:
removeMyselfLocal in class ClusteredSipApplicationSession

populateAttributes

protected void populateAttributes()
Does nothing -- all attributes are populated already

Specified by:
populateAttributes in class JBossCacheClusteredSipApplicationSession

getJBossInternalAttribute

protected java.lang.Object getJBossInternalAttribute(java.lang.String name)
Specified by:
getJBossInternalAttribute in class ClusteredSipApplicationSession

removeJBossInternalAttribute

protected java.lang.Object removeJBossInternalAttribute(java.lang.String name,
                                                        boolean localCall,
                                                        boolean localOnly)
Specified by:
removeJBossInternalAttribute in class JBossCacheClusteredSipApplicationSession

getJBossInternalAttributes

protected java.util.Map getJBossInternalAttributes()
Specified by:
getJBossInternalAttributes in class ClusteredSipApplicationSession

setJBossInternalAttribute

protected java.lang.Object setJBossInternalAttribute(java.lang.String name,
                                                     java.lang.Object value)
Specified by:
setJBossInternalAttribute in class ClusteredSipApplicationSession

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Overrides the superclass version by additionally reading the attributes map.

This method is deliberately public so it can be used to reset the internal state of a session object using serialized contents replicated from another JVM via JBossCache.

Specified by:
readExternal in interface java.io.Externalizable
Overrides:
readExternal in class ClusteredSipApplicationSession
Throws:
java.io.IOException
java.lang.ClassNotFoundException
See Also:
ClusteredSession.readExternal(java.io.ObjectInput)

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Overrides the superclass version by appending the attributes map. Does not write any attributes whose names are found in ClusteredSession.excludedAttributes.

Specified by:
writeExternal in interface java.io.Externalizable
Overrides:
writeExternal in class ClusteredSipApplicationSession
Throws:
java.io.IOException
See Also:
ClusteredSession.writeExternal(java.io.ObjectOutput)

getReplicateSessionBody

public boolean getReplicateSessionBody()
Overrides the superclass version to return true if either the metadata or the attributes are dirty.

Overrides:
getReplicateSessionBody in class ClusteredSipApplicationSession


Copyright © 2009. All Rights Reserved.