Skip navigation links

Oracle® Coherence Java API Reference
Release 3.6.0.0

E15725-01


com.tangosol.coherence.servlet
Class AbstractHttpSessionCollection

java.lang.Object
  extended by com.tangosol.util.Base
      extended by com.tangosol.coherence.servlet.AbstractHttpSessionCollection

All Implemented Interfaces:
HttpSessionCollection, XmlConfigurable
Direct Known Subclasses:
MonolithicHttpSessionCollection, TraditionalHttpSessionCollection

Deprecated. In releases following 3.6 customization will be declarative.

public abstract class AbstractHttpSessionCollection
extends Base
implements HttpSessionCollection, XmlConfigurable

An abstract base class from which implementations of HttpSessionCollection can be more easily built.

Version:
Coherence 2.3
Author:
cp 2003.10.14

Nested Class Summary
static class AbstractHttpSessionCollection.ApplicationScopeController
          Deprecated. In releases following 3.6 customization will be declarative.
static class AbstractHttpSessionCollection.DistributedController
          Deprecated. In releases following 3.6 customization will be declarative.
static class AbstractHttpSessionCollection.ExitAgent
          Deprecated. In releases following 3.6 customization will be declarative.
static class AbstractHttpSessionCollection.ExitObserver
          Deprecated. In releases following 3.6 customization will be declarative.
static class AbstractHttpSessionCollection.ExitTask
          Deprecated. In releases following 3.6 customization will be declarative.
static class AbstractHttpSessionCollection.GlobalScopeController
          Deprecated. In releases following 3.6 customization will be declarative.
static class AbstractHttpSessionCollection.HybridController
          Deprecated. In releases following 3.6 customization will be declarative.
static class AbstractHttpSessionCollection.LocalController
          Deprecated. In releases following 3.6 customization will be declarative.

 

Nested classes/interfaces inherited from interface com.tangosol.coherence.servlet.HttpSessionCollection
HttpSessionCollection.AttributeScopeController, HttpSessionCollection.SessionDistributionController

 

Field Summary
static String CACHENAME_DEATHCERTS
          Deprecated. The name of the clustered cache that stores the IDs of "recently departed" sessions.
static String CACHENAME_LOCAL_ATTRIBUTES
          Deprecated. The name of the local cache that stores the session attributes that are not distributed (if there is a distribution controller or attributes are allowed to become local when serialization fails).
static String CACHENAME_LOCAL_SESSIONS
          Deprecated. The name of the local cache that stores the sessions that are not yet distributed (if there is a distribution controller).
static String CACHENAME_SESSIONS
          Deprecated. The name of the clustered cache that stores the sessions.
static String CTX_INIT_ALLOW_LOCAL_ATTRIBUTES
          Deprecated. The configuration property that specifies whether non-serializable attributes should be preserved as local.
static String CTX_INIT_CACHENAME_DEATHCERTS
          Deprecated. The configuration property that overrides the name of the clustered cache that stores the IDs of "recently departed" sessions.
static String CTX_INIT_CACHENAME_LOCAL_ATTRIBUTES
          Deprecated. The configuration property that overrides the name of the local cache that stores non-distributed session attributes when the SessionDistributionController option is implemented.
static String CTX_INIT_CACHENAME_LOCAL_SESSIONS
          Deprecated. The configuration property that overrides the name of the local cache that stores non-distributed sessions when the SessionDistributionController option is implemented.
static String CTX_INIT_CACHENAME_SESSIONS
          Deprecated. The configuration property that overrides the name of the clustered cache that stores the sessions.
static String CTX_INIT_DAEMON_ASSUME_LOCALITY
          Deprecated. True to assume that the sessions in the cache are split across only the servers that are doing reaping.
static String CTX_INIT_DIST_CONTROLLER_CLASS
          Deprecated. The configuration property that specifies an implementation of the SessionDistributionController interface to use.
static String CTX_INIT_ENABLE_SUSPECT_ATTRIBUTES
          Deprecated. The configuration property that specifies whether suspect attributes are treated specially.
static String CTX_INIT_SCOPE_CONTROLLER_CLASS
          Deprecated. The configuration property that specifies an implementation of the AttributeScopeController interface to use.
static String CTX_INIT_SERVICENAME_OWNERSHIP
          Deprecated. The configuration property that specifies the name of the invocation service that will be used to manage sticky session ownership.
static String CTX_INIT_SESSION_APP_LOCK
          Deprecated. The configuration property that specifies application level session locking.
static String CTX_INIT_SESSION_EXPIRE_SECS
          Deprecated. The configuration property that overrides the session expirty time.
static String CTX_INIT_SESSION_EXPIRY_FILTER_FACTORY
          Deprecated. Configuration property for specifying a custom session expiry filter factory.
static String CTX_INIT_SESSION_ID_GENERATOR_CLASS
          Deprecated. The configuration property that specifies the session id generator class.
static String CTX_INIT_SESSION_ID_LENGTH
          Deprecated. The configuration property that overrides the session id length.
static String CTX_INIT_SESSION_LOCK
          Deprecated. The configuration property that specifies that session locking is enabled.
static String CTX_INIT_SESSION_MEMBER_LOCK
          Deprecated. The configuration property that specifies member level session locking.
static String CTX_INIT_SESSION_STICKY
          Deprecated. The configuration property that specifies whether sticky sessions optimizations will be used.
static String CTX_INIT_SESSION_STRICT_SPEC
          Deprecated. The configuration property that specifies strict spec adherence.
static String CTX_INIT_SESSION_THREAD_LOCK
          Deprecated. The configuration property that specifies thread level session locking.
static String SERVICENAME_OWNERSHIP
          Deprecated. The name of the clustered invocation service that manages sticky session ownership.

 

Constructor Summary
AbstractHttpSessionCollection()
          Deprecated. Default constructor (required).

 

