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

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

public class FieldBasedJBossCacheService
extends AbstractJBossCacheService<org.jboss.web.tomcat.service.session.distributedcache.spi.OutgoingDistributableSessionData>

DistributedCacheManager impl for ReplicationGranularity.FIELD.

Author:
Brian Stansberry *

Field Summary
static String ATTRIBUTE
           
 
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
FieldBasedJBossCacheService(org.jboss.web.tomcat.service.session.distributedcache.spi.LocalDistributableSessionManager localManager)
           
FieldBasedJBossCacheService(org.jboss.web.tomcat.service.session.distributedcache.spi.LocalDistributableSessionManager localManager, org.jboss.cache.pojo.PojoCache cache)
          Create a new FieldBasedJBossCacheService.
 
Method Summary
 Object getAttribute(String realId, String key)
           
static org.jboss.cache.Fqn<String> getAttributeFqn(String contextHostPath, String sessionId)
           
 Set<String> getAttributeKeys(String realId)
           
 Map<String,Object> getAttributes(String realId)
           
static org.jboss.cache.Fqn<String> getFieldFqn(String contextHostPath, String sessionId, String attributeKey)
           
protected  Map<String,Object> getSessionAttributes(String realId, Map<Object,Object> distributedCacheData)
          Overrides the superclass to pull in attributes via PojoCache API.
 boolean getSupportsAttributeOperations()
           
 void putAttribute(String realId, Map<String,Object> map)
           
 void putAttribute(String realId, String key, Object value)
           
protected  void releaseCacheToManager(String cacheConfigName)
           
 Object removeAttribute(String realId, String key)
          Remove pojo from the underlying cache store.
 void removeAttributeLocal(String realId, String key)
           
protected  void removeSessionRegion(String realId, org.jboss.cache.Fqn<String> fqn)
          Extension point to allow subclasses to remove per-session JBC regions.
 void sessionCreated(String realId)
           
protected  void setupSessionRegion(org.jboss.cache.Fqn<String> fqn)
          Extension point to allow subclasses to add per-session JBC regions.
protected  void storeSessionAttributes(Map<Object,Object> dataMap, org.jboss.web.tomcat.service.session.distributedcache.spi.OutgoingDistributableSessionData 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, removeSession, removeSessionLocal, removeSessionLocal, setCache, start, stop, storeSessionData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATTRIBUTE

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

FieldBasedJBossCacheService

public FieldBasedJBossCacheService(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

FieldBasedJBossCacheService

public FieldBasedJBossCacheService(org.jboss.web.tomcat.service.session.distributedcache.spi.LocalDistributableSessionManager localManager,
                                   org.jboss.cache.pojo.PojoCache cache)
Create a new FieldBasedJBossCacheService.

Parameters:
cache -
Method Detail

getAttributeFqn

public static org.jboss.cache.Fqn<String> getAttributeFqn(String contextHostPath,
                                                          String sessionId)

getFieldFqn

public static org.jboss.cache.Fqn<String> getFieldFqn(String contextHostPath,
                                                      String sessionId,
                                                      String attributeKey)

getSupportsAttributeOperations

public boolean getSupportsAttributeOperations()

putAttribute

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

removeAttribute

public Object removeAttribute(String realId,
                              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.

removeAttributeLocal

public void removeAttributeLocal(String realId,
                                 String key)

getAttributeKeys

public Set<String> getAttributeKeys(String realId)

getAttribute

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

sessionCreated

public void sessionCreated(String realId)
Specified by:
sessionCreated in interface org.jboss.web.tomcat.service.session.distributedcache.spi.DistributedCacheManager<org.jboss.web.tomcat.service.session.distributedcache.spi.OutgoingDistributableSessionData>
Overrides:
sessionCreated in class AbstractJBossCacheService<org.jboss.web.tomcat.service.session.distributedcache.spi.OutgoingDistributableSessionData>

setupSessionRegion

protected void setupSessionRegion(org.jboss.cache.Fqn<String> fqn)
Description copied from class: AbstractJBossCacheService
Extension point to allow subclasses to add per-session JBC regions.

Overrides:
setupSessionRegion in class AbstractJBossCacheService<org.jboss.web.tomcat.service.session.distributedcache.spi.OutgoingDistributableSessionData>
Parameters:
fqn - the fqn for the session

removeSessionRegion

protected void removeSessionRegion(String realId,
                                   org.jboss.cache.Fqn<String> fqn)
Description copied from class: AbstractJBossCacheService
Extension point to allow subclasses to remove per-session JBC regions.

Overrides:
removeSessionRegion in class AbstractJBossCacheService<org.jboss.web.tomcat.service.session.distributedcache.spi.OutgoingDistributableSessionData>
fqn - the fqn for the session

releaseCacheToManager

protected void releaseCacheToManager(String cacheConfigName)
Overrides:
releaseCacheToManager in class AbstractJBossCacheService<org.jboss.web.tomcat.service.session.distributedcache.spi.OutgoingDistributableSessionData>

getAttributes

public Map<String,Object> getAttributes(String realId)

putAttribute

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

getSessionAttributes

protected Map<String,Object> getSessionAttributes(String realId,
                                                  Map<Object,Object> distributedCacheData)
Overrides the superclass to pull in attributes via PojoCache API.

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

storeSessionAttributes

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


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