public class InfinispanSessionManager<MV,AV,L> extends Object implements SessionManager<L,TransactionBatch>
Constructor and Description |
---|
InfinispanSessionManager(SessionFactory<MV,AV,L> factory,
InfinispanSessionManagerConfiguration configuration) |
Modifier and Type | Method and Description |
---|---|
void |
activated(org.infinispan.notifications.cachelistener.event.CacheEntryActivatedEvent<SessionCreationMetaDataKey,?> 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() . |
void |
dataRehashed(org.infinispan.notifications.cachelistener.event.DataRehashedEvent<SessionCreationMetaDataKey,?> event) |
Session<L> |
findSession(String id)
Returns the session with the specified identifier, or null if none exists.
|
long |
getActiveSessionCount() |
Set<String> |
getActiveSessions()
Returns the identifiers of those sessions that are active on this node.
|
Batcher<TransactionBatch> |
getBatcher()
Exposes the batching mechanism used by this session manager.
|
Duration |
getDefaultMaxInactiveInterval()
Returns the default maximum inactive interval, as a duration, 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.
|
int |
getMaxActiveSessions() |
void |
passivated(org.infinispan.notifications.cachelistener.event.CacheEntryPassivatedEvent<SessionCreationMetaDataKey,?> event) |
void |
removed(org.infinispan.notifications.cachelistener.event.CacheEntryRemovedEvent<SessionCreationMetaDataKey,?> event) |
void |
setDefaultMaxInactiveInterval(Duration duration)
Set the default maximum inactive interval, using the specified time duration, for all sessions created by this session manager.
|
void |
start() |
void |
stop() |
ImmutableSession |
viewSession(String id)
Returns a read-only view of the session with the specified identifier.
|
public InfinispanSessionManager(SessionFactory<MV,AV,L> factory, InfinispanSessionManagerConfiguration configuration)
public void start()
start
in interface IdentifierFactory<String>
public void stop()
stop
in interface IdentifierFactory<String>
public Batcher<TransactionBatch> getBatcher()
SessionManager
getBatcher
in interface SessionManager<L,TransactionBatch>
public Duration getDefaultMaxInactiveInterval()
SessionManager
getDefaultMaxInactiveInterval
in interface SessionManager<L,TransactionBatch>
public void setDefaultMaxInactiveInterval(Duration duration)
SessionManager
setDefaultMaxInactiveInterval
in interface SessionManager<L,TransactionBatch>
duration
- a time durationpublic String createIdentifier()
createIdentifier
in interface IdentifierFactory<String>
public boolean containsSession(String id)
SessionManager
containsSession
in interface SessionManager<L,TransactionBatch>
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,TransactionBatch>
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,TransactionBatch>
id
- a session identifierpublic ImmutableSession viewSession(String id)
SessionManager
viewSession
in interface SessionManager<L,TransactionBatch>
id
- a unique session identifierpublic Set<String> getActiveSessions()
SessionManager
getActiveSessions
in interface SessionManager<L,TransactionBatch>
public Set<String> getLocalSessions()
SessionManager
getLocalSessions
in interface SessionManager<L,TransactionBatch>
public int getMaxActiveSessions()
getMaxActiveSessions
in interface ActiveSessionStatistics
public long getActiveSessionCount()
getActiveSessionCount
in interface ActiveSessionStatistics
public void activated(org.infinispan.notifications.cachelistener.event.CacheEntryActivatedEvent<SessionCreationMetaDataKey,?> event)
public void passivated(org.infinispan.notifications.cachelistener.event.CacheEntryPassivatedEvent<SessionCreationMetaDataKey,?> event)
public void removed(org.infinispan.notifications.cachelistener.event.CacheEntryRemovedEvent<SessionCreationMetaDataKey,?> event)
public void dataRehashed(org.infinispan.notifications.cachelistener.event.DataRehashedEvent<SessionCreationMetaDataKey,?> event)
Copyright © 2016 JBoss by Red Hat. All rights reserved.