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

java.lang.Object
  extended by org.mobicents.servlet.sip.core.session.SipSessionImpl
      extended by org.jboss.web.tomcat.service.session.ClusteredSipSession
          extended by org.jboss.web.tomcat.service.session.JBossCacheClusteredSipSession
              extended by org.jboss.web.tomcat.service.session.SessionBasedClusteredSipSession
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, SipSession, MobicentsSipSession

public class SessionBasedClusteredSipSession
extends JBossCacheClusteredSipSession

Implementation of a clustered sip 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_application_name    (path + session id is unique)
          /sipappsessionid    Map(id, session)
                          (VERSION_KEY, version)  // Used for version tracking. version is an Integer.
                /sipsessionid   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.SipSessionImpl
SipSessionImpl.SipSessionEventType
 
Nested classes/interfaces inherited from interface javax.servlet.sip.SipSession
SipSession.State
 
Field Summary
protected static java.lang.String info
          Descriptive information describing this Session implementation.
 
Fields inherited from class org.jboss.web.tomcat.service.session.JBossCacheClusteredSipSession
proxy_
 
Fields inherited from class org.jboss.web.tomcat.service.session.ClusteredSipSession
excludedAttributes, firstAccess, hasActivationListener, invalidationPolicy, isSessionModifiedSinceLastSave, lastReplicated, maxUnreplicatedFactor, maxUnreplicatedInterval, outdatedTime, outdatedVersion, replicationExcludes, sessionAttributesDirty, sessionMetadataDirty, sipAppSessionParentKey, sm, version
 
Fields inherited from class org.mobicents.servlet.sip.core.session.SipSessionImpl
creationTime, derivedSipSessions, handlerServlet, invalidateWhenReady, isValid, key, lastAccessedTime, ongoingTransactions, outboundInterface, parentSession, proxyBranch, readyToInvalidate, routingRegion, sessionCreatingDialog, sessionCreatingTransaction, sipApplicationSession, sipFactory, sipSessionAttributeMap, state, stateInfo, subscriberURI, supervisedMode, userPrincipal
 
Constructor Summary
SessionBasedClusteredSipSession(SipSessionKey key, SipFactoryImpl sipFactoryImpl, MobicentsSipApplicationSession mobicentsSipApplicationSession)
           
 
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.JBossCacheClusteredSipSession
establishProxy, initAfterLoad, processSessionRepl, removeAttributeInternal, removeFromManager, removeJBossInternalAttribute
 
Methods inherited from class org.jboss.web.tomcat.service.session.ClusteredSipSession
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, setOutdatedVersion, setPrincipal, setVersion, updateAccessTimeFromOutdatedTime, updateLastReplicated
 
Methods inherited from class org.mobicents.servlet.sip.core.session.SipSessionImpl
addDerivedSipSessions, addOngoingTransaction, createRequest, findDerivedSipSession, getApplicationSession, getCallId, getCreationTime, getDerivedSipSessions, getHandler, getId, getInvalidateWhenReady, getKey, getLastAccessedTime, getLocalParty, getOngoingTransactions, getOutboundInterface, getProxyBranch, getRegion, getRegionInternal, getRemoteParty, getServletContext, getSessionCreatingDialog, getSessionCreatingTransaction, getSipApplicationSession, getSipSessionAttributeMap, getSipSubscriberURI, getState, getStateInfo, getSubscriberURI, getSupervisedMode, getUserPrincipal, hasOngoingTransaction, invalidate, isReadyToInvalidate, isSupervisedMode, onDialogTimeout, onReadyToInvalidate, onTerminatedState, removeAttribute, removeDerivedSipSession, removeOngoingTransaction, setHandler, setInvalidateWhenReady, setKey, setLocalParty, setOutboundInterface, setOutboundInterface, setParentSession, setProxyBranch, setRemoteParty, setRoutingRegion, setSessionCreatingDialog, setSessionCreatingTransaction, setSipApplicationSession, setSipSessionAttributeMap, setSipSubscriberURI, setState, setStateInfo, setSupervisedMode, setUserPrincipal, updateStateOnResponse, updateStateOnSubsequentRequest
 
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

SessionBasedClusteredSipSession

public SessionBasedClusteredSipSession(SipSessionKey key,
                                       SipFactoryImpl sipFactoryImpl,
                                       MobicentsSipApplicationSession mobicentsSipApplicationSession)
Parameters:
key -
sipFactoryImpl -
mobicentsSipApplicationSession -
Method Detail

toString

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

Overrides:
toString in class ClusteredSipSession

removeMyself

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

Specified by:
removeMyself in class ClusteredSipSession

removeMyselfLocal

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

Specified by:
removeMyselfLocal in class ClusteredSipSession

populateAttributes

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

Specified by:
populateAttributes in class JBossCacheClusteredSipSession

getJBossInternalAttribute

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

removeJBossInternalAttribute

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

getJBossInternalAttributes

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

setJBossInternalAttribute

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

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 ClusteredSipSession
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 ClusteredSipSession
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 ClusteredSipSession


Copyright © 2008. All Rights Reserved.