Package com.tangosol.coherence.servlet
Class AbstractHttpSessionCollection.DistributedController
java.lang.Object
com.tangosol.coherence.servlet.AbstractHttpSessionCollection.DistributedController
- All Implemented Interfaces:
HttpSessionCollection.SessionDistributionController
- Enclosing class:
AbstractHttpSessionCollection
public static class AbstractHttpSessionCollection.DistributedController
extends Object
implements HttpSessionCollection.SessionDistributionController
A simple implementation of the SessionDistributionController interface
that forces all sessions (and thus their attributes) to be managed
in a distributed manner. (This is the default behavior, but by having
an implementation that forces this, the raw overhead of using a
HttpSessionController can be measured.)
- Since:
- Coherence 2.4
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidinit(HttpSessionCollection collection) Initialize the session distribution controller, so that it has the necessary context with which to make decisions regarding when to distribute sessions and their attributes.booleanisSessionAttributeDistributed(HttpSessionModel model, String sName) Determine if the specified attribute of the HttpSession associated with the passed session model should be distributed.booleanDetermine if the HttpSession associated with the passed session model should be distributed.
-
Constructor Details
-
DistributedController
public DistributedController()
-
-
Method Details
-
init
Initialize the session distribution controller, so that it has the necessary context with which to make decisions regarding when to distribute sessions and their attributes.- Specified by:
initin interfaceHttpSessionCollection.SessionDistributionController- Parameters:
collection- the HttpSessionCollection object for which the distribution controller is working
-
isSessionDistributed
Determine if the HttpSession associated with the passed session model should be distributed. This method will only be called for sessions that are not already distributed.- Specified by:
isSessionDistributedin interfaceHttpSessionCollection.SessionDistributionController- Parameters:
model- the model for the HttpSession to evaluate for distribution- Returns:
- true if the passed session model should be distributed
-
isSessionAttributeDistributed
Determine if the specified attribute of the HttpSession associated with the passed session model should be distributed. This method will only be called for sessions that are distributed, and only for attributes that are not already distributed. Further, it may only be called when an attribute is added or when its value is modified. The value itself is not passed for performance reasons; if necessary, the implementation can obtain the value from the model, but it is suggested that the implementation use the name to make the determination if possible, and only failing that obtain and evaluate the attribute value.- Specified by:
isSessionAttributeDistributedin interfaceHttpSessionCollection.SessionDistributionController- Parameters:
model- the model for the HttpSession being evaluatedsName- the name of the session attribute to evaluate for distribution- Returns:
- true if the specified attribute for the passed session model should be distributed
-