public class HttpEventImpl extends Object implements HttpEvent, javax.servlet.http.WebConnection
HttpEvent.EventType
Modifier and Type | Field and Description |
---|---|
protected HttpEvent.EventType |
eventType
Event type.
|
protected Request |
request
Associated request.
|
protected Response |
response
Associated response.
|
Constructor and Description |
---|
HttpEventImpl(Request request,
Response response) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear the event.
|
void |
close()
Ends the request, which marks the end of the event stream.
|
javax.servlet.http.HttpServletRequest |
getHttpServletRequest()
Returns the HttpServletRequest.
|
javax.servlet.http.HttpServletResponse |
getHttpServletResponse()
Returns the HttpServletResponse.
|
javax.servlet.ServletInputStream |
getInputStream() |
javax.servlet.ServletOutputStream |
getOutputStream() |
HttpEvent.EventType |
getType()
Returns the event type.
|
boolean |
isReadReady()
Returns true when data may be read from the connection (the flag becomes false if no data
is available to read).
|
boolean |
isWriteReady()
Returns true when data may be written to the connection (the flag becomes false
when the client is unable to accept data fast enough).
|
void |
resume()
Resume will cause the Servlet container to send a generic event
to the Servlet, where the request can be processed synchronously
(for example, it is possible to use this to complete the request after
some asynchronous processing is done).
|
void |
setTimeout(int timeout)
This method sets the timeout in milliseconds of idle time on the connection.
|
void |
setType(HttpEvent.EventType eventType) |
void |
suspend()
Suspend processing of the connection until the configured timeout occurs,
or resume() is called.
|
String |
toString() |
protected Request request
protected Response response
protected HttpEvent.EventType eventType
public void clear()
public void setType(HttpEvent.EventType eventType)
public void close() throws IOException
HttpEvent
close
in interface AutoCloseable
close
in interface HttpEvent
IOException
- if an IO exception occurspublic HttpEvent.EventType getType()
HttpEvent
public javax.servlet.http.HttpServletRequest getHttpServletRequest()
HttpEvent
getHttpServletRequest
in interface HttpEvent
public javax.servlet.http.HttpServletResponse getHttpServletResponse()
HttpEvent
getHttpServletResponse
in interface HttpEvent
public javax.servlet.ServletInputStream getInputStream() throws IOException
getInputStream
in interface javax.servlet.http.WebConnection
IOException
public javax.servlet.ServletOutputStream getOutputStream() throws IOException
getOutputStream
in interface javax.servlet.http.WebConnection
IOException
public void setTimeout(int timeout)
HttpEvent
setTimeout
in interface HttpEvent
timeout
- The timeout in milliseconds for this connection, must be a positive value, larger than 0public boolean isReadReady()
HttpEvent
isReadReady
in interface HttpEvent
public boolean isWriteReady()
HttpEvent
isWriteReady
in interface HttpEvent
public void resume()
HttpEvent
public void suspend()
HttpEvent
Copyright © 2015 JBoss by Red Hat. All rights reserved.