org.jboss.web.tomcat.service.session
Class ConvergedSessionReplicationContext

java.lang.Object
  extended by org.jboss.web.tomcat.service.session.ConvergedSessionReplicationContext

public final class ConvergedSessionReplicationContext
extends java.lang.Object


Method Summary
static void bindSession(org.jboss.web.tomcat.service.session.ClusteredSession session, org.jboss.web.tomcat.service.session.SnapshotManager manager)
           
static void bindSipApplicationSession(ClusteredSipApplicationSession session, org.jboss.web.tomcat.service.session.SnapshotManager manager)
           
static void bindSipSession(ClusteredSipSession session, org.jboss.web.tomcat.service.session.SnapshotManager manager)
           
static void enterSipapp(SipServletRequestImpl request, SipServletResponseImpl response, boolean startCacheActivity)
          Associate a SessionReplicationContext with the current thread, if there isn't one already.
static void enterSipappAndBindSessions(SipServletRequestImpl request, SipServletResponseImpl response, SipManager manager, boolean startCacheActivity)
          Associate a SessionReplicationContext with the current thread, if there isn't one already.
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 ConvergedSessionReplicationContext exitSipapp()
          Signals that the webapp is finished handling the request (and therefore replication can begin.)
static ConvergedSessionReplicationContext exitWebapp()
          Signals that the webapp is finished handling the request (and therefore replication can begin.)
static void finishCacheActivity()
          Marks the completion of activity on a given session.
static void finishSipCacheActivity()
          Marks the completion of activity on a given session.
 java.util.Map getCrossContextSessions()
          Gets a Map of sessions that were accessed during the course of a request.
static org.apache.catalina.connector.Request getOriginalRequest()
           
static org.apache.catalina.connector.Response getOriginalResponse()
           
 org.jboss.web.tomcat.service.session.ClusteredSession getSoleSession()
          Gets the ClusteredSession that was passed to bindSession(ClusteredSession, SnapshotManager) if and only if only one SnapshotManager was passed.
 ClusteredSipApplicationSession getSoleSipApplicationSession()
          Gets the ClusteredSession that was passed to bindSession(ClusteredSession, SnapshotManager) if and only if only one SnapshotManager was passed.
 ClusteredSipSession getSoleSipSession()
          Gets the ClusteredSession that was passed to bindSession(ClusteredSession, SnapshotManager) if and only if only one SnapshotManager was passed.
 org.jboss.web.tomcat.service.session.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()
           
static boolean isSessionBoundAndExpired(java.lang.String realId, org.jboss.web.tomcat.service.session.SnapshotManager manager)
           
static boolean isSipApplicationSessionBoundAndExpired(java.lang.String key, org.jboss.web.tomcat.service.session.SnapshotManager manager)
           
static boolean isSipLocallyActive()
           
static boolean isSipSessionBoundAndExpired(java.lang.String key, org.jboss.web.tomcat.service.session.SnapshotManager manager)
           
static void sessionExpired(org.jboss.web.tomcat.service.session.ClusteredSession session, java.lang.String realId, org.jboss.web.tomcat.service.session.SnapshotManager manager)
           
static void sipApplicationSessionExpired(ClusteredSipApplicationSession session, java.lang.String realId, org.jboss.web.tomcat.service.session.SnapshotManager manager)
           
static void sipSessionExpired(ClusteredSipSession session, java.lang.String realId, org.jboss.web.tomcat.service.session.SnapshotManager manager)
           
static void startCacheActivity()
          Marks the current thread as actively processing the given session.
static void startSipCacheActivity()
          Marks the current thread as actively processing the given session.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

enterWebapp

public 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. If there isn't one, associate the given request and response with the context.

NOTE: Nested calls to this method and exitWebapp() are supported; once a context is established the number of calls to this method and exitWebapp() are tracked.

Parameters:
request -
response -

exitWebapp

public static ConvergedSessionReplicationContext exitWebapp()
Signals that the webapp is finished handling the request (and therefore replication can begin.)

Returns:
a SessionReplicationContext, from which information about any sessions needing replication can be obtained. Will not return null.

enterSipapp

public static void enterSipapp(SipServletRequestImpl request,
                               SipServletResponseImpl response,
                               boolean startCacheActivity)
Associate a SessionReplicationContext with the current thread, if there isn't one already. If there isn't one, associate the given request and response with the context.

NOTE: Nested calls to this method and exitWebapp() are supported; once a context is established the number of calls to this method and exitWebapp() are tracked.