Method Summary
 void activate(String sId, javax.servlet.http.HttpSession session)
          Deprecated. Move the session into an active state, if it is not already.
 void addHttpSessionAttributeListener(javax.servlet.http.HttpSessionAttributeListener listener)
          Deprecated. Sign up the specified listener to receive HttpSessionBindingEvent objects.
 void addHttpSessionListener(javax.servlet.http.HttpSessionListener listener)
          Deprecated. Sign up the specified listener to receive HttpSessionEvent objects.
 HttpSessionModel create(javax.servlet.http.HttpSession session)
          Deprecated. This method creates a new session, returning the session model for the new session.
 HttpSessionModel create(javax.servlet.http.HttpSession session, String sId)
          Deprecated. This method attempts to create a new session with a specific ID, returning the session model for the new session.
protected  AbstractHttpSessionModel create(javax.servlet.http.HttpSession session, String sId, boolean fCheckDeathCert)
          Deprecated. This method attempts to create a new session with a specific ID, returning the session model for the new session.
 void destroy(String sId)
          Deprecated. Destroy the specified session.
protected  void destroyLocalAttributesCache(String sId)
          Deprecated. Destroy the cache of local-only session attributes for the specified session ID.
protected  Map ensureLocalAttributesCache(String sId)
          Deprecated. Get the cache of local-only session attributes for the specified session ID.
 boolean enter(String sId, boolean fWait)
          Deprecated. Obtain any necessary ownership for the specified session.
 void exit(String sId, boolean fFlush)
          Deprecated. Release ownership for the specified session.
protected  String generateSessionId()
          Deprecated. Generate a potential session ID.
 HttpSessionModel get(String sId)
          Deprecated. Obtain the HttpSessionModel for the specified session, or null if it does not exist.
protected  NamedCache getActiveCache()
          Deprecated. Get the cache of active sessions.
protected  NamedCache getAppControlCache()
          Deprecated. Get the cache used to control concurrent access to a session by multiple applications, if application locking is used.
 int getAverageModelLifetime()
          Deprecated. Calculate the average lifetime (in seconds) of session model objects invalidated (either due to expiration or to an explicit invalidation) since the last time statistics were reset.
 int getAverageModelSize()
          Deprecated. Calculate the average size (in bytes) of session model objects placed in the session storage clustered cache since the last time statistics were reset.
 NamedCache getClusterCache()
          Deprecated. Get the cache of existent distributed session models.
protected static AbstractHttpSessionCollection getCollection()
          Deprecated. Obtain the AbstractHttpSessionCollection that is being used in the current application.
 XmlElement getConfig()
          Deprecated. Determine the current configuration of the object.
protected  long getCurrentTime()
          Deprecated. Determine the current time value in milliseconds.
 NamedCache getDeathCertCache()
          Deprecated. Get the cache of previously used session IDs (IDs of previously existent HttpSessionModel objects).
 int getDefaultMaxInactiveInterval()
          Deprecated. Determine the default maximum interval, in seconds, that a session will be kept alive without any activity.
protected  String getDescription()
          Deprecated. Returns a string representation of this object's attributes.
protected  HttpSessionCollection.SessionDistributionController getDistributionController()
          Deprecated. Get the SessionDistributionController for the session collection, if one was specified.
protected  Listeners getHttpSessionAttributeListeners()
          Deprecated. Determine the list of listeners that are registered for session attribute modification events.
protected  Listeners getHttpSessionListeners()
          Deprecated. Determine the list of listeners that are registered for session life cycle events.
 NamedCache getLocalAttributesCache()
          Deprecated. Get the cache of local-only session attributes.
 NamedCache getLocalCache()
          Deprecated. Get the cache of existent local-only session models.
 int getMaxModelSize()
          Deprecated. Return the maximum size (in bytes) of a session model object placed in the session storage clustered cache since the last time statistics were reset.
 int getMinModelSize()
          Deprecated. Return the minimum size (in bytes) of a session model object placed in the session storage clustered cache since the last time statistics were reset.
protected  AbstractHttpSessionModel getModel(String sId)
          Deprecated. Obtain the specified session model.
 int getModelDeaths()
          Deprecated. Return the number of session model objects invalidated (either due to expiration or to an explicit invalidation) since the last time statistics were reset.
 int getModelUpdates()
          Deprecated. Return the number of updates to session model objects since the last time statistics were reset.
protected  NamedCache getOwnedCache()
          Deprecated. Get the cache of owned ("locally live") session models.
protected  AbstractHttpSessionModel getOwnedModel(String sId)
          Deprecated. Obtain the specified session model that this thread owns, otherwise throw an exception.
protected  HttpSessionCollection.AttributeScopeController getScopeController()
          Deprecated. Get the AttributeScopeController for the session collection, if one was specified.
 HttpSessionIdGenerator getSessionIdGenerator()
          Deprecated. Retrieve the HttpSessionIdGenerator used by this session collection to generate session identifiers.
 int getSessionIdLength()
          Deprecated. Determine the length that session IDs will be created with.
protected  Member getSessionOwnershipInfo(String sId)
          Deprecated. Determine which cluster member (if any) holds the lock for the given session ID.
 NamedCache getStickyCache()
          Deprecated. Get the cache of information about sessions that are stuck to this member, if sticky ownership is used.
 NamedCache getStickyExitTaskCache()
          Deprecated. Get the cache of session ExitTasks for sessions that are stuck to this member, if sticky ownership is used.
protected  InvocationService getStickyService()
          Deprecated. Get the invocation service to use to manage sticky session ownership.
protected abstract  AbstractHttpSessionModel instantiateModel(javax.servlet.http.HttpSession session, String sId)
          Deprecated. Factory Method: Instantiate a AbstractHttpSessionModel or subclass thereof.
 boolean isActive(String sId)
          Deprecated. Determine if the specified session ID identifies a session that is in the active state.
protected  boolean isAllowLocalAttributes()
          Deprecated. Determine if non-serializable attributes should be preserved as local.
protected  boolean isAppLockingEnforced()
          Deprecated. Determine whether or not two or more applications should be prevented from accessing the same session simultaneously.
protected  boolean isAssumeLocality()
          Deprecated. Determine if it can be assumed that each existent session is managed on a server that is doing reaping, and thus each server can reap only the sessions that are managed on it.
protected  boolean isEnableAttributeListenerOptimization()
          Deprecated. Determines if attribute listeners should be executed if the same instance of a session attribute is being replaced in the session.
protected  boolean isEnableSuspectAttributes()
          Deprecated. Determine if suspect attributes need special treatment.
 boolean isExistent(String sId)
          Deprecated. Determine if the specified session ID identifies a session that exists.
protected  boolean isMemberLockingEnforced()
          Deprecated. Determine whether or not two or more JVMs should be prevented from accessing the same session simultaneously.
 boolean isOwned(String sId)
          Deprecated. Determine if the specified session ID identifies a session that exists and that this thread has ownership for, either by a call to enter(sId) or create() without a corresponding call to exit(sId). NOTE, since an asynchronous exit task could have been scheduled by SessionHelper.requestAsyncOwnership(String), this method should not be used to determine if exit should be called or not.
 boolean isOwnershipSticky()
          Deprecated. Determine if the sticky session ownership option is on.
protected  boolean isSessionLockingEnforced()
          Deprecated. Determine whether concurrent access to a session is permitted.
 boolean isStrict()
          Deprecated. Determine if the Servlet specification is being followed strictly.
protected  boolean isStuck(String sId)
          Deprecated. Determine if the specified session is stuck.
protected  boolean isThreadLockingEnforced()
          Deprecated. Determine whether a session should be single threaded (only one request per session accessing the session at a time) or multithreaded (any number of requests accessing the session at a time).
 Iterator iterateIds()
          Deprecated. Obtain an iterator of the session IDs.
 Iterator iteratePotentiallyExpiredIds()
          Deprecated. Obtain an iterator of the session IDs that this JVM is responsible for invalidating when the sessions for those IDs have timed out.
protected  boolean obtainAppOwnership(String sId, boolean fWait)
          Deprecated. Obtain application ownership for the specified session.
protected  boolean obtainClusterOwnership(String sId, boolean fWait)
          Deprecated. Obtain ownership within the cluster for the specified session.
protected  boolean obtainThreadOwnership(String sId)
          Deprecated. Obtain thread ownership of the specified session, if necessary.
protected  void onModelUpdate(int cb)
          Deprecated. Notify the session collection that a model of the specified size (in bytes) was updated in the session storage clustered cache.
 void passivate(String sId)
          Deprecated. Move the session into a passive state, if it is not already.
 void postCreate(javax.servlet.http.HttpSession session)
          Deprecated. This method is called at the end of the session creation process.
protected static void putBlind(Map map, Object oKey, Object oValue)
          Deprecated. Puts the specified key/value pair into the specified map using the putAll() method, which does not return the previous value and thus may be more efficient in a distributed environment.
protected  void releaseAppOwnership(String sId)
          Deprecated. Release application ownership of the specified session.
 void releaseCache(NamedCache cache)
          Deprecated. Release the passed NamedCache instance.
protected  void releaseClusterOwnership(String sId)
          Deprecated. Release ownership within the cluster of the specified session.
protected  boolean releaseStuckSession(String sId, boolean fWait)
          Deprecated. Determine if the specified session is stuck, and if it is, to release it (or mark it to be released).
protected  void releaseThreadOwnership(String sId)
          Deprecated. Release thread ownership of the specified session.
protected static void removeBlind(Map map, Object oKey)
          Deprecated. Removes the specified key/value pair from the specified map using the keySet().remove() method, which does not return the previous value and thus may be more efficient in a distributed environment.
 void removeHttpSessionAttributeListener(javax.servlet.http.HttpSessionAttributeListener listener)
          Deprecated. Sign off the specified listener so it no longer will receive HttpSessionBindingEvent objects.
 void removeHttpSessionListener(javax.servlet.http.HttpSessionListener listener)
          Deprecated. Sign off the specified listener so it no longer will receive HttpSessionEvent objects.
 void resetStatistics()
          Deprecated. Reset all statistics maintained by this session collection.
 void setConfig(XmlElement xml)
          Deprecated. Specify the configuration for the object.
 void shutdown()
          Deprecated. Notify the session collection that it is being shut down.
 String toString()
          Deprecated. Returns a string representation of the object.

 

Field Detail

CTX_INIT_CACHENAME_SESSIONS

public static final String CTX_INIT_CACHENAME_SESSIONS
Deprecated. 
The configuration property that overrides the name of the clustered cache that stores the sessions.
See Also:
Constant Field Values

CTX_INIT_CACHENAME_LOCAL_SESSIONS

public static final String CTX_INIT_CACHENAME_LOCAL_SESSIONS
Deprecated. 
The configuration property that overrides the name of the local cache that stores non-distributed sessions when the SessionDistributionController option is implemented.
See Also:
Constant Field Values

CTX_INIT_CACHENAME_LOCAL_ATTRIBUTES

public static final String CTX_INIT_CACHENAME_LOCAL_ATTRIBUTES
Deprecated. 
The configuration property that overrides the name of the local cache that stores non-distributed session attributes when the SessionDistributionController option is implemented.
See Also:
Constant Field Values

CTX_INIT_CACHENAME_DEATHCERTS

public static final String CTX_INIT_CACHENAME_DEATHCERTS
Deprecated. 
The configuration property that overrides the name of the clustered cache that stores the IDs of "recently departed" sessions.
See Also:
Constant Field Values

CTX_INIT_SESSION_EXPIRE_SECS

public static final String CTX_INIT_SESSION_EXPIRE_SECS
Deprecated. 
The configuration property that overrides the session expirty time.
See Also:
Constant Field Values

CTX_INIT_SESSION_ID_LENGTH

public static final String CTX_INIT_SESSION_ID_LENGTH
Deprecated. 
The configuration property that overrides the session id length.
See Also:
Constant Field Values

CTX_INIT_SESSION_ID_GENERATOR_CLASS

public static final String CTX_INIT_SESSION_ID_GENERATOR_CLASS
Deprecated. 
The configuration property that specifies the session id generator class.
See Also:
Constant Field Values

CTX_INIT_SESSION_LOCK

public static final String CTX_INIT_SESSION_LOCK
Deprecated. 
The configuration property that specifies that session locking is enabled.
See Also:
Constant Field Values

CTX_INIT_SESSION_MEMBER_LOCK

public static final String CTX_INIT_SESSION_MEMBER_LOCK
Deprecated. 
The configuration property that specifies member level session locking.
See Also:
Constant Field Values

CTX_INIT_SESSION_APP_LOCK

public static final String CTX_INIT_SESSION_APP_LOCK
Deprecated. 
The configuration property that specifies application level session locking.
See Also:
Constant Field Values

CTX_INIT_SESSION_THREAD_LOCK

public static final String CTX_INIT_SESSION_THREAD_LOCK
Deprecated. 
The configuration property that specifies thread level session locking.
See Also:
Constant Field Values

CTX_INIT_DAEMON_ASSUME_LOCALITY

public static final String CTX_INIT_DAEMON_ASSUME_LOCALITY
Deprecated. 
True to assume that the sessions in the cache are split across only the servers that are doing reaping.
See Also:
Constant Field Values

CTX_INIT_SESSION_STRICT_SPEC

public static final String CTX_INIT_SESSION_STRICT_SPEC
Deprecated. 
The configuration property that specifies strict spec adherence.
See Also:
Constant Field Values

CTX_INIT_DIST_CONTROLLER_CLASS

public static final String CTX_INIT_DIST_CONTROLLER_CLASS
Deprecated. 
The configuration property that specifies an implementation of the SessionDistributionController interface to use.
See Also:
Constant Field Values

CTX_INIT_SCOPE_CONTROLLER_CLASS

public static final String CTX_INIT_SCOPE_CONTROLLER_CLASS
Deprecated. 
The configuration property that specifies an implementation of the AttributeScopeController interface to use.
See Also:
Constant Field Values

CTX_INIT_SESSION_STICKY

public static final String CTX_INIT_SESSION_STICKY
Deprecated. 
The configuration property that specifies whether sticky sessions optimizations will be used.
See Also:
Constant Field Values

CTX_INIT_SERVICENAME_OWNERSHIP

public static final String CTX_INIT_SERVICENAME_OWNERSHIP
Deprecated. 
The configuration property that specifies the name of the invocation service that will be used to manage sticky session ownership.
See Also:
Constant Field Values

CTX_INIT_ALLOW_LOCAL_ATTRIBUTES

public static final String CTX_INIT_ALLOW_LOCAL_ATTRIBUTES
Deprecated. 
The configuration property that specifies whether non-serializable attributes should be preserved as local.
See Also:
Constant Field Values

CTX_INIT_ENABLE_SUSPECT_ATTRIBUTES

public static final String CTX_INIT_ENABLE_SUSPECT_ATTRIBUTES
Deprecated. 
The configuration property that specifies whether suspect attributes are treated specially.
See Also:
SessionHelper.CTX_INIT_ENABLE_SUSPECT_ATTRIBUTES, Constant Field Values

CTX_INIT_SESSION_EXPIRY_FILTER_FACTORY

public static final String CTX_INIT_SESSION_EXPIRY_FILTER_FACTORY
Deprecated. 
Configuration property for specifying a custom session expiry filter factory.
See Also:
SessionHelper.CTX_INIT_SESSION_EXPIRY_FILTER_FACTORY, HttpSessionCollectionConfiguration#getSessionExpiryFilterFactoryClassName(), Constant Field Values

CACHENAME_SESSIONS

public static final String CACHENAME_SESSIONS
Deprecated. 
The name of the clustered cache that stores the sessions.
See Also:
Constant Field Values

CACHENAME_LOCAL_SESSIONS

public static final String CACHENAME_LOCAL_SESSIONS
Deprecated. 
The name of the local cache that stores the sessions that are not yet distributed (if there is a distribution controller).
See Also:
Constant Field Values

CACHENAME_LOCAL_ATTRIBUTES

public static final String CACHENAME_LOCAL_ATTRIBUTES
Deprecated. 
The name of the local cache that stores the session attributes that are not distributed (if there is a distribution controller or attributes are allowed to become local when serialization fails).
See Also:
Constant Field Values

CACHENAME_DEATHCERTS

public static final String CACHENAME_DEATHCERTS
Deprecated. 
The name of the clustered cache that stores the IDs of "recently departed" sessions.
See Also:
Constant Field Values

SERVICENAME_OWNERSHIP

public static final String SERVICENAME_OWNERSHIP
Deprecated. 
The name of the clustered invocation service that manages sticky session ownership.
See Also:
Constant Field Values

Constructor Detail

AbstractHttpSessionCollection

public AbstractHttpSessionCollection()
Deprecated. 
Default constructor (required).

Method Detail

getCollection

protected static AbstractHttpSessionCollection getCollection()
Deprecated. 
Obtain the AbstractHttpSessionCollection that is being used in the current application. Because this class must be included as part of the application deployment, the singleton pattern should be applicable.
Returns:
the singleton instance of the AbstractHttpSessionCollection

getConfig

public XmlElement getConfig()
Deprecated. 
Determine the current configuration of the object.
Specified by:
getConfig in interface XmlConfigurable
Returns:
the XML configuration or null

setConfig

public void setConfig(XmlElement xml)
Deprecated. 
Specify the configuration for the object.
Specified by:
setConfig in interface XmlConfigurable
Parameters:
xml - the XML configuration for the object

create

public HttpSessionModel create(javax.servlet.http.HttpSession session)
Deprecated. 
This method creates a new session, returning the session model for the new session.

The session is created with the default timeout, and has an ID that is unique within the domain that the session management layer is configured for (e.g. within the JVM, or within the cluster.)

When the session model is returned, the session state is exists, owned, active. Note that the responsibilities associated with the enter() method are included as part of the session creation process.

The model will retain the reference to the HttpSession object until it is passivated or destroyed.

Specified by:
create in interface HttpSessionCollection
Parameters:
session - the HttpSession object to bind the session model to; used for issuing events; must not be null
Returns:
the HttpSessionModel object for the new session

create

public HttpSessionModel create(javax.servlet.http.HttpSession session,
                               String sId)
Deprecated. 
This method attempts to create a new session with a specific ID, returning the session model for the new session. If a session with the specified ID already exists, this method will return null.

The session is created with the default timeout.

When the session model is returned, the session state is exists, owned, active. Note that the responsibilities associated with the enter() method are included as part of the session creation process.

The model will retain the reference to the HttpSession object until it is passivated or destroyed.

Specified by:
create in interface HttpSessionCollection
Parameters:
session - the HttpSession object to bind the session model to; used for issuing events; must not be null
sId - the session ID
Returns:
the HttpSessionModel object for the new session, or null if a session with the passed in sessionID already exists.

postCreate

public void postCreate(javax.servlet.http.HttpSession session)
Deprecated. 
This method is called at the end of the session creation process.

When this method is called, the session state is exists, owned, active.

Specified by:
postCreate in interface HttpSessionCollection
Parameters:
session - the HttpSession object; must not be null

isExistent

public boolean isExistent(String sId)
Deprecated. 
Determine if the specified session ID identifies a session that exists.

The notion of ownership will affect whether or not the answer can be trusted once the method has returned it. If the ownership state is owned (the current thread called enter(sId)), then the caller should assume that session still exists. Otherwise, the caller can only assume that the session did exist at the point in time that the call to this method was made.

Specified by:
isExistent in interface HttpSessionCollection
Parameters:
sId - the session ID to check for existence
Returns:
true if the session exists; false otherwise

destroy

public void destroy(String sId)
Deprecated. 
Destroy the specified session.

This method may only be called on a session that is exists, owned, active.

Session attributes will receive HttpSessionBindingListener as per the Servlet specification.

At the return point from this method, the session state is does not exist. Note that the responsibilities associated with the exit(sId) method are included as part of the session destruction process.

After this method completes, the model's HttpSession reference will be null.

Specified by:
destroy in interface HttpSessionCollection
Parameters:
sId - the session ID; must not be null

enter

public boolean enter(String sId,
                     boolean fWait)
Deprecated. 
Obtain any necessary ownership for the specified session. Ownership requirements are expected to be declarative, so this method may be a no-op, or it may involve thread-level, application-level, or even cluster-wide locking.

If the session specified by the session ID does not exist, then this method has no effect; no exception is thrown.

This method must support Multiple Possession Semantics, meaning that this method may be invoked multiple times, and each invocation will require a corresponding call to the exit(sId) method in order to release the ownership.

Specified by:
enter in interface HttpSessionCollection
Parameters:
sId - the session ID; must not be null
fWait - true if the thread should block until the session becomes available; false otherwise
Returns:
true if the session is now owned by the calling thread

isOwned

public boolean isOwned(String sId)
Deprecated. 
Determine if the specified session ID identifies a session that exists and that this thread has ownership for, either by a call to enter(sId) or create() without a corresponding call to exit(sId). NOTE! Since an asynchronous exit task could have been scheduled by SessionHelper.requestAsyncOwnership(String), this method should not be used to determine if exit should be called or not.

NOTE, since an asynchronous exit task could have been scheduled by SessionHelper.requestAsyncOwnership(String), this method should not be used to determine if exit should be called or not.

Specified by:
isOwned in interface HttpSessionCollection
Parameters:
sId - the session ID; must not be null
Returns:
true if the session is owned; false otherwise.

exit

public void exit(String sId,
                 boolean fFlush)
Deprecated. 
Release ownership for the specified session. This method must be called exactly once for each call to enter(sId), with the only exceptions being:

When ownership state of a new session changes from owned to not owned, the session will no longer be considered new.

If the session specified by the session ID does not exist, then this method has no effect; no exception is thrown.

Specified by:
exit in interface HttpSessionCollection
Parameters:
sId - the session ID; must not be null
fFlush - pass true if the session has been potentially modified; even then, there's no guarantee that the session state will be flushed if there is another thread that is using the session concurrently. In this case, the last exiting thread will flush

activate

public void activate(String sId,
                     javax.servlet.http.HttpSession session)
Deprecated. 
Move the session into an active state, if it is not already. The active state is defined as the state in which the session is considered to be "live" in a particular JVM. This primarily relates to the optional event interfce (HttpSessionActivationListener) that session attributes can implement to find out when the session is passivated and activated.

Invoking this method will issue activation events for session attributes that implement the HttpSessionActivationListener interface. The model will retain the reference to the HttpSession object until it is passivated or destroyed.

Specified by:
activate in interface HttpSessionCollection
Parameters:
sId - the session ID; must not be null
session - the HttpSession object to bind the session model to; used for issuing events; must not be null

isActive

public boolean isActive(String sId)
Deprecated. 
Determine if the specified session ID identifies a session that is in the active state.

This method may only be called within the bounds of a call to enter(sId) and exit(sId).

Specified by:
isActive in interface HttpSessionCollection
Parameters:
sId - the session ID to check for the active state
Returns:
true if the session exists and is active; false otherwise

passivate

public void passivate(String sId)
Deprecated. 
Move the session into a passive state, if it is not already.

Invoking this method will issue passivation events for session attributes that implement the HttpSessionActivationListener interface.

After this method completes, the model's HttpSession reference will be null.

Specified by:
passivate in interface HttpSessionCollection
Parameters:
sId - the session ID; must not be null

iterateIds

public Iterator iterateIds()
Deprecated. 
Obtain an iterator of the session IDs.

The list of IDs is completely dynamic because of the nature of multi-threaded and distributed systems. The fact that an ID is returned from an iterator is no guarantee that the ID is still valid.

Specified by:
iterateIds in interface HttpSessionCollection
Returns:
an iterator that iterates over all String session IDs

iteratePotentiallyExpiredIds

