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

java.lang.Object
  extended by org.jboss.web.tomcat.service.session.JBossCacheService
      extended by org.jboss.web.tomcat.service.session.ConvergedJBossCacheService

public class ConvergedJBossCacheService
extends org.jboss.web.tomcat.service.session.JBossCacheService

Implementation of a converged wrapper jboss cache service. Based on JBossCacheService JBOSS AS 4.2.2 Tag I was forced to copy over most of the code since some things that needed to be adapted were private


Field Summary
static java.lang.String ATTRIBUTE
           
static java.lang.String BUDDY_BACKUP
           
static org.jboss.cache.Fqn BUDDY_BACKUP_FQN
           
protected static org.jboss.logging.Logger log_
           
static java.lang.String SESSION
           
static java.lang.String SIPSESSION
           
 
Constructor Summary
ConvergedJBossCacheService(java.lang.String treeCacheObjectName)
           
 
Method Summary
 void addObserver(org.jboss.aspects.patterns.observable.Observer session, java.lang.Object pojo)
          Recursively adds session as observer to the pojo graph.
 boolean exists(java.lang.String realId)
           
 java.lang.Object getAttribute(java.lang.String realId, java.lang.String key)
           
 java.util.Set getAttributeKeys(java.lang.String realId)
          Obtain the keys associated with this fqn.
 java.util.Map getAttributes(java.lang.String realId)
          Return all attributes associated with this session id.
 java.lang.Object getPojo(java.lang.String realId, java.lang.String key)
           
 java.util.Set getPojoKeys(java.lang.String realId)
           
 java.util.Map getSessionIds()
          Gets the ids of all sessions in the underlying cache.
 java.lang.Object getSipApplicationSessionAttribute(java.lang.String realId, java.lang.String key)
           
 java.util.Map getSipApplicationSessionAttributes(java.lang.String realId)
          Return all attributes associated with this session id.
 java.util.Map getSipApplicationSessionIds()
          Gets the ids of all sessions in the underlying cache.
 java.lang.Object getSipApplicationSessionPojo(java.lang.String realId, java.lang.String key)
           
 java.util.Set getSipApplicationSessionPojoKeys(java.lang.String realId)
           
 java.lang.Object getSipSessionAttribute(java.lang.String id, java.lang.String realId, java.lang.String key)
           
 java.util.Map getSipSessionAttributes(java.lang.String id, java.lang.String realId)
          Return all attributes associated with this session id.
 java.util.Map getSipSessionIds(java.util.Set sipApplicationSessionIds, java.lang.Object owner)
          Gets the ids of all sessions in the underlying cache.
 java.lang.Object getSipSessionPojo(java.lang.String id, java.lang.String realId, java.lang.String key)
           
 java.util.Set getSipSessionPojoKeys(java.lang.String id, java.lang.String realId)
           
 javax.transaction.TransactionManager getTransactionManager()
          Get specfically the BatchModeTransactionManager.
 boolean isMarshallingAvailable()
          Gets whether TreeCache-based marshalling is available
 org.jboss.web.tomcat.service.session.ClusteredSession loadSession(java.lang.String realId, org.jboss.web.tomcat.service.session.ClusteredSession toLoad)
          Loads any serialized data in the cache into the given session using its readExternal method.
 ClusteredSipApplicationSession loadSipApplicationSession(java.lang.String realId, ClusteredSipApplicationSession toLoad)
          Loads any serialized data in the cache into the given session using its readExternal method.
 ClusteredSipSession loadSipSession(java.lang.String id, java.lang.String realId, ClusteredSipSession toLoad)
          Loads any serialized data in the cache into the given session using its readExternal method.
 void putAttribute(java.lang.String realId, java.util.Map map)
           
 void putAttribute(java.lang.String realId, java.lang.String key, java.lang.Object value)
           
 void putSession(java.lang.String realId, org.jboss.web.tomcat.service.session.ClusteredSession session)
           
 void putSipApplicationSession(java.lang.String realId, ClusteredSipApplicationSession session)
           
 void putSipApplicationSessionAttribute(java.lang.String realId, java.util.Map map)
           
 void putSipApplicationSessionAttribute(java.lang.String realId, java.lang.String key, java.lang.Object value)
           
 void putSipSession(java.lang.String realId, ClusteredSipSession session)
           
 void putSipSessionAttribute(java.lang.String id, java.lang.String realId, java.util.Map map)
           
 void putSipSessionAttribute(java.lang.String id, java.lang.String realId, java.lang.String key, java.lang.Object value)
           
 java.lang.Object removeAttribute(java.lang.String realId, java.lang.String key)
           
 void removeAttributes(java.lang.String realId)
           
 void removeAttributesLocal(java.lang.String realId)
           
 void removeObserver(org.jboss.aspects.patterns.observable.Observer session, java.lang.Object pojo)
          Recursively removes session as observer to the pojo graph.
 java.lang.Object removePojo(java.lang.String realId, java.lang.String key)
          Remove pojo from the underlying cache store.
 void removePojoLocal(java.lang.String realId, java.lang.String key)
          Remove all the pojos from the underlying cache store locally without replication.
 void removePojosLocal(java.lang.String realId)
          Remove all the pojos from the underlying cache store locally without replication.
 void removeSession(java.lang.String realId)
           
 void removeSessionLocal(java.lang.String realId)
           
 void removeSessionLocal(java.lang.String realId, java.lang.String dataOwner)
           
 void removeSipApplicationSession(java.lang.String realId)
           
 java.lang.Object removeSipApplicationSessionAttribute(java.lang.String realId, java.lang.String key)
           
 void removeSipApplicationSessionAttributesLocal(java.lang.String realId)
           
 void removeSipApplicationSessionLocal(java.lang.String realId)
           
 java.lang.Object removeSipApplicationSessionPojo(java.lang.String realId, java.lang.String key)
          Remove pojo from the underlying cache store.
 void removeSipApplicationSessionPojoLocal(java.lang.String realId, java.lang.String key)
          Remove all the pojos from the underlying cache store locally without replication.
 void removeSipApplicationSessionPojosLocal(java.lang.String realId)
          Remove all the pojos from the underlying cache store locally without replication.
 void removeSipSession(java.lang.String sipApplicationSessionId, java.lang.String realId)
           
 java.lang.Object removeSipSessionAttribute(java.lang.String id, java.lang.String realId, java.lang.String key)
           
 void removeSipSessionAttributesLocal(java.lang.String id, java.lang.String realId)
           
 void removeSipSessionLocal(java.lang.String id, java.lang.String realId)
           
 java.lang.Object removeSipSessionPojo(java.lang.String id, java.lang.String realId, java.lang.String key)
          Remove pojo from the underlying cache store.
 void removeSipSessionPojoLocal(java.lang.String id, java.lang.String realId, java.lang.String key)
          Remove all the pojos from the underlying cache store locally without replication.
 void removeSipSessionPojosLocal(java.lang.String id, java.lang.String realId)
          Remove all the pojos from the underlying cache store locally without replication.
 java.lang.Object setPojo(java.lang.String realId, java.lang.String key, java.lang.Object pojo)
          store the pojo instance in the cache.
 java.lang.Object setSipApplicationSessionPojo(java.lang.String realId, java.lang.String key, java.lang.Object pojo)
          store the pojo instance in the cache.
 java.lang.Object setSipSessionPojo(java.lang.String id, java.lang.String realId, java.lang.String key, java.lang.Object pojo)
          store the pojo instance in the cache.
 void start(java.lang.ClassLoader tcl, JBossCacheSipManager manager)
           
 void stop()
           
 
