public class EventOrAsyncConnectionManagerValve extends ValveBase implements Lifecycle, javax.servlet.http.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 List<Request> |
cometRequests
List of current Coment connections.
|
protected String |
cometRequestsAttribute
Name of session attribute used to store list of comet connections.
|
protected static String |
info
The descriptive information related to this implementation.
|
protected LifecycleSupport |
lifecycle
The lifecycle event support for this component.
|
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.
|
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(javax.servlet.http.HttpSessionEvent se) |
void |
sessionDestroyed(javax.servlet.http.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 String info
protected LifecycleSupport lifecycle
protected boolean started
protected 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 String getInfo()
public void invoke(Request request, Response response) throws IOException, javax.servlet.ServletException
invoke in interface Valveinvoke in class ValveBaserequest - The servlet request to be processedresponse - The servlet response to be createdIOException - if an input/output error occursjavax.servlet.ServletException - if a servlet error occurspublic void event(Request request, Response response, HttpEvent event) throws IOException, javax.servlet.ServletException
event in interface Valveevent in class ValveBaserequest - The servlet request to be processedresponse - The servlet response to be createdevent - The event to be processedIOException - if an input/output error occursjavax.servlet.ServletException - if a servlet error occurspublic void sessionCreated(javax.servlet.http.HttpSessionEvent se)
sessionCreated in interface javax.servlet.http.HttpSessionListenerpublic void sessionDestroyed(javax.servlet.http.HttpSessionEvent se)
sessionDestroyed in interface javax.servlet.http.HttpSessionListenerCopyright © 2016 JBoss by Red Hat. All rights reserved.