Oracle® Coherence Java API Reference
v3.5

E14977-01

com.tangosol.coherence.servlet
Class AbstractHttpSessionCollection.LocalController

java.lang.Object
  extended by com.tangosol.coherence.servlet.AbstractHttpSessionCollection.LocalController
All Implemented Interfaces:
HttpSessionCollection.SessionDistributionController
Enclosing class:
AbstractHttpSessionCollection

public static class AbstractHttpSessionCollection.LocalController
extends java.lang.Object
implements HttpSessionCollection.SessionDistributionController

A simple implementation of the SessionDistributionController interface that forces all sessions (and thus their attributes) to be managed locally. (This may be a pointless implementation for production purposes, but it can be useful for testing the difference in scalable performance between local-only and fully-distributed implementations.)

Since:
Coherence 2.4

Constructor Summary
AbstractHttpSessionCollection.LocalController()
           
 
Method Summary
 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, java.lang.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.
 

Constructor Detail

AbstractHttpSessionCollection.LocalController

public AbstractHttpSessionCollection.LocalController()
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 interface HttpSessionCollection.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 interface HttpSessionCollection.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,
                                             java.lang.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 interface HttpSessionCollection.SessionDistributionController
Parameters:
model - the model for the HttpSession being evaluated
sName - the name of the session attribute to evaluate for distribution
Returns:
true if the specified attribute for the passed session model should be distributed

Oracle® Coherence Java API Reference
v3.5

E14977-01

Copyright © 2000, 2009, Oracle. All rights reserved.