public class BayeuxServlet extends HttpServlet implements HttpEventServlet
| Modifier and Type | Field and Description |
|---|---|
protected int |
reconnectInterval
The reconnect interval.
|
protected TomcatBayeux |
tb
Reference to the global TomcatBayeux object
|
protected int |
timeout
The timeout.
|
static java.lang.String |
TOMCAT_BAYEUX_ATTR
Attribute to hold the TomcatBayeux object in the servlet context
|
| Constructor and Description |
|---|
BayeuxServlet() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkBayeux(HttpEvent cometEvent) |
void |
destroy()
Upon servlet destruction, the servlet will clean up the
TomcatBayeux object and terminate any outstanding events.
|
void |
event(HttpEvent cometEvent)
Process the given IO event.
|
protected int |
getReconnectInterval() |
java.lang.String |
getServletInfo() |
protected int |
getTimeout()
Returns the preconfigured connection timeout.
|
protected int |
handleBayeux(java.lang.String message,
HttpEvent event) |
void |
init() |
void |
service(ServletRequest servletRequest,
ServletResponse servletResponse) |
protected int timeout
protected int reconnectInterval
public static final java.lang.String TOMCAT_BAYEUX_ATTR
protected TomcatBayeux tb
public void destroy()
protected int getTimeout()
timeout
then the default of 2min will be used.protected int getReconnectInterval()
public void event(HttpEvent cometEvent) throws java.io.IOException, ServletException
HttpEventServletevent in interface HttpEventServletcometEvent - The event that will be processedjava.io.IOExceptionServletExceptionprotected void checkBayeux(HttpEvent cometEvent) throws java.io.IOException, java.lang.UnsupportedOperationException
cometEvent - CometEventjava.io.IOExceptionjava.lang.UnsupportedOperationExceptionprotected int handleBayeux(java.lang.String message,
HttpEvent event)
throws java.io.IOException,
ServletException
java.io.IOExceptionServletExceptionpublic java.lang.String getServletInfo()
public void init()
throws ServletException
ServletExceptionpublic void service(ServletRequest servletRequest,
ServletResponse servletResponse)
throws ServletException,
java.io.IOException
ServletExceptionjava.io.IOException