Methods inherited from class org.jboss.web.tomcat.service.session.JBossCacheService
start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log_

protected static org.jboss.logging.Logger log_

BUDDY_BACKUP

public static final java.lang.String BUDDY_BACKUP
See Also:
Constant Field Values

BUDDY_BACKUP_FQN

public static final org.jboss.cache.Fqn BUDDY_BACKUP_FQN

SESSION

public static final java.lang.String SESSION
See Also:
Constant Field Values

SIPSESSION

public static final java.lang.String SIPSESSION
See Also:
Constant Field Values

ATTRIBUTE

public static final java.lang.String ATTRIBUTE
See Also:
Constant Field Values
Constructor Detail

ConvergedJBossCacheService

public ConvergedJBossCacheService(java.lang.String treeCacheObjectName)
                           throws org.jboss.web.tomcat.service.session.ClusteringNotSupportedException
Throws:
org.jboss.web.tomcat.service.session.ClusteringNotSupportedException
Method Detail

start

public void start(java.lang.ClassLoader tcl,
                  JBossCacheSipManager manager)

stop

public void stop()
Overrides:
stop in class org.jboss.web.tomcat.service.session.JBossCacheService

getTransactionManager

public javax.transaction.TransactionManager getTransactionManager()
Get specfically the BatchModeTransactionManager.

Overrides:
getTransactionManager in class org.jboss.web.tomcat.service.session.JBossCacheService

isMarshallingAvailable

public boolean isMarshallingAvailable()
Gets whether TreeCache-based marshalling is available

