public class CometConnectionManagerValve extends ValveBase implements HttpSessionListener, LifecycleListener
Implementation of a Valve that tracks Comet connections, and closes them when the associated session expires or the webapp is reloaded.
This Valve should be attached to a Context.
| Modifier and Type | Field and Description | 
|---|---|
| protected java.util.List<Request> | cometRequestsList of current Comet connections. | 
| protected java.lang.String | cometRequestsAttributeName of session attribute used to store list of comet connections. | 
| protected static java.lang.String | infoThe descriptive information related to this implementation. | 
asyncSupported, container, containerLog, next, smmserverAFTER_DESTROY_EVENT, AFTER_INIT_EVENT, AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_DESTROY_EVENT, BEFORE_INIT_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, CONFIGURE_START_EVENT, CONFIGURE_STOP_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT| Constructor and Description | 
|---|
| CometConnectionManagerValve() | 
| Modifier and Type | Method and Description | 
|---|---|
| void | event(Request request,
Response response,
CometEvent event)Use events to update the connection state. | 
| java.lang.String | getInfo()Return descriptive information about this Valve implementation. | 
| void | invoke(Request request,
Response response)Register requests for tracking, whenever needed. | 
| void | lifecycleEvent(LifecycleEvent event)Acknowledge the occurrence of the specified event. | 
| void | sessionCreated(HttpSessionEvent se)Notification that a session was created. | 
| void | sessionDestroyed(HttpSessionEvent se)Notification that a session is about to be invalidated. | 
| protected void | startInternal()Start this component and implement the requirements
of  LifecycleBase.startInternal(). | 
| protected void | stopInternal()Stop this component and implement the requirements
of  LifecycleBase.stopInternal(). | 
backgroundProcess, getContainer, getDomainInternal, getNext, getObjectNameKeyProperties, initInternal, isAsyncSupported, setAsyncSupported, setContainer, setNext, toStringdestroyInternal, getDomain, getObjectName, postDeregister, postRegister, preDeregister, preRegister, register, setDomain, unregisteraddLifecycleListener, destroy, findLifecycleListeners, fireLifecycleEvent, getState, getStateName, init, removeLifecycleListener, setState, setState, start, stopprotected static final java.lang.String info
protected final java.util.List<Request> cometRequests
protected final java.lang.String cometRequestsAttribute
protected void startInternal()
                      throws LifecycleException
LifecycleBase.startInternal().startInternal in class ValveBaseLifecycleException - if this component detects a fatal error
that prevents this component from being usedprotected void stopInternal()
                     throws LifecycleException
LifecycleBase.stopInternal().stopInternal in class ValveBaseLifecycleException - if this component detects a fatal error
that prevents this component from being usedpublic void lifecycleEvent(LifecycleEvent event)
LifecycleListenerlifecycleEvent in interface LifecycleListenerevent - LifecycleEvent that has occurredpublic java.lang.String getInfo()
public void invoke(Request request, Response response) throws java.io.IOException, ServletException
invoke in interface Valveinvoke in class ValveBaserequest - The servlet request to be processedresponse - The servlet response to be createdjava.io.IOException - if an input/output error occursServletException - if a servlet error occurspublic void event(Request request, Response response, CometEvent event) throws java.io.IOException, ServletException
event in interface Valveevent in class ValveBaserequest - The servlet request to be processedresponse - The servlet response to be createdjava.io.IOException - if an input/output error occursServletException - if a servlet error occurspublic void sessionCreated(HttpSessionEvent se)
javax.servlet.http.HttpSessionListenersessionCreated in interface HttpSessionListenerse - the notification eventpublic void sessionDestroyed(HttpSessionEvent se)
javax.servlet.http.HttpSessionListenersessionDestroyed in interface HttpSessionListenerse - the notification eventCopyright © 2000-2015 Apache Software Foundation. All Rights Reserved.