Parameters:
request -
response -

enterSipappAndBindSessions

public static void enterSipappAndBindSessions(SipServletRequestImpl request,
                                              SipServletResponseImpl response,
                                              SipManager manager,
                                              boolean startCacheActivity)
Associate a SessionReplicationContext with the current thread, if there isn't one already. If there isn't one, associate the given request and response with the context.

NOTE: Nested calls to this method and exitWebapp() are supported; once a context is established the number of calls to this method and exitWebapp() are tracked.

Parameters:
request -
response -

exitSipapp

public static ConvergedSessionReplicationContext exitSipapp()
Signals that the webapp is finished handling the request (and therefore replication can begin.)

Returns:
a SessionReplicationContext, from which information about any sessions needing replication can be obtained. Will not return null.

bindSession

public static void bindSession(org.jboss.web.tomcat.service.session.ClusteredSession session,
                               org.jboss.web.tomcat.service.session.SnapshotManager manager)

bindSipSession

public static void bindSipSession(ClusteredSipSession session,
                                  org.jboss.web.tomcat.service.session.SnapshotManager manager)

bindSipApplicationSession

public static void bindSipApplicationSession(ClusteredSipApplicationSession session,
                                             org.jboss.web.tomcat.service.session.SnapshotManager manager)

sessionExpired

public static void sessionExpired(org.jboss.web.tomcat.service.session.ClusteredSession session,
                                  java.lang.String realId,
                                  org.jboss.web.tomcat.service.session.SnapshotManager manager)

sipSessionExpired

public static void sipSessionExpired(ClusteredSipSession session,
                                     java.lang.String realId,
                                     org.jboss.web.tomcat.service.session.SnapshotManager manager)

sipApplicationSessionExpired

public static void sipApplicationSessionExpired(ClusteredSipApplicationSession session,
                                                java.lang.String realId,
                                                org.jboss.web.tomcat.service.session.SnapshotManager manager)

isSessionBoundAndExpired

public static boolean isSessionBoundAndExpired(java.lang.String realId,
                                               org.jboss.web.tomcat.service.session.SnapshotManager manager)

isSipSessionBoundAndExpired

public static boolean isSipSessionBoundAndExpired(java.lang.String key,
                                                  org.jboss.web.tomcat.service.session.SnapshotManager manager)

isSipApplicationSessionBoundAndExpired

public static boolean isSipApplicationSessionBoundAndExpired(java.lang.String key,
                                                             org.jboss.web.tomcat.service.session.SnapshotManager manager)

startCacheActivity

public static void startCacheActivity()
Marks the current thread as actively processing the given session. If the thread has already been so marked, increases a counter so a subsequent call to finishLocalActivity does not remove the association (allowing nested calls).


finishCacheActivity

public static void finishCacheActivity()
Marks the completion of activity on a given session. Should be called once for each invocation of startCacheActivity().


startSipCacheActivity

public static void startSipCacheActivity()
Marks the current thread as actively processing the given session. If the thread has already been so marked, increases a counter so a subsequent call to finishLocalActivity does not remove the association (allowing nested calls).


finishSipCacheActivity

public static void finishSipCacheActivity()
Marks the completion of activity on a given session. Should be called once for each invocation of startCacheActivity().


isLocallyActive

public static boolean isLocallyActive()

isSipLocallyActive

public static boolean isSipLocallyActive()

getOriginalRequest

public static org.apache.catalina.connector.Request getOriginalRequest()

getOriginalResponse

public static org.apache.catalina.connector.Response getOriginalResponse()

getCrossContextSessions

public java.util.Map getCrossContextSessions()
Gets a Map of sessions that were accessed during the course of a request. Will only be non-null if bindSession(ClusteredSession, SnapshotManager) was called with more than one SnapshotManager (i.e the request crossed session contexts.)


getSoleSnapshotManager

public org.jboss.web.tomcat.service.session.SnapshotManager getSoleSnapshotManager()
Gets the SnapshotManager that was passed to 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.


getSoleSession

public org.jboss.web.tomcat.service.session.ClusteredSession getSoleSession()
Gets the ClusteredSession that was passed to 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.


getSoleSipSession

public ClusteredSipSession getSoleSipSession()
Gets the ClusteredSession that was passed to 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.


getSoleSipApplicationSession

public ClusteredSipApplicationSession getSoleSipApplicationSession()
Gets the ClusteredSession that was passed to 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 © 2009. All Rights Reserved.