public class InfinispanSessionManager<V,L> extends Object implements SessionManager<L>, org.infinispan.notifications.KeyFilter
Constructor and Description |
---|
InfinispanSessionManager(SessionContext context,
IdentifierFactory<String> identifierFactory,
org.infinispan.Cache<String,V> cache,
SessionFactory<V,L> factory,
Batcher batcher,
org.jboss.metadata.web.jboss.JBossWebMetaData metaData) |
Modifier and Type | Method and Description |
---|---|
boolean |
accept(Object key) |
void |
activated(org.infinispan.notifications.cachelistener.event.CacheEntryActivatedEvent<String,?> event) |
boolean |
containsSession(String id)
Indicates whether or not the session with the specified identifier is known to this session manager.
|
String |
createIdentifier() |
Session<L> |
createSession(String id)
Returns the session with the specified identifier, creating one if necessary
Sessions returned by this method must be closed via
Session.close() . |
Session<L> |
findSession(String id)
Returns the session with the specified identifier, or null if none exists.
|
Set<String> |
getActiveSessions()
Returns the identifiers of those sessions that are active on this node.
|
Batcher |
getBatcher()
Exposes the batching mechanism used by this session manager.
|
long |
getDefaultMaxInactiveInterval(TimeUnit unit)
Returns the default maximum inactive interval, using the specified unit, for all sessions created by this session manager.
|
Set<String> |
getLocalSessions()
Returns the identifiers of all sessions on this node, including both active and passive sessions.
|
void |
passivated(org.infinispan.notifications.cachelistener.event.CacheEntryPassivatedEvent<String,?> event) |
void |
removed(org.infinispan.notifications.cachelistener.event.CacheEntryRemovedEvent<String,?> event) |
void |
setDefaultMaxInactiveInterval(long value,
TimeUnit unit)
Set the default maximum inactive interval, using the specified unit, for all sessions created by this session manager.
|
void |
start() |
void |
stop() |
void |
topologyChanged(org.infinispan.notifications.cachelistener.event.TopologyChangedEvent<String,?> event) |
ImmutableSession |
viewSession(String id)
Returns a read-only view of the session with the specified identifier.
|
public InfinispanSessionManager(SessionContext context, IdentifierFactory<String> identifierFactory, org.infinispan.Cache<String,V> cache, SessionFactory<V,L> factory, Batcher batcher, org.jboss.metadata.web.jboss.JBossWebMetaData metaData)
public void start()
start
in interface IdentifierFactory<String>
public void stop()
stop
in interface IdentifierFactory<String>
public boolean accept(Object key)
accept
in interface org.infinispan.notifications.KeyFilter
public Batcher getBatcher()
SessionManager
getBatcher
in interface SessionManager<L>
public long getDefaultMaxInactiveInterval(TimeUnit unit)
SessionManager
getDefaultMaxInactiveInterval
in interface SessionManager<L>
unit
- a time unitpublic void setDefaultMaxInactiveInterval(long value, TimeUnit unit)
SessionManager
setDefaultMaxInactiveInterval
in interface SessionManager<L>
unit
- a time unitpublic String createIdentifier()
createIdentifier
in interface IdentifierFactory<String>
public boolean containsSession(String id)
SessionManager
containsSession
in interface SessionManager<L>
id
- a unique session identifierpublic Session<L> findSession(String id)
SessionManager
Session.close()
.
This method is intended to be invoked within the context of a batch.findSession
in interface SessionManager<L>
id
- a session identifierpublic Session<L> createSession(String id)
SessionManager
Session.close()
.
This method is intended to be invoked within the context of a batch.createSession
in interface SessionManager<L>
id
- a session identifierpublic ImmutableSession viewSession(String id)
SessionManager
viewSession
in interface SessionManager<L>
id
- a unique session identifierpublic Set<String> getActiveSessions()
SessionManager
getActiveSessions
in interface SessionManager<L>
public Set<String> getLocalSessions()
SessionManager
getLocalSessions
in interface SessionManager<L>
public void activated(org.infinispan.notifications.cachelistener.event.CacheEntryActivatedEvent<String,?> event)
public void passivated(org.infinispan.notifications.cachelistener.event.CacheEntryPassivatedEvent<String,?> event)
public void removed(org.infinispan.notifications.cachelistener.event.CacheEntryRemovedEvent<String,?> event)
public void topologyChanged(org.infinispan.notifications.cachelistener.event.TopologyChangedEvent<String,?> event)
Copyright © 2015 JBoss by Red Hat. All rights reserved.