public Iterator iteratePotentiallyExpiredIds()
Deprecated. 
Obtain an iterator of the session IDs that this JVM is responsible for invalidating when the sessions for those IDs have timed out.

This may return an iterator with the same contents as the one returned by the HttpSessionCollection.iterateIds() method, or it may return an iterator that iterates over a subset of those contents.

The list of IDs is completely dynamic because of the nature of multi-threaded and distributed systems. The fact that an ID is returned from an iterator is no guarantee that the ID is still valid, or that it has expired.

Specified by:
iteratePotentiallyExpiredIds in interface HttpSessionCollection
Returns:
an iterator that iterates over the session IDs that this JVM is responsible for periodically checking for expiry

get

public HttpSessionModel get(String sId)
Deprecated. 
Obtain the HttpSessionModel for the specified session, or null if it does not exist.

This method may only be called within the bounds of a call to enter(sId) and exit(sId).

Specified by:
get in interface HttpSessionCollection
Parameters:
sId - the session ID; must not be null
Returns:
the HttpSessionModel for the requested session or null

addHttpSessionListener

public void addHttpSessionListener(javax.servlet.http.HttpSessionListener listener)
Deprecated. 
Sign up the specified listener to receive HttpSessionEvent objects.
Specified by:
addHttpSessionListener in interface HttpSessionCollection
Parameters:
listener - the HttpSessionListener to sign up for events

removeHttpSessionListener

public void removeHttpSessionListener(javax.servlet.http.HttpSessionListener listener)
Deprecated. 
Sign off the specified listener so it no longer will receive HttpSessionEvent objects.
Specified by:
removeHttpSessionListener in interface HttpSessionCollection
Parameters:
listener - the HttpSessionListener that was previously signed up for events

addHttpSessionAttributeListener

public void addHttpSessionAttributeListener(javax.servlet.http.HttpSessionAttributeListener listener)
Deprecated. 
Sign up the specified listener to receive HttpSessionBindingEvent objects.
Specified by:
addHttpSessionAttributeListener in interface HttpSessionCollection
Parameters:
listener - the HttpSessionAttributeListener to sign up for events

removeHttpSessionAttributeListener

public void removeHttpSessionAttributeListener(javax.servlet.http.HttpSessionAttributeListener listener)
Deprecated. 
Sign off the specified listener so it no longer will receive HttpSessionBindingEvent objects.
Specified by:
removeHttpSessionAttributeListener in interface HttpSessionCollection
Parameters:
listener - the HttpSessionAttributeListener that was previously signed up for events

shutdown

public void shutdown()
Deprecated. 
Notify the session collection that it is being shut down. After this method invocation has been made, the session collection may throw IllegalStateException for any subsequent method invocation made to it.
Specified by:
shutdown in interface HttpSessionCollection

toString

public String toString()
Deprecated. 
Returns a string representation of the object.
Returns:
a string representation of the object

getHttpSessionListeners

protected Listeners getHttpSessionListeners()
Deprecated. 
Determine the list of listeners that are registered for session life cycle events.
Returns:
the non-null Listeners object containing zero or more HttpSessionListeners

getHttpSessionAttributeListeners

protected Listeners getHttpSessionAttributeListeners()
Deprecated. 
Determine the list of listeners that are registered for session attribute modification events.
Returns:
the non-null Listeners object containing zero or more HttpSessionAttributeListeners

isStrict

public boolean isStrict()
Deprecated. 
Determine if the Servlet specification is being followed strictly.
Returns:
true if the Servlet specification is being followed strictly

getDefaultMaxInactiveInterval

public int getDefaultMaxInactiveInterval()
Deprecated. 
Determine the default maximum interval, in seconds, that a session will be kept alive without any activity.
Returns:
the default number of seconds to keep an inactive session

isSessionLockingEnforced

protected boolean isSessionLockingEnforced()
Deprecated. 
Determine whether concurrent access to a session is permitted. If isMemberLockingEnforced() or isAppLockingEnforced() or isMemberLockingEnforced() return true, then so will this method.

If this is set to false, then concurrent access is permitted and the last update wins.

Returns:
true if concurrent access to a session is limited.

isMemberLockingEnforced

protected boolean isMemberLockingEnforced()
Deprecated. 
Determine whether or not two or more JVMs should be prevented from accessing the same session simultaneously.
Returns:
true to limit the access to a session to one JVM at a time

isAppLockingEnforced

protected boolean isAppLockingEnforced()
Deprecated. 
Determine whether or not two or more applications should be prevented from accessing the same session simultaneously.

Note that application-level locking requires that member-level session locking is enabled. In other words, if this method returns true, the value of isMemberLockingEnforced() will also be true.

Returns:
true to limit the access to a session to one application at a time

isThreadLockingEnforced

protected boolean isThreadLockingEnforced()
Deprecated. 
Determine whether a session should be single threaded (only one request per session accessing the session at a time) or multithreaded (any number of requests accessing the session at a time).

Note that a single threaded session requires that both member-level and application-level session locking are enabled. In other words, if this method returns true, the value of isMemberLockingEnforced() and isAppLockingEnforced() will also be true.

Returns:
true to limit the access to a session to one thread at a time

getCurrentTime

protected long getCurrentTime()
Deprecated. 
Determine the current time value in milliseconds.
Returns:
the current time value in milliseconds

create

protected AbstractHttpSessionModel create(javax.servlet.http.HttpSession session,
                                          String sId,
                                          boolean fCheckDeathCert)
Deprecated. 
This method attempts to create a new session with a specific ID, returning the session model for the new session. If a session with the specified ID already exists in the collection, this method will return null.

The session is created with the default timeout.

When the session model is returned, the session state is exists, owned, active. Note that the responsibilities associated with the enter() method are included as part of the session creation process.

The model will retain the reference to the HttpSession object until it is passivated or destroyed.

Parameters:
session - the HttpSession object to bind the session model to; used for issuing events; must not be null
sId - the session id
fCheckDeathCert - true, if the death cert cache should be checked to verify that the session id has not been used recently
Returns:
the HttpSessionModel object for the new session

