public final class SessionReplicationContext extends Object
Modifier and Type | Method and Description |
---|---|
static void |
bindSession(ClusteredSession<? extends OutgoingDistributableSessionData> session,
SnapshotManager manager) |
static void |
enterWebapp(org.apache.catalina.connector.Request request,
org.apache.catalina.connector.Response response,
boolean startCacheActivity)
Associate a SessionReplicationContext with the current thread, if there isn't one already.
|
static SessionReplicationContext |
exitWebapp()
Signals that the webapp is finished handling the request (and therefore replication can begin.)
|
Map<ClusteredSession<? extends OutgoingDistributableSessionData>,SnapshotManager> |
getCrossContextSessions()
Gets a Map
|
static org.apache.catalina.connector.Request |
getOriginalRequest() |
static org.apache.catalina.connector.Response |
getOriginalResponse() |
ClusteredSession<? extends OutgoingDistributableSessionData> |
getSoleSession()
Gets the ClusteredSession that was passed to
bindSession(ClusteredSession, SnapshotManager) if and only if only
one SnapshotManager was passed. |
SnapshotManager |
getSoleSnapshotManager()
Gets the SnapshotManager that was passed to
bindSession(ClusteredSession, SnapshotManager) if and only if only
one such SnapshotManager was passed. |
static boolean |
isLocallyActive()
Returns whether there is a SessionReplicationContext associated with the current thread.
|
static void |
sessionExpired(ClusteredSession<? extends OutgoingDistributableSessionData> session,
String realId,
SnapshotManager manager) |
public static void enterWebapp(org.apache.catalina.connector.Request request, org.apache.catalina.connector.Response response, boolean startCacheActivity)
exitWebapp()
are supported; once a context is established
the number of calls to this method and exitWebapp()
are tracked.request
- response
- public static SessionReplicationContext exitWebapp()
null
.public static void bindSession(ClusteredSession<? extends OutgoingDistributableSessionData> session, SnapshotManager manager)
public static void sessionExpired(ClusteredSession<? extends OutgoingDistributableSessionData> session, String realId, SnapshotManager manager)
public static boolean isLocallyActive()
true
if there is a context associated with the threadpublic static org.apache.catalina.connector.Request getOriginalRequest()
public static org.apache.catalina.connector.Response getOriginalResponse()
public Map<ClusteredSession<? extends OutgoingDistributableSessionData>,SnapshotManager> getCrossContextSessions()
bindSession(ClusteredSession, SnapshotManager)
was called with more than one SnapshotManager (i.e
the request crossed session contexts.)public SnapshotManager getSoleSnapshotManager()
bindSession(ClusteredSession, SnapshotManager)
if and only if only
one such SnapshotManager was passed. Returns null
otherwise, in which case a cross-context request is a
possibility, and getCrossContextSessions()
should be checked.public ClusteredSession<? extends OutgoingDistributableSessionData> getSoleSession()
bindSession(ClusteredSession, SnapshotManager)
if and only if only
one SnapshotManager was passed. Returns null
otherwise, in which case a cross-context request is a
possibility, and getCrossContextSessions()
should be checked.Copyright © 2013 JBoss, a division of Red Hat, Inc.. All Rights Reserved.