Constructor and Description |
---|
SessionImpl(CodecRegistry codecRegistry,
EmbeddedCacheManager cacheManager,
String id,
TimeService timeService) |
Modifier and Type | Method and Description |
---|---|
void |
createCache(String cacheName,
String baseCacheName)
Creates a new cache
|
<K,V> Cache<K,V> |
getCache(String cacheName)
Returns a named cache.
|
EmbeddedCacheManager |
getCacheManager()
Obtains the CacheManager to which this session is attached
|
Codec |
getCodec()
Returns the currently active codec used to encode/decode keys/values
|
Codec |
getCodec(String codec)
Returns a specific codec
|
Collection<Codec> |
getCodecs()
Returns the list of available key/value codecs
|
<K,V> Cache<K,V> |
getCurrentCache()
Obtains the currently selected cache.
|
String |
getCurrentCacheName()
Returns the name of the currently selected cache.
|
String |
getId()
Returns the unique id of this session
|
long |
getTimestamp()
Returns the time the session was last accessed
|
void |
reset()
Resets the session, by aborting any dangling batches and transactions and updating the timestamp
|
void |
setCodec(String codec)
Sets the codec to use for encoding/decoding keys/values
|
void |
setCurrentCache(String cacheName)
Sets the current cache.
|
public static final Log log
public SessionImpl(CodecRegistry codecRegistry, EmbeddedCacheManager cacheManager, String id, TimeService timeService)
public EmbeddedCacheManager getCacheManager()
Session
getCacheManager
in interface Session
public String getId()
Session
public <K,V> Cache<K,V> getCurrentCache()
Session
getCurrentCache
in interface Session
public String getCurrentCacheName()
Session
getCurrentCacheName
in interface Session
public <K,V> Cache<K,V> getCache(String cacheName)
Session
public void setCurrentCache(String cacheName)
Session
setCurrentCache
in interface Session
public void createCache(String cacheName, String baseCacheName)
Session
createCache
in interface Session
cacheName
- the name of the new cachebaseCacheName
- the existing named cache to use for defaultspublic void reset()
Session
public long getTimestamp()
Session
getTimestamp
in interface Session
public void setCodec(String codec) throws CodecException
Session
setCodec
in interface Session
codec
- the name of the codec to useCodecException
public Collection<Codec> getCodecs()
Session
public Codec getCodec()
Session
public Codec getCodec(String codec) throws CodecException
Session
getCodec
in interface Session
CodecException
Copyright © 2014 JBoss, a division of Red Hat. All Rights Reserved.