public interface CometEvent
Modifier and Type | Interface and Description |
---|---|
static class |
CometEvent.EventSubType
Event details
TIMEOUT - the connection timed out (sub type of ERROR); note that this ERROR type is not fatal, and
the connection will not be closed unless the servlet uses the close method of the event
CLIENT_DISCONNECT - the client connection was closed (sub type of ERROR)
IOEXCEPTION - an IO exception occurred, such as invalid content, for example, an invalid chunk block (sub type of ERROR)
WEBAPP_RELOAD - the webapplication is being reloaded (sub type of END)
SERVER_SHUTDOWN - the server is shutting down (sub type of END)
SESSION_END - the servlet ended the session (sub type of END)
|
static class |
CometEvent.EventType
Enumeration describing the major events that the container can invoke
the CometProcessors event() method with
BEGIN - will be called at the beginning
of the processing of the connection.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Ends the Comet session.
|
CometEvent.EventSubType |
getEventSubType()
Returns the sub type of this event.
|
CometEvent.EventType |
getEventType()
Returns the event type.
|
javax.servlet.http.HttpServletRequest |
getHttpServletRequest()
Returns the HttpServletRequest.
|
javax.servlet.http.HttpServletResponse |
getHttpServletResponse()
Returns the HttpServletResponse.
|
void |
setTimeout(int timeout)
Sets the timeout for this Comet connection.
|
javax.servlet.http.HttpServletRequest getHttpServletRequest()
javax.servlet.http.HttpServletResponse getHttpServletResponse()
CometEvent.EventType getEventType()
CometEvent.EventSubType getEventSubType()
void close() throws IOException
IOException
- if an IO exception occursvoid setTimeout(int timeout) throws IOException, javax.servlet.ServletException, UnsupportedOperationException
response.flushBuffer()
. If a timeout occurs, the
error(HttpServletRequest, HttpServletResponse)
method is invoked. The
web application SHOULD NOT attempt to reuse the request and response objects after a timeout
as the error(HttpServletRequest, HttpServletResponse)
method indicates.timeout
- The timeout in milliseconds for this connection, must be a positive value, larger than 0IOException
- An IOException may be thrown to indicate an IO error,
or that the EOF has been reached on the connectionjavax.servlet.ServletException
- An exception has occurred, as specified by the root
causeUnsupportedOperationException
- if per connection timeout is not supported, either at all or at this phase
of the invocation.Copyright © 2021. All rights reserved.