org.jboss.web.tomcat.service.session.distributedcache.impl.jbc
Class AttributeBasedJBossCacheService

java.lang.Object
  extended by org.jboss.web.tomcat.service.session.distributedcache.impl.jbc.AbstractJBossCacheService<org.jboss.web.tomcat.service.session.distributedcache.spi.OutgoingAttributeGranularitySessionData>
      extended by org.jboss.web.tomcat.service.session.distributedcache.impl.jbc.AttributeBasedJBossCacheService
All Implemented Interfaces:
org.jboss.web.tomcat.service.session.distributedcache.spi.DistributedCacheManager<org.jboss.web.tomcat.service.session.distributedcache.spi.OutgoingAttributeGranularitySessionData>

public class AttributeBasedJBossCacheService
extends AbstractJBossCacheService<org.jboss.web.tomcat.service.session.distributedcache.spi.OutgoingAttributeGranularitySessionData>

DistributedCacheManager impl for ReplicationGranularity.ATTRIBUTE.


Field Summary
 
Fields inherited from class org.jboss.web.tomcat.service.session.distributedcache.impl.jbc.AbstractJBossCacheService
ATTRIBUTE_KEY, batchingManager, BUDDY_BACKUP, BUDDY_BACKUP_FQN, cacheConfigName_, cacheWrapper_, combinedPath_, FQN_DELIMITER, INTERNAL_KEYS, log_, METADATA_KEY, SESSION, TIMESTAMP_KEY, VERSION_KEY
 
Constructor Summary
AttributeBasedJBossCacheService(org.jboss.web.tomcat.service.session.distributedcache.spi.LocalDistributableSessionManager localManager)
           
AttributeBasedJBossCacheService(org.jboss.web.tomcat.service.session.distributedcache.spi.LocalDistributableSessionManager localManager, org.jboss.cache.Cache<Object,Object> cache)
           
 
Method Summary
 Object getAttribute(String realId, String key)
           
 Set<String> getAttributeKeys(String realId)
          Obtain the keys associated with this fqn.
 Map<String,Object> getAttributes(String realId)
          Return all attributes associated with this session id.
protected  Map<String,Object> getSessionAttributes(String realId, Map<Object,Object> distributedCacheData)
          Returns the session attributes, possibly using the passed in distributedCacheData as a source.
 boolean getSupportsAttributeOperations()
           
 void putAttribute(String realId, Map<String,Object> map)
           
 void putAttribute(String realId, String key, Object value)
           
 Object removeAttribute(String realId, String key)
           
 void removeAttributeLocal(String realId, String key)
           
protected  void storeSessionAttributes(Map<Object,Object> dataMap, org.jboss.web.tomcat.service.session.distributedcache.spi.OutgoingAttributeGranularitySessionData sessionData)
           
 
Methods inherited from class org.jboss.web.tomcat.service.session.distributedcache.impl.jbc.AbstractJBossCacheService
evictSession, evictSession, getBatchingManager, getBuddyBackupSessionFqn, getCache, getChildrenNames, getCombinedPath, getDistributableSessionData, getManager, getMarshalledValue, getSessionData, getSessionData, getSessionFqn, getSessionIds, getUnMarshalledValue, getWebappFqn, isMarshallingAvailable, isPassivationEnabled, releaseCacheToManager, removeSession, removeSessionLocal, removeSessionLocal, removeSessionRegion, sessionCreated, setCache, setupSessionRegion, start, stop, storeSessionData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttributeBasedJBossCacheService

public AttributeBasedJBossCacheService(org.jboss.web.tomcat.service.session.distributedcache.spi.LocalDistributableSessionManager localManager)
                                throws org.jboss.web.tomcat.service.session.distributedcache.spi.ClusteringNotSupportedException
Throws:
org.jboss.web.tomcat.service.session.distributedcache.spi.ClusteringNotSupportedException

AttributeBasedJBossCacheService

public AttributeBasedJBossCacheService(org.jboss.web.tomcat.service.session.distributedcache.spi.LocalDistributableSessionManager localManager,
                                       org.jboss.cache.Cache<Object,Object> cache)
Method Detail

getSupportsAttributeOperations

public boolean getSupportsAttributeOperations()

getAttribute

public Object getAttribute(String realId,
                           String key)

putAttribute

public void putAttribute(String realId,
                         String key,
                         Object value)

putAttribute

public void putAttribute(String realId,
                         Map<String,Object> map)

removeAttribute

public Object removeAttribute(String realId,
                              String key)

removeAttributeLocal

public void removeAttributeLocal(String realId,
                                 String key)

getAttributeKeys

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


getAttributes

public Map<String,Object> getAttributes(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.

getSessionAttributes

protected Map<String,Object> getSessionAttributes(String realId,
                                                  Map<Object,Object> distributedCacheData)
Returns the session attributes, possibly using the passed in distributedCacheData as a source. Note: This operation may alter the contents of the passed in map. If this is unacceptable, pass in a defensive copy.

Specified by:
getSessionAttributes in class AbstractJBossCacheService<org.jboss.web.tomcat.service.session.distributedcache.spi.OutgoingAttributeGranularitySessionData>

storeSessionAttributes

protected void storeSessionAttributes(Map<Object,Object> dataMap,
                                      org.jboss.web.tomcat.service.session.distributedcache.spi.OutgoingAttributeGranularitySessionData sessionData)
Specified by:
storeSessionAttributes in class AbstractJBossCacheService<org.jboss.web.tomcat.service.session.distributedcache.spi.OutgoingAttributeGranularitySessionData>


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.