org.apache.catalina.valves
public class CometConnectionManagerValve extends ValveBase implements Lifecycle, 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.
Version: $Revision: 769328 $ $Date: 2009-04-28 12:39:24 +0200 (Tue, 28 Apr 2009) $
Field Summary | |
---|---|
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 StringManager | sm
The string manager for this package. |
protected boolean | started
Has this component been started yet? |
Method Summary | |
---|---|
void | addLifecycleListener(LifecycleListener listener)
Add a lifecycle event listener to this component.
|
void | event(Request request, Response response, CometEvent 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) |
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. |
Parameters: listener The listener to add
Parameters: request The servlet request to be processed response The servlet response to be created
Throws: IOException if an input/output error occurs ServletException if a servlet error occurs
Parameters: request The servlet request to be processed response The servlet response to be created
Throws: IOException if an input/output error occurs ServletException if a servlet error occurs
Parameters: listener The listener to add
configure()
,
and before any of the public methods of the component are utilized.
Throws: LifecycleException if this component detects a fatal error that prevents this component from being used
Throws: LifecycleException if this component detects a fatal error that needs to be reported