CometEventImpl (Apache Tomcat 7.0.76 API Documentation)

org.apache.catalina.connector

## Class CometEventImpl

- java.lang.Object
- - org.apache.catalina.connector.CometEventImpl

- All Implemented Interfaces:
    CometEvent

      public class CometEventImpl
      extends Object
      implements CometEvent

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.apache.catalina.comet.CometEvent

      `CometEvent.EventSubType, CometEvent.EventType`

  - ### Field Summary

    Fields
    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 Summary

    Constructors
    Constructor and Description
    `CometEventImpl(Request request, Response response)`

  - ### Method Summary

    Methods
    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()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### sm

          protected static final StringManager sm

      The string manager for this package.

    - #### request

          protected Request request

      Associated request.

    - #### response

          protected Response response

      Associated response.

    - #### eventType

          protected CometEvent.EventType eventType

      Event type.

    - #### eventSubType

          protected CometEvent.EventSubType eventSubType

      Event sub type.

  - ### Constructor Detail

    - #### CometEventImpl

          public CometEventImpl(Request request,
                        Response response)

  - ### Method Detail

    - #### clear

          public void clear()

      Clear the event.

    - #### setEventType

          public void setEventType(CometEvent.EventType eventType)

    - #### setEventSubType

          public void setEventSubType(CometEvent.EventSubType eventSubType)

    - #### close

          public void close()
                     throws IOException

      Description copied from interface: `CometEvent`
      Ends the Comet session. This signals to the container that the container wants to end the comet session. This will send back to the client a notice that the server has no more data to send as part of this request. The servlet should perform any needed cleanup as if it had received an END or ERROR event.
      Specified by:
        `close` in interface `CometEvent`
      Throws:
        `IOException` - if an IO exception occurs

    - #### getEventSubType

          public CometEvent.EventSubType getEventSubType()

      Description copied from interface: `CometEvent`
      Returns the sub type of this event.
      Specified by:
        `getEventSubType` in interface `CometEvent`
      Returns:
        EventSubType

    - #### getEventType

          public CometEvent.EventType getEventType()

      Description copied from interface: `CometEvent`
      Returns the event type.
      Specified by:
        `getEventType` in interface `CometEvent`
      Returns:
        EventType

    - #### getHttpServletRequest

          public HttpServletRequest getHttpServletRequest()

      Description copied from interface: `CometEvent`
      Returns the HttpServletRequest.
      Specified by:
        `getHttpServletRequest` in interface `CometEvent`
      Returns:
        HttpServletRequest

    - #### getHttpServletResponse

          public HttpServletResponse getHttpServletResponse()

      Description copied from interface: `CometEvent`
      Returns the HttpServletResponse.
      Specified by:
        `getHttpServletResponse` in interface `CometEvent`
      Returns:
        HttpServletResponse

    - #### setTimeout

          public void setTimeout(int timeout)
                          throws IOException,
                                 ServletException,
                                 UnsupportedOperationException

      Description copied from interface: `CometEvent`
      Sets the timeout for this Comet connection. Please NOTE, that the implementation of a per connection timeout is OPTIONAL and MAY NOT be implemented.
      This method sets the timeout in milliseconds of idle time on the connection. The timeout is reset every time data is received from the connection or data is flushed using `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.
      This method should not be called asynchronously, as that will have no effect.
      Specified by:
        `setTimeout` in interface `CometEvent`
      Parameters:
        `timeout` - The timeout in milliseconds for this connection, must be a positive value, larger than 0
      Throws:
        `IOException` - An IOException may be thrown to indicate an IO error, or that the EOF has been reached on the connection
        `ServletException` - An exception has occurred, as specified by the root cause
        `UnsupportedOperationException` - if per connection timeout is not supported, either at all or at this phase of the invocation.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.