public class CometEventImpl extends Object implements CometEvent
CometEvent.EventSubType, CometEvent.EventType
Modifier and Type | Field and Description |
---|---|
protected CometEvent.EventSubType |
eventSubType
Event sub type.
|
protected CometEvent.EventType |
eventType
Event type.
|
protected Request |
request
Associated request.
|
protected Response |
response
Associated response.
|
protected static StringManager |
sm
The string manager for this package.
|
Constructor and Description |
---|
CometEventImpl(Request request,
Response response) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear the event.
|
void |
close()
Ends the Comet session.
|
CometEvent.EventSubType |
getEventSubType()
Returns the sub type of this event.
|
CometEvent.EventType |
getEventType()
Returns the event type.
|
HttpServletRequest |
getHttpServletRequest()
Returns the HttpServletRequest.
|
HttpServletResponse |
getHttpServletResponse()
Returns the HttpServletResponse.
|
void |
setEventSubType(CometEvent.EventSubType eventSubType) |
void |
setEventType(CometEvent.EventType eventType) |
void |
setTimeout(int timeout)
Sets the timeout for this Comet connection.
|
String |
toString() |
protected static final StringManager sm
protected Request request
protected Response response
protected CometEvent.EventType eventType
protected CometEvent.EventSubType eventSubType
public void clear()
public void setEventType(CometEvent.EventType eventType)
public void setEventSubType(CometEvent.EventSubType eventSubType)
public void close() throws IOException
CometEvent
close
in interface CometEvent
IOException
- if an IO exception occurspublic CometEvent.EventSubType getEventSubType()
CometEvent
getEventSubType
in interface CometEvent
public CometEvent.EventType getEventType()
CometEvent
getEventType
in interface CometEvent
public HttpServletRequest getHttpServletRequest()
CometEvent
getHttpServletRequest
in interface CometEvent
public HttpServletResponse getHttpServletResponse()
CometEvent
getHttpServletResponse
in interface CometEvent
public void setTimeout(int timeout) throws IOException, ServletException, UnsupportedOperationException
CometEvent
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.setTimeout
in interface CometEvent
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 connectionServletException
- 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 © 2000-2021 Apache Software Foundation. All Rights Reserved.