Overrides:
isMarshallingAvailable in class org.jboss.web.tomcat.service.session.JBossCacheService

loadSession

public org.jboss.web.tomcat.service.session.ClusteredSession loadSession(java.lang.String realId,
                                                                         org.jboss.web.tomcat.service.session.ClusteredSession toLoad)
Loads any serialized data in the cache into the given session using its readExternal method.

Overrides:
loadSession in class org.jboss.web.tomcat.service.session.JBossCacheService
Returns:
the session passed as toLoad, or null if the cache had no data stored under the given session id.

loadSipSession

public ClusteredSipSession loadSipSession(java.lang.String id,
                                          java.lang.String realId,
                                          ClusteredSipSession toLoad)
Loads any serialized data in the cache into the given session using its readExternal method.

Returns:
the session passed as toLoad, or null if the cache had no data stored under the given session id.

loadSipApplicationSession

public ClusteredSipApplicationSession loadSipApplicationSession(java.lang.String realId,
                                                                ClusteredSipApplicationSession toLoad)
Loads any serialized data in the cache into the given session using its readExternal method.

Returns:
the session passed as toLoad, or null if the cache had no data stored under the given session id.

putSession

public void putSession(java.lang.String realId,
                       org.jboss.web.tomcat.service.session.ClusteredSession session)
Overrides:
putSession in class org.jboss.web.tomcat.service.session.JBossCacheService

putSipSession

public void putSipSession(java.lang.String realId,
                          ClusteredSipSession session)

putSipApplicationSession

public void putSipApplicationSession(java.lang.String realId,
                                     ClusteredSipApplicationSession session)

removeSession

public void removeSession(java.lang.String realId)
Overrides:
removeSession in class org.jboss.web.tomcat.service.session.JBossCacheService

removeSipSession

public void removeSipSession(java.lang.String sipApplicationSessionId,
                             java.lang.String realId)

removeSipApplicationSession

public void removeSipApplicationSession(java.lang.String realId)

removeSessionLocal

public void removeSessionLocal(java.lang.String realId)
Overrides:
removeSessionLocal in class org.jboss.web.tomcat.service.session.JBossCacheService

removeSipSessionLocal

public void removeSipSessionLocal(java.lang.String id,
                                  java.lang.String realId)

removeSipApplicationSessionLocal

public void removeSipApplicationSessionLocal(java.lang.String realId)

removeSessionLocal

public void removeSessionLocal(java.lang.String realId,
                               java.lang.String dataOwner)
Overrides:
removeSessionLocal in class org.jboss.web.tomcat.service.session.JBossCacheService

exists

public boolean exists(java.lang.String realId)
Overrides:
exists in class org.jboss.web.tomcat.service.session.JBossCacheService

getAttribute

public java.lang.Object getAttribute(java.lang.String realId,
                                     java.lang.String key)
Overrides:
getAttribute in class org.jboss.web.tomcat.service.session.JBossCacheService

getSipApplicationSessionAttribute

public java.lang.Object getSipApplicationSessionAttribute(java.lang.String realId,
                                                          java.lang.String key)

getSipSessionAttribute

public java.lang.Object getSipSessionAttribute(java.lang.String id,
                                               java.lang.String realId,
                                               java.lang.String key)

putAttribute

public void putAttribute(java.lang.String realId,
                         java.lang.String key,
                         java.lang.Object value)
Overrides:
putAttribute in class org.jboss.web.tomcat.service.session.JBossCacheService

putSipApplicationSessionAttribute

public void putSipApplicationSessionAttribute(java.lang.String realId,
                                              java.lang.String key,
                                              java.lang.Object value)

putSipSessionAttribute

public void putSipSessionAttribute(java.lang.String id,
                                   java.lang.String realId,
                                   java.lang.String key,
                                   java.lang.Object value)

putAttribute

public void putAttribute(java.lang.String realId,
                         java.util.Map map)
Overrides:
putAttribute in class org.jboss.web.tomcat.service.session.JBossCacheService

putSipApplicationSessionAttribute

public void putSipApplicationSessionAttribute(java.lang.String realId,
                                              java.util.Map map)

putSipSessionAttribute

public void putSipSessionAttribute(java.lang.String id,
                                   java.lang.String realId,
                                   java.util.Map map)

removeAttributes

public void removeAttributes(java.lang.String realId)
Overrides:
removeAttributes in class org.jboss.web.tomcat.service.session.JBossCacheService

removeAttribute

public java.lang.Object removeAttribute(java.lang.String realId,
                                        java.lang.String key)
Overrides:
removeAttribute in class org.jboss.web.tomcat.service.session.JBossCacheService

