public class EventOrAsyncConnectionManagerValve extends ValveBase implements Lifecycle, 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> |
cometRequests
List of current Coment connections.
|
protected java.lang.String |
cometRequestsAttribute
Name of session attribute used to store list of comet connections.
|
protected static java.lang.String |
info
The descriptive information related to this implementation.
|
protected LifecycleSupport |
lifecycle
The lifecycle event support for this component.
|
protected StringManager |
sm
The string manager for this package.
|
protected boolean |
started
Has this component been started yet?
|
container, controller, domain, mserver, next, onameAFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, DESTROY_EVENT, INIT_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT| Constructor and Description |
|---|
EventOrAsyncConnectionManagerValve() |
| Modifier and Type | Method and Description |
|---|---|
void |
addLifecycleListener(LifecycleListener listener)
Add a lifecycle event listener to this component.
|
void |
event(Request request,
Response response,
HttpEvent event)
Use events to update the connection state.
|
LifecycleListener[] |
findLifecycleListeners()
Get the lifecycle listeners associated with this lifecycle.
|
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 |
removeLifecycleListener(LifecycleListener listener)
Remove a lifecycle event listener from this component.
|
void |
sessionCreated(HttpSessionEvent se) |
void |
sessionDestroyed(HttpSessionEvent se) |
void |
start()
Prepare for the beginning of active use of the public methods of this
component.
|
void |
stop()
Gracefully terminate the active use of the public methods of this
component.
|
backgroundProcess, createObjectName, getContainer, getContainerName, getController, getDomain, getNext, getObjectName, getParentName, postDeregister, postRegister, preDeregister, preRegister, setContainer, setController, setNext, setObjectName, toStringprotected static final java.lang.String info
protected StringManager sm
protected LifecycleSupport lifecycle
protected boolean started
protected java.util.List<Request> cometRequests
protected java.lang.String cometRequestsAttribute
public void addLifecycleListener(LifecycleListener listener)
addLifecycleListener in interface Lifecyclelistener - The listener to addpublic LifecycleListener[] findLifecycleListeners()
findLifecycleListeners in interface Lifecyclepublic void removeLifecycleListener(LifecycleListener listener)
removeLifecycleListener in interface Lifecyclelistener - The listener to addpublic void start()
throws LifecycleException
configure(),
and before any of the public methods of the component are utilized.start in interface LifecycleLifecycleException - if this component detects a fatal error
that prevents this component from being usedpublic void stop()
throws LifecycleException
stop in interface LifecycleLifecycleException - if this component detects a fatal error
that needs to be reportedpublic 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
public void event(Request request, Response response, HttpEvent event) throws java.io.IOException, ServletException
event in interface Valveevent in class ValveBaserequest - The servlet request to be processedresponse - The servlet response to be createdevent - The event to be processedjava.io.IOException - if an input/output error occursServletException - if a servlet error occurspublic void sessionCreated(HttpSessionEvent se)
public void sessionDestroyed(HttpSessionEvent se)