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, servicegetInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, log, logprotected int timeout
protected int reconnectInterval
public static final String TOMCAT_BAYEUX_ATTR
protected TomcatBayeux tb
public void destroy()
destroy in interface javax.servlet.Servletdestroy in class javax.servlet.GenericServletprotected int getTimeout()
timeout
then the default of 2min will be used.protected int getReconnectInterval()
public void event(HttpEvent cometEvent) throws IOException, javax.servlet.ServletException
HttpEventServletevent in interface HttpEventServletcometEvent - The event that will be processedIOExceptionjavax.servlet.ServletExceptionprotected void checkBayeux(HttpEvent cometEvent) throws IOException, UnsupportedOperationException
cometEvent - CometEventIOExceptionUnsupportedOperationExceptionprotected int handleBayeux(String message, HttpEvent event) throws IOException, javax.servlet.ServletException
IOExceptionjavax.servlet.ServletExceptionpublic String getServletInfo()
getServletInfo in interface javax.servlet.ServletgetServletInfo in class javax.servlet.GenericServletpublic void init()
throws javax.servlet.ServletException
init in class javax.servlet.GenericServletjavax.servlet.ServletExceptionpublic void service(javax.servlet.ServletRequest servletRequest,
javax.servlet.ServletResponse servletResponse)
throws javax.servlet.ServletException,
IOException
service in interface javax.servlet.Servletservice in class javax.servlet.http.HttpServletjavax.servlet.ServletExceptionIOExceptionCopyright © 2016 JBoss by Red Hat. All rights reserved.