removeSipApplicationSessionAttribute

public java.lang.Object removeSipApplicationSessionAttribute(java.lang.String realId,
                                                             java.lang.String key)

removeSipSessionAttribute

public java.lang.Object removeSipSessionAttribute(java.lang.String id,
                                                  java.lang.String realId,
                                                  java.lang.String key)

removeAttributesLocal

public void removeAttributesLocal(java.lang.String realId)
Overrides:
removeAttributesLocal in class org.jboss.web.tomcat.service.session.JBossCacheService

removeSipApplicationSessionAttributesLocal

public void removeSipApplicationSessionAttributesLocal(java.lang.String realId)

removeSipSessionAttributesLocal

public void removeSipSessionAttributesLocal(java.lang.String id,
                                            java.lang.String realId)

getAttributeKeys

public java.util.Set getAttributeKeys(java.lang.String realId)
Obtain the keys associated with this fqn. Note that it is not the fqn children.

Overrides:
getAttributeKeys in class org.jboss.web.tomcat.service.session.JBossCacheService

getAttributes

public java.util.Map getAttributes(java.lang.String realId)
Return all attributes associated with this session id.

Overrides:
getAttributes in class org.jboss.web.tomcat.service.session.JBossCacheService
Parameters:
realId - the session id with any jvmRoute removed
Returns:
the attributes, or any empty Map if none are found.

getSipApplicationSessionAttributes

public java.util.Map getSipApplicationSessionAttributes(java.lang.String realId)
Return all attributes associated with this session id.

Parameters:
realId - the session id with any jvmRoute removed
Returns:
the attributes, or any empty Map if none are found.

getSipSessionAttributes

public java.util.Map getSipSessionAttributes(java.lang.String id,
                                             java.lang.String realId)
Return all attributes associated with this session id.

Parameters:
realId - the session id with any jvmRoute removed
Returns:
the attributes, or any empty Map if none are found.

getSessionIds

public java.util.Map getSessionIds()
                            throws org.jboss.cache.CacheException
Gets the ids of all sessions in the underlying cache.

Overrides:
getSessionIds in class org.jboss.web.tomcat.service.session.JBossCacheService
Returns:
Set containing all of the session ids of sessions in the cache (with any jvmRoute removed) or null if there are no sessions in the cache.
Throws:
org.jboss.cache.CacheException

getSipSessionIds

public java.util.Map getSipSessionIds(java.util.Set sipApplicationSessionIds,
                                      java.lang.Object owner)
                               throws org.jboss.cache.CacheException
Gets the ids of all sessions in the underlying cache.

Returns:
Set containing all of the session ids of sessions in the cache (with any jvmRoute removed) or null if there are no sessions in the cache.
Throws:
org.jboss.cache.CacheException

getSipApplicationSessionIds

public java.util.Map getSipApplicationSessionIds()
                                          throws org.jboss.cache.CacheException
Gets the ids of all sessions in the underlying cache.

Returns:
Set containing all of the session ids of sessions in the cache (with any jvmRoute removed) or null if there are no sessions in the cache.
Throws:
org.jboss.cache.CacheException

setPojo

public java.lang.Object setPojo(java.lang.String realId,
                                java.lang.String key,
                                java.lang.Object pojo)
store the pojo instance in the cache. Note that this is for the aop cache. THe pojo needs to be "aspectized".

Overrides:
setPojo in class org.jboss.web.tomcat.service.session.JBossCacheService
Parameters:
realId - the session id with any jvmRoute removed
key - the attribute key
pojo -

setSipApplicationSessionPojo

public java.lang.Object setSipApplicationSessionPojo(java.lang.String realId,
                                                     java.lang.String key,
                                                     java.lang.Object pojo)
store the pojo instance in the cache. Note that this is for the aop cache. THe pojo needs to be "aspectized".

Parameters:
realId - the session id with any jvmRoute removed
key - the attribute key
pojo -

setSipSessionPojo

public java.lang.Object setSipSessionPojo(java.lang.String id,
                                          java.lang.String realId,
                                          java.lang.String key,
                                          java.lang.Object pojo)
store the pojo instance in the cache. Note that this is for the aop cache. THe pojo needs to be "aspectized".

Parameters:
realId - the session id with any jvmRoute removed
key - the attribute key
pojo -

removePojo

public java.lang.Object removePojo(java.lang.String realId,
                                   java.lang.String key)
Remove pojo from the underlying cache store.

Overrides:
removePojo in class org.jboss.web.tomcat.service.session.JBossCacheService
Parameters:
realId - the session id with any jvmRoute removed
key - the attribute key
Returns:
pojo that just removed. Null if there none.

removeSipApplicationSessionPojo

public java.lang.Object removeSipApplicationSessionPojo(java.lang.String realId,
                                                        java.lang.String key)
Remove pojo from the underlying cache store.

Parameters:
realId - the session id with any jvmRoute removed
key - the attribute key
Returns:
pojo that just removed. Null if there none.

removeSipSessionPojo

public java.lang.Object removeSipSessionPojo(java.lang.String id,
                                             java.lang.String realId,
                                             java.lang.String key)
Remove pojo from the underlying cache store.

Parameters:
realId - the session id with any jvmRoute removed
key - the attribute key
Returns:
pojo that just removed. Null if there none.

removePojosLocal

public void removePojosLocal(java.lang.String realId)
Remove all the pojos from the underlying cache store locally without replication.

Overrides:
removePojosLocal in class org.jboss.web.tomcat.service.session.JBossCacheService
Parameters:
realId - the session id with any jvmRoute removed

removeSipSessionPojosLocal

public void removeSipSessionPojosLocal(java.lang.String id,
                                       java.lang.String realId)
Remove all the pojos from the underlying cache store locally without replication.

Parameters:
realId - the session id with any jvmRoute removed

removeSipApplicationSessionPojosLocal

public void removeSipApplicationSessionPojosLocal(java.lang.String realId)
Remove all the pojos from the underlying cache store locally without replication.

Parameters:
realId - the session id with any jvmRoute removed

removePojoLocal

public void removePojoLocal(java.lang.String realId,
                            java.lang.String key)
Remove all the pojos from the underlying cache store locally without replication.

Overrides:
removePojoLocal in class org.jboss.web.tomcat.service.session.JBossCacheService
Parameters:
realId - the session id with any jvmRoute removed

removeSipApplicationSessionPojoLocal

public void removeSipApplicationSessionPojoLocal(java.lang.String realId,
                                                 java.lang.String key)
Remove all the pojos from the underlying cache store locally without replication.

Parameters:
realId - the session id with any jvmRoute removed

removeSipSessionPojoLocal

public void removeSipSessionPojoLocal(java.lang.String id,
                                      java.lang.String realId,
                                      java.lang.String key)
Remove all the pojos from the underlying cache store locally without replication.

Parameters:
realId - the session id with any jvmRoute removed

getPojoKeys

public java.util.Set getPojoKeys(java.lang.String realId)
Overrides:
getPojoKeys in class org.jboss.web.tomcat.service.session.JBossCacheService

getSipApplicationSessionPojoKeys

public java.util.Set getSipApplicationSessionPojoKeys(java.lang.String realId)

getSipSessionPojoKeys

public java.util.Set getSipSessionPojoKeys(java.lang.String id,
                                           java.lang.String realId)

getPojo

public java.lang.Object getPojo(java.lang.String realId,
                                java.lang.String key)
Overrides:
getPojo in class org.jboss.web.tomcat.service.session.JBossCacheService
Parameters:
realId - the session id with any jvmRoute removed
key - the attribute key
Returns:
Pojo that is associated with the attribute

getSipApplicationSessionPojo

public java.lang.Object getSipApplicationSessionPojo(java.lang.String realId,
                                                     java.lang.String key)
Parameters:
realId - the session id with any jvmRoute removed
key - the attribute key
Returns:
Pojo that is associated with the attribute

getSipSessionPojo

public java.lang.Object getSipSessionPojo(java.lang.String id,
                                          java.lang.String realId,
                                          java.lang.String key)
Parameters:
realId - the session id with any jvmRoute removed
key - the attribute key
Returns:
Pojo that is associated with the attribute

addObserver

public void addObserver(org.jboss.aspects.patterns.observable.Observer session,
                        java.lang.Object pojo)
Recursively adds session as observer to the pojo graph. Assumes the whole object graph has Subject "introduction" declared. If a portion of the graph isn't a Subject, the recursion does not continue below that part of the graph.

Overrides:
addObserver in class org.jboss.web.tomcat.service.session.JBossCacheService
Parameters:
session - the session
pojo - the pojo. Can be null.

removeObserver

public void removeObserver(org.jboss.aspects.patterns.observable.Observer session,
                           java.lang.Object pojo)
Recursively removes session as observer to the pojo graph. Assumes the whole object graph has Subject "introduction" declared. If a portion of the graph isn't a Subject, the recursion does not continue below that part of the graph.

Overrides:
removeObserver in class org.jboss.web.tomcat.service.session.JBossCacheService
Parameters:
session - the session
pojo - the pojo to stop observing. Can be null.


Copyright © 2008. All Rights Reserved.