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

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.AttributeBasedClusteredSipSession
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, SipSession, MobicentsSipSession

public class AttributeBasedClusteredSipSession
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.AttributeBasedClusteredSession JBOSS AS 4.2.2 Tag The replication granularity level is attribute based; that is, we replicate only the dirty attributes. We use JBossCache for our internal, deplicated data store. The internal structure is like in JBossCache:

 /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.
                        /ATTRIBUTE    Map(attr_key, value)
 

Note that the isolation level of the cache dictates the concurrency behavior. Also note that session and its associated attribtues are stored in different nodes. This will be ok since cache will take care of concurrency. When replicating, we will need to replicate both session and its attributes.

Author:
Jean Deruelle, Ben Wang, Brian Stansberry
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[] EMPTY_ARRAY
           
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
protected AttributeBasedClusteredSipSession(SipSessionKey key, SipFactoryImpl sipFactoryImpl, MobicentsSipApplicationSession mobicentsSipApplicationSession)
           
 
Method Summary
protected  void attributeChanged(java.lang.Object key, java.lang.Object value, int op)
           
protected  void clearAttrChangedMaps()
           
protected  java.lang.Object getJBossInternalAttribute(java.lang.String name)
           
protected  java.util.Map getJBossInternalAttributes()
           
protected  java.util.Set getJBossInternalKeys()
           
protected  java.lang.String[] keys()
          Method inherited from Tomcat.
protected  void populateAttributes()
          Populate the attributes stored in the distributed store to local transient ones.
 void processSessionRepl()
          Overrides the superclass version to read in the attributes.
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 key, java.lang.Object value)
           
 java.lang.String toString()
          Return a string representation of this object.
 
Methods inherited from class org.jboss.web.tomcat.service.session.JBossCacheClusteredSipSession
establishProxy, initAfterLoad, 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, getReplicateSessionBody, getSessionAttributesDirty, getSessionMetadataDirty, getUseJK, getVersion, incrementVersion, isGetDirty, isMutable, isNewData, isOutdated, isSessionDirty, isValid, isValid, passivate, readExternal, removeAttributeInternal, removeAttributeInternal, removeExcludedAttributes, sessionAttributesDirty, sessionDirty, sessionMetadataDirty, setAttribute, setInternalAttribute, setIsOutdated, setMaxUnreplicatedFactor, setOutdatedVersion, setPrincipal, setVersion, updateAccessTimeFromOutdatedTime, updateLastReplicated, writeExternal
 
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

EMPTY_ARRAY

protected static final java.lang.String[] EMPTY_ARRAY

info

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

See Also:
Constant Field Values
Constructor Detail

AttributeBasedClusteredSipSession

protected AttributeBasedClusteredSipSession(SipSessionKey key,
                                            SipFactoryImpl sipFactoryImpl,
                                            MobicentsSipApplicationSession mobicentsSipApplicationSession)
Method Detail

toString

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

Overrides:
toString in class ClusteredSipSession

processSessionRepl

public void processSessionRepl()
Overrides the superclass version to read in the attributes.

Overrides:
processSessionRepl in class JBossCacheClusteredSipSession

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()
Populate the attributes stored in the distributed store to local transient ones.

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

getJBossInternalKeys

protected java.util.Set getJBossInternalKeys()

keys

protected java.lang.String[] keys()
Method inherited from Tomcat. Return zero-length based string if not found.

Overrides:
keys in class ClusteredSipSession

setJBossInternalAttribute

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

attributeChanged

protected void attributeChanged(java.lang.Object key,
                                java.lang.Object value,
                                int op)

clearAttrChangedMaps

protected void clearAttrChangedMaps()


Copyright © 2008. All Rights Reserved.