FileDocCategorySizeDatePackage
CometEventImpl.javaAPI DocApache Tomcat 6.0.143429Fri Jul 20 04:20:34 BST 2007org.apache.catalina.connector

CometEventImpl

public class CometEventImpl extends Object implements org.apache.catalina.CometEvent

Fields Summary
protected static org.apache.catalina.util.StringManager
sm
The string manager for this package.
protected Request
request
Associated request.
protected Response
response
Associated response.
protected EventType
eventType
Event type.
protected EventSubType
eventSubType
Event sub type.
Constructors Summary
public CometEventImpl(Request request, Response response)



         
        this.request = request;
        this.response = response;
    
Methods Summary
public voidclear()
Clear the event.

    

    // --------------------------------------------------------- Public Methods

            
       
        request = null;
        response = null;
    
public voidclose()

        if (request == null) {
            throw new IllegalStateException(sm.getString("cometEvent.nullRequest"));
        }
        request.setComet(false);
        response.finishResponse();
    
public EventSubTypegetEventSubType()

        return eventSubType;
    
public EventTypegetEventType()

        return eventType;
    
public javax.servlet.http.HttpServletRequestgetHttpServletRequest()

        return request.getRequest();
    
public javax.servlet.http.HttpServletResponsegetHttpServletResponse()

        return response.getResponse();
    
public voidsetEventSubType(EventSubType eventSubType)

        this.eventSubType = eventSubType;
    
public voidsetEventType(EventType eventType)

        this.eventType = eventType;
    
public voidsetTimeout(int timeout)

        if (request.getAttribute("org.apache.tomcat.comet.timeout.support") == Boolean.TRUE) {
            request.setAttribute("org.apache.tomcat.comet.timeout", new Integer(timeout));
        } else {
            throw new UnsupportedOperationException();
        }