public class CoarseSessionFactory<L> extends Object implements SessionFactory<CoarseSessionEntry<L>,L>
SessionFactory
for coarse granularity sessions.
A given session is mapped to 2 co-located cache entries, one containing the session meta data and local context (updated every request)
and the other containing the map of session attributes.Locator.CreateOperation<K,V>, Locator.FindOperation<K,V>
Remover.RemoveOperation<K,V>
Evictor.EvictOperation<K,V>, Evictor.LockingEvictOperation<K,V>
Constructor and Description |
---|
CoarseSessionFactory(org.infinispan.Cache<String,CoarseSessionCacheEntry<L>> sessionCache,
org.infinispan.Cache<SessionAttributesCacheKey,MarshalledValue<Map<String,Object>,MarshallingContext>> attributesCache,
CacheInvoker invoker,
SessionContext context,
SessionAttributeMarshaller<Map<String,Object>,MarshalledValue<Map<String,Object>,MarshallingContext>> marshaller,
LocalContextFactory<L> localContextFactory) |
Modifier and Type | Method and Description |
---|---|
ImmutableSession |
createImmutableSession(String id,
CoarseSessionEntry<L> entry) |
Session<L> |
createSession(String id,
CoarseSessionEntry<L> entry) |
CoarseSessionEntry<L> |
createValue(String id)
Creates a value in the cache, if it does not already exist.
|
void |
evict(String id)
Evict the specified item from the cache.
|
CoarseSessionEntry<L> |
findValue(String id)
Locates the value in the cache with the specified identifier.
|
void |
remove(String id)
Removes the specified entry from the cache.
|
public CoarseSessionFactory(org.infinispan.Cache<String,CoarseSessionCacheEntry<L>> sessionCache, org.infinispan.Cache<SessionAttributesCacheKey,MarshalledValue<Map<String,Object>,MarshallingContext>> attributesCache, CacheInvoker invoker, SessionContext context, SessionAttributeMarshaller<Map<String,Object>,MarshalledValue<Map<String,Object>,MarshallingContext>> marshaller, LocalContextFactory<L> localContextFactory)
public Session<L> createSession(String id, CoarseSessionEntry<L> entry)
createSession
in interface SessionFactory<CoarseSessionEntry<L>,L>
public ImmutableSession createImmutableSession(String id, CoarseSessionEntry<L> entry)
createImmutableSession
in interface SessionFactory<CoarseSessionEntry<L>,L>
public CoarseSessionEntry<L> createValue(String id)
Locator
createValue
in interface Locator<String,CoarseSessionEntry<L>>
id
- the cache entry identifier.public CoarseSessionEntry<L> findValue(String id)
Locator
findValue
in interface Locator<String,CoarseSessionEntry<L>>
id
- the cache entry identifierpublic void remove(String id)
Remover
Copyright © 2013 JBoss by Red Hat. All rights reserved.