getDescription

protected String getDescription()
Deprecated. 
Returns a string representation of this object's attributes.
Returns:
a string representation of this object's attributes

getStickyCache

public NamedCache getStickyCache()
Deprecated. 
Get the cache of information about sessions that are stuck to this member, if sticky ownership is used.
Returns:
a cache mapping from session id to sticky status (either Boolean.TRUE to indicate stuck or Boolean.FALSE to indicate that it is stuck but that it has been marked for release)

getStickyExitTaskCache

public NamedCache getStickyExitTaskCache()
Deprecated. 
Get the cache of session ExitTasks for sessions that are stuck to this member, if sticky ownership is used.
Returns:
a cache mapping from session id to ExitTask that can be used to exit (thus unstick) the corresponding session

getStickyService

protected InvocationService getStickyService()
Deprecated. 
Get the invocation service to use to manage sticky session ownership.
Returns:
the invocation service to use to manage sticky session ownership

getAppControlCache

protected NamedCache getAppControlCache()
Deprecated. 
Get the cache used to control concurrent access to a session by multiple applications, if application locking is used.
Returns:
a cache mapping from session id to application ownership information (an object array of size two, with the first element being the owning HttpSessionCollection and the second element being an Integer reference count)

getActiveCache

protected NamedCache getActiveCache()
Deprecated. 
Get the cache of active sessions.
Returns:
a cache of active sessions; the cache maps from session ID to HttpSession objects

getOwnedCache

protected NamedCache getOwnedCache()
Deprecated. 
Get the cache of owned ("locally live") session models. The concept of "locally live" is internal to this collection implementation, and is not part of the collection/model design itself. A model is considered "locally live" if it is existent and has been entered, until the point that it is fully exited or destroyed.
Returns:
a cache of owned session models; the cache maps from session ID to HttpSessionModel objects

getClusterCache

public NamedCache getClusterCache()
Deprecated. 
Get the cache of existent distributed session models.
Returns:
a cache that maps from session ID to HttpSessionModel objects

getDistributionController

protected HttpSessionCollection.SessionDistributionController getDistributionController()
Deprecated. 
Get the SessionDistributionController for the session collection, if one was specified.
Returns:
the controller object, or null if none was specified

getScopeController

protected HttpSessionCollection.AttributeScopeController getScopeController()
Deprecated. 
Get the AttributeScopeController for the session collection, if one was specified.
Returns:
the controller object, or null if none was specified

getLocalCache

public NamedCache getLocalCache()
Deprecated. 
Get the cache of existent local-only session models.
Returns:
a cache that maps from session ID to HttpSessionModel objects

getLocalAttributesCache

public NamedCache getLocalAttributesCache()
Deprecated. 
Get the cache of local-only session attributes.
Returns:
a cache that maps from session ID and attribute name to AttributeHolder objects

ensureLocalAttributesCache

protected Map ensureLocalAttributesCache(String sId)
Deprecated. 
Get the cache of local-only session attributes for the specified session ID.
Parameters:
sId - the session ID
Returns:
a cache that maps attribute name to AttributeHolder objects

destroyLocalAttributesCache

protected void destroyLocalAttributesCache(String sId)
Deprecated. 
Destroy the cache of local-only session attributes for the specified session ID.
Parameters:
sId - the session ID

getDeathCertCache

public NamedCache getDeathCertCache()
Deprecated. 
Get the cache of previously used session IDs (IDs of previously existent HttpSessionModel objects).
Returns:
a cache that maps from session ID to a Long object containing the date/time that the session was destroyed

isOwnershipSticky

public boolean isOwnershipSticky()
Deprecated. 
Determine if the sticky session ownership option is on.

This is available only if an Enterprise Edition or Grid Edition license is available.

Returns:
true iff the sticky session ownership option is on

isStuck

protected boolean isStuck(String sId)
Deprecated. 
Determine if the specified session is stuck.
Parameters:
sId - the session id
Returns:
true iff the specified session is stuck

getSessionOwnershipInfo

protected Member getSessionOwnershipInfo(String sId)
Deprecated. 
Determine which cluster member (if any) holds the lock for the given session ID.
Parameters:
sId - the session ID
Returns:
the member that holds the lock for the given session ID

obtainClusterOwnership

protected boolean obtainClusterOwnership(String sId,
                                         boolean fWait)
Deprecated. 
Obtain ownership within the cluster for the specified session.

This method assumes that the owned cache is locked for the passed session id.

Parameters:
sId - the id of the session to obtain ownership for
fWait - true to wait for the session to become available, false to give up immediately if ownership of the session is currently unavailable
Returns:
true on successfully obtaining ownership, false otherwise

releaseClusterOwnership

protected void releaseClusterOwnership(String sId)
Deprecated. 
Release ownership within the cluster of the specified session.

This method assumes that the owned cache is locked for the passed session ID.

Parameters:
sId - the ID of the session to release ownership of

releaseStuckSession

protected boolean releaseStuckSession(String sId,
                                      boolean fWait)
Deprecated. 
Determine if the specified session is stuck, and if it is, to release it (or mark it to be released). This method is only designed to be called from an invocation agent.
Parameters:
sId - the session id to unstick if it's stuck here
fWait - true to wait for the session to be release or be marked to be released, false to give up immediately if ownership of the session is currently unavailable
Returns:
true if the session is/was stuck here and is now released or is marked to be released

obtainAppOwnership

protected boolean obtainAppOwnership(String sId,
                                     boolean fWait)
Deprecated. 
Obtain application ownership for the specified session.

This method assumes that the owned cache is locked for the passed session ID.

Parameters:
sId - the ID of the session to obtain ownership for
fWait - true to wait for the session to become available, false to give up immediately if ownership of the session is currently unavailable
Returns:
true on successfully obtaining ownership, false otherwise

releaseAppOwnership

protected void releaseAppOwnership(String sId)
Deprecated. 
Release application ownership of the specified session.

This method assumes that the owned cache is locked and cluster ownership has been obtained for the passed session ID.

Parameters:
sId - the ID of the session to release ownership of

obtainThreadOwnership

protected boolean obtainThreadOwnership(String sId)
Deprecated. 
Obtain thread ownership of the specified session, if necessary.

If thread locking is enforced this method has no effect and false is returned; otherwise, the given ID is locked in the local owned cache and true is returned. A return value of true implies that releaseThreadOwnership(sId) must be called when exclusive access to the session is no longer required.

This method may only be called within the bounds of a call to enter(sId) and exit(sId).

Parameters:
sId - the ID of the session to obtain ownership for
Returns:
true if the given ID was locked in the local owned cache; false otherwise

releaseThreadOwnership

protected void releaseThreadOwnership(String sId)
Deprecated. 
Release thread ownership of the specified session.

This method may only be called within the bounds of a call to enter(sId) and exit(sId).

Parameters:
sId - the ID of the session to release ownership of

isAllowLocalAttributes

protected boolean isAllowLocalAttributes()
Deprecated. 
Determine if non-serializable attributes should be preserved as local.

This feature is available only if the sticky session ownership option is on and is enforced if a distribution controller is specified.

Returns:
true iff non-serializable attributes should be preserved

isEnableSuspectAttributes

protected boolean isEnableSuspectAttributes()
Deprecated. 
Determine if suspect attributes need special treatment.
Returns:
true iff suspect attributes need special treatment

isEnableAttributeListenerOptimization

protected boolean isEnableAttributeListenerOptimization()
Deprecated. 
Determines if attribute listeners should be executed if the same instance of a session attribute is being replaced in the session.
Returns:
true if the optimization should be used

isAssumeLocality

protected boolean isAssumeLocality()
Deprecated. 
Determine if it can be assumed that each existent session is managed on a server that is doing reaping, and thus each server can reap only the sessions that are managed on it.
Returns:
return true if and only if each existent session is managed on a server that is doing reaping

getSessionIdLength

public int getSessionIdLength()
Deprecated. 
Determine the length that session IDs will be created with.
Returns:
the length, in characters, for session IDs

getSessionIdGenerator

public HttpSessionIdGenerator getSessionIdGenerator()
Deprecated. 
Retrieve the HttpSessionIdGenerator used by this session collection to generate session identifiers.
Returns:
the HttpSessionIdGenerator

generateSessionId

protected String generateSessionId()
Deprecated. 
Generate a potential session ID. The returned id may be in use already.
Returns:
a seemingly random session id

instantiateModel

protected abstract AbstractHttpSessionModel instantiateModel(javax.servlet.http.HttpSession session,
                                                             String sId)
Deprecated. 
Factory Method: Instantiate a AbstractHttpSessionModel or subclass thereof.
Parameters:
session - the session that delegates to this model
sId - the session ID
Returns:
a new instance of AbstractHttpSessionModel or subclass thereof

getOwnedModel

protected AbstractHttpSessionModel getOwnedModel(String sId)
Deprecated. 
Obtain the specified session model that this thread owns, otherwise throw an exception.
Parameters:
sId - the session ID
Returns:
the specified model if it exists and this thread owns it
Throws:
IllegalStateException - if the model does not exist, or it is not owned by this thread

getModel

protected AbstractHttpSessionModel getModel(String sId)
Deprecated. 
Obtain the specified session model.
Parameters:
sId - the session ID
Returns:
the specified model if it exists, null otherwise

putBlind

protected static void putBlind(Map map,
                               Object oKey,
                               Object oValue)
Deprecated. 
Puts the specified key/value pair into the specified map using the putAll() method, which does not return the previous value and thus may be more efficient in a distributed environment.
Parameters:
map - the map to store the key/value pair into
oKey - the key to store
oValue - the value to store

removeBlind

protected static void removeBlind(Map map,
                                  Object oKey)
Deprecated. 
Removes the specified key/value pair from the specified map using the keySet().remove() method, which does not return the previous value and thus may be more efficient in a distributed environment.
Parameters:
map - the map to remove the key/value pair from
oKey - the key to remove

releaseCache

public void releaseCache(NamedCache cache)
Deprecated. 
Release the passed NamedCache instance.
Parameters:
cache - a NamedCache instance to release (may be null)

getAverageModelLifetime

public int getAverageModelLifetime()
Deprecated. 
Calculate the average lifetime (in seconds) of session model objects invalidated (either due to expiration or to an explicit invalidation) since the last time statistics were reset.
Returns:
the average model lifetime (in seconds)

getAverageModelSize

public int getAverageModelSize()
Deprecated. 
Calculate the average size (in bytes) of session model objects placed in the session storage clustered cache since the last time statistics were reset.
Returns:
the average model size (in bytes)

getMaxModelSize

public int getMaxModelSize()
Deprecated. 
Return the maximum size (in bytes) of a session model object placed in the session storage clustered cache since the last time statistics were reset.
Returns:
the maximum model size (in bytes)

getMinModelSize

public int getMinModelSize()
Deprecated. 
Return the minimum size (in bytes) of a session model object placed in the session storage clustered cache since the last time statistics were reset.
Returns:
the minimum model size (in bytes)

getModelDeaths

public int getModelDeaths()
Deprecated. 
Return the number of session model objects invalidated (either due to expiration or to an explicit invalidation) since the last time statistics were reset.
Returns:
the number of invalidated session models

getModelUpdates

public int getModelUpdates()
Deprecated. 
Return the number of updates to session model objects since the last time statistics were reset.
Returns:
the number of updates to the session storage cache

resetStatistics

public void resetStatistics()
Deprecated. 
Reset all statistics maintained by this session collection.

onModelUpdate

protected void onModelUpdate(int cb)
Deprecated. 
Notify the session collection that a model of the specified size (in bytes) was updated in the session storage clustered cache.
Parameters:
cb - the size (in bytes) of the session model

Skip navigation links

Oracle® Coherence Java API Reference
Release 3.6.0.0

E15725-01


Copyright © 2000, 2010, Oracle and/or its affiliates. All rights reserved.