public class BayeuxServlet extends javax.servlet.http.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 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() |
String |
getServletInfo() |
protected int |
getTimeout()
Returns the preconfigured connection timeout.
|
protected int |
handleBayeux(String message,
HttpEvent event) |
void |
init() |
void |
service(javax.servlet.ServletRequest servletRequest,
javax.servlet.ServletResponse servletResponse) |
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, log, log
protected int timeout
protected int reconnectInterval
public static final String TOMCAT_BAYEUX_ATTR
protected TomcatBayeux tb
public void destroy()
destroy
in interface javax.servlet.Servlet
destroy
in class javax.servlet.GenericServlet
protected int getTimeout()
timeout
then the default of 2min will be used.protected int getReconnectInterval()
public void event(HttpEvent cometEvent) throws IOException, javax.servlet.ServletException
HttpEventServlet
event
in interface HttpEventServlet
cometEvent
- The event that will be processedIOException
javax.servlet.ServletException
protected void checkBayeux(HttpEvent cometEvent) throws IOException, UnsupportedOperationException
cometEvent
- CometEventIOException
UnsupportedOperationException
protected int handleBayeux(String message, HttpEvent event) throws IOException, javax.servlet.ServletException
IOException
javax.servlet.ServletException
public String getServletInfo()
getServletInfo
in interface javax.servlet.Servlet
getServletInfo
in class javax.servlet.GenericServlet
public void init() throws javax.servlet.ServletException
init
in class javax.servlet.GenericServlet
javax.servlet.ServletException
public void service(javax.servlet.ServletRequest servletRequest, javax.servlet.ServletResponse servletResponse) throws javax.servlet.ServletException, IOException
service
in interface javax.servlet.Servlet
service
in class javax.servlet.http.HttpServlet
javax.servlet.ServletException
IOException
Copyright © 2014 JBoss by Red Hat. All Rights Reserved.