Package com.tangosol.coherence.servlet
Class AbstractHttpSessionCollection.HybridController
- java.lang.Object
-
- com.tangosol.coherence.servlet.AbstractHttpSessionCollection.HybridController
-
- All Implemented Interfaces:
HttpSessionCollection.SessionDistributionController
- Enclosing class:
- AbstractHttpSessionCollection
public static class AbstractHttpSessionCollection.HybridController extends Object implements HttpSessionCollection.SessionDistributionController
A simple implementation of the SessionDistributionController interface that forces all sessions and serializable attributes to be managed in a distributed manner. All session attributes that do not implement the Serializable interface will be kept local.- Since:
- Coherence 3.2.2
-
-
Constructor Summary
Constructors Constructor Description HybridController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addLocalClass(Class c)
Add a class which should never be distributed in the coherence cache.void
init(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.boolean
isSessionAttributeDistributed(HttpSessionModel model, String sName)
Determine if the specified attribute of the HttpSession associated with the passed session model should be distributed.boolean
isSessionDistributed(HttpSessionModel model)
Determine if the HttpSession associated with the passed session model should be distributed.
-
-
-
Method Detail
-
init
public void init(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.- Specified by:
init
in interfaceHttpSessionCollection.SessionDistributionController
- Parameters:
collection
- the HttpSessionCollection object for which the distribution controller is working
-
isSessionDistributed
public boolean isSessionDistributed(HttpSessionModel model)
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:
isSessionDistributed
in interfaceHttpSessionCollection.SessionDistributionController
- Parameters:
model
- the model for the HttpSession to evaluate for distribution- Returns:
- true if the passed session model should be distributed
-
isSessionAttributeDistributed
public boolean isSessionAttributeDistributed(HttpSessionModel model, String sName)
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:
isSessionAttributeDistributed
in 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
-
addLocalClass
public void addLocalClass(Class c)
Add a class which should never be distributed in the coherence cache.- Parameters:
c
- the class which is not be distrubted
-
-