|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectBaseHandler
DefaultHandler
DeferredSessionStorageHandler
public class DeferredSessionStorageHandler
This alternate session storage handler does not write any attribute into the session until the very end of a chain of forwarded requests (i.e., not even at the end of an inner forwarded request). This allows it to handle multiple concurrent forwarded requests, each of which is modifying the same data, in a more reasonable way. Basically, each request works in its own snapshot of the session, and the last one to commit is the one whose snapshot wins. This is a better alternative thatn allowing them to interfere with each other in the middle of the request chain.
Constructor Summary | |
---|---|
DeferredSessionStorageHandler(ServletContext servletContext)
|
Method Summary | |
---|---|
boolean |
allowBindingEvent(Object event)
Tell whether a given binding event should be allowed to occur. |
void |
applyChanges(RequestContext context)
Apply any deferred changes, at the end of a chain of requests. |
void |
ensureFailover(RequestContext context,
String attributeName,
Object value)
Ensure that the given named attribute is replicated in a cluster for session failover, if appropriate. |
Object |
getAttribute(RequestContext context,
String attributeName)
Get a named attribute. |
void |
removeAttribute(RequestContext context,
String attrName)
Remove a named attribute. |
void |
setAttribute(RequestContext context,
String attrName,
Object value)
Set a named attribute. |
Methods inherited from class DefaultHandler |
---|
getRegisteredHandler, setRegisteredHandler |
Methods inherited from class BaseHandler |
---|
getConfig, getPreviousHandler, getServletContext, init, reinit |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface Handler |
---|
init, reinit |
Constructor Detail |
---|
public DeferredSessionStorageHandler(ServletContext servletContext)
Method Detail |
---|
public void setAttribute(RequestContext context, String attrName, Object value)
StorageHandler
setAttribute
in interface StorageHandler
context
- the current RequestContext.attrName
- the name of the attribute to set.value
- the attribute value.public void removeAttribute(RequestContext context, String attrName)
StorageHandler
removeAttribute
in interface StorageHandler
context
- the current RequestContext.attrName
- the name of the attribute to remove.public Object getAttribute(RequestContext context, String attributeName)
StorageHandler
getAttribute
in interface StorageHandler
context
- the current RequestContext.attributeName
- the name of the attribute to get.
null
if there is no such named attribute.public void applyChanges(RequestContext context)
StorageHandler
applyChanges
in interface StorageHandler
context
- the current request context.public void ensureFailover(RequestContext context, String attributeName, Object value)
StorageHandler
ensureFailover
in interface StorageHandler
context
- the current request context.attributeName
- the name of the attribute for which failover should be ensured.value
- the value of the attribute for which failover should be ensured.public boolean allowBindingEvent(Object event)
StorageHandler
HttpSession
) at some time other than
when StorageHandler.setAttribute(org.apache.beehive.netui.pageflow.RequestContext, java.lang.String, java.lang.Object)
is called, in which case a binding event would be misleading. Only
PageFlowManagedObject
s pay attention to this.
allowBindingEvent
in interface StorageHandler
event
- the binding event, e.g., javax.servlet.http.HttpSessionBindingEvent
true
if the event should be processed.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |