|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.apache.tomcat.bayeux.BayeuxServlet
public class BayeuxServlet
Field Summary | |
---|---|
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 Summary | |
---|---|
BayeuxServlet()
|
Method Summary | |
---|---|
protected void |
checkBayeux(org.jboss.servlet.http.HttpEvent cometEvent)
|
void |
destroy()
Upon servlet destruction, the servlet will clean up the TomcatBayeux object and terminate any outstanding events. |
void |
event(org.jboss.servlet.http.HttpEvent cometEvent)
Process the given IO event. |
protected int |
getReconnectInterval()
|
java.lang.String |
getServletInfo()
Returns information about the servlet, such as author, version, and copyright. |
protected int |
getTimeout()
Returns the preconfigured connection timeout. |
protected int |
handleBayeux(java.lang.String message,
org.jboss.servlet.http.HttpEvent event)
|
void |
init()
A convenience method which can be overridden so that there's no need to call super.init(config) . |
void |
service(javax.servlet.ServletRequest servletRequest,
javax.servlet.ServletResponse servletResponse)
Dispatches client requests to the protected service method. |
Methods inherited from class javax.servlet.http.HttpServlet |
---|
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service |
Methods inherited from class javax.servlet.GenericServlet |
---|
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, log, log |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.servlet.Servlet |
---|
getServletConfig, init |
Field Detail |
---|
protected int timeout
protected int reconnectInterval
public static final java.lang.String TOMCAT_BAYEUX_ATTR
protected TomcatBayeux tb
Constructor Detail |
---|
public BayeuxServlet()
Method Detail |
---|
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(org.jboss.servlet.http.HttpEvent cometEvent) throws java.io.IOException, javax.servlet.ServletException
org.jboss.servlet.http.HttpEventServlet
event
in interface org.jboss.servlet.http.HttpEventServlet
cometEvent
- The event that will be processed
java.io.IOException
javax.servlet.ServletException
protected void checkBayeux(org.jboss.servlet.http.HttpEvent cometEvent) throws java.io.IOException, java.lang.UnsupportedOperationException
cometEvent
- CometEvent
java.io.IOException
java.lang.UnsupportedOperationException
protected int handleBayeux(java.lang.String message, org.jboss.servlet.http.HttpEvent event) throws java.io.IOException, javax.servlet.ServletException
java.io.IOException
javax.servlet.ServletException
public java.lang.String getServletInfo()
javax.servlet.GenericServlet
Servlet.getServletInfo()
.
getServletInfo
in interface javax.servlet.Servlet
getServletInfo
in class javax.servlet.GenericServlet
public void init() throws javax.servlet.ServletException
javax.servlet.GenericServlet
super.init(config)
.
Instead of overriding GenericServlet.init(ServletConfig)
, simply override
this method and it will be called by
GenericServlet.init(ServletConfig config)
.
The ServletConfig
object can still be retrieved via GenericServlet.getServletConfig()
.
init
in class javax.servlet.GenericServlet
javax.servlet.ServletException
- if an exception occurs that
interrupts the servlet's
normal operationpublic void service(javax.servlet.ServletRequest servletRequest, javax.servlet.ServletResponse servletResponse) throws javax.servlet.ServletException, java.io.IOException
javax.servlet.http.HttpServlet
service
method. There's no need to
override this method.
service
in interface javax.servlet.Servlet
service
in class javax.servlet.http.HttpServlet
servletRequest
- the HttpServletRequest
object that
contains the request the client made of
the servletservletResponse
- the HttpServletResponse
object that
contains the response the servlet returns
to the client
javax.servlet.ServletException
- if the HTTP request cannot
be handled
java.io.IOException
- if an input or output error occurs
while the servlet is handling the
HTTP requestServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |