Java 类org.apache.catalina.connector.CometEventImpl 实例源码

项目:tomcat7    文件:CometConnectionManagerValve.java   
@Override
public void sessionDestroyed(HttpSessionEvent se) {
    // Close all Comet connections associated with this session
    Request[] reqs = (Request[])
        se.getSession().getAttribute(cometRequestsAttribute);
    if (reqs != null) {
        for (int i = 0; i < reqs.length; i++) {
            Request req = reqs[i];
            try {
                CometEventImpl event = req.getEvent();
                event.setEventType(CometEvent.EventType.END);
                event.setEventSubType(CometEvent.EventSubType.SESSION_END);
                ((CometProcessor)
                        req.getWrapper().getServlet()).event(event);
                event.close();
            } catch (Exception e) {
                req.getWrapper().getParent().getLogger().warn(sm.getString(
                        "cometConnectionManagerValve.listenerEvent"), e);
            }
        }
    }
}
项目:apache-tomcat-7.0.73-with-comment    文件:CometConnectionManagerValve.java   
@Override
public void sessionDestroyed(HttpSessionEvent se) {
    // Close all Comet connections associated with this session
    Request[] reqs = (Request[])
        se.getSession().getAttribute(cometRequestsAttribute);
    if (reqs != null) {
        for (int i = 0; i < reqs.length; i++) {
            Request req = reqs[i];
            try {
                CometEventImpl event = req.getEvent();
                event.setEventType(CometEvent.EventType.END);
                event.setEventSubType(CometEvent.EventSubType.SESSION_END);
                ((CometProcessor)
                        req.getWrapper().getServlet()).event(event);
                event.close();
            } catch (Exception e) {
                req.getWrapper().getParent().getLogger().warn(sm.getString(
                        "cometConnectionManagerValve.listenerEvent"), e);
            }
        }
    }
}
项目:lazycat    文件:CometConnectionManagerValve.java   
@Override
public void sessionDestroyed(HttpSessionEvent se) {
    // Close all Comet connections associated with this session
    Request[] reqs = (Request[]) se.getSession().getAttribute(cometRequestsAttribute);
    if (reqs != null) {
        for (int i = 0; i < reqs.length; i++) {
            Request req = reqs[i];
            try {
                CometEventImpl event = req.getEvent();
                event.setEventType(CometEvent.EventType.END);
                event.setEventSubType(CometEvent.EventSubType.SESSION_END);
                ((CometProcessor) req.getWrapper().getServlet()).event(event);
                event.close();
            } catch (Exception e) {
                req.getWrapper().getParent().getLogger()
                        .warn(sm.getString("cometConnectionManagerValve.listenerEvent"), e);
            }
        }
    }
}
项目:tomcat7    文件:TestCometProcessor.java   
@Override
public void invoke(Request request, Response response)
        throws IOException, ServletException {

    CometEventImpl event = new CometEventImpl(request, response);

    getNext().invoke(request, response);

    if (request.isComet()) {
        Thread t = new AsyncCometCloseThread(event);
        t.start();
    }
}
项目:apache-tomcat-7.0.73-with-comment    文件:TestCometProcessor.java   
@Override
public void invoke(Request request, Response response)
        throws IOException, ServletException {

    CometEventImpl event = new CometEventImpl(request, response);

    getNext().invoke(request, response);

    if (request.isComet()) {
        Thread t = new AsyncCometCloseThread(event);
        t.start();
    }
}
项目:class-guard    文件:CometConnectionManagerValve.java   
@Override
public void sessionDestroyed(HttpSessionEvent se) {
    // Close all Comet connections associated with this session
    Request[] reqs = (Request[])
        se.getSession().getAttribute(cometRequestsAttribute);
    if (reqs != null) {
        for (int i = 0; i < reqs.length; i++) {
            Request req = reqs[i];
            try {
                CometEventImpl event = req.getEvent();
                event.setEventType(CometEvent.EventType.END);
                event.setEventSubType(CometEvent.EventSubType.SESSION_END);
                ((CometProcessor)
                        req.getWrapper().getServlet()).event(event);
                event.close();
            } catch (Exception e) {
                req.getWrapper().getParent().getLogger().warn(sm.getString(
                        "cometConnectionManagerValve.listenerEvent"), e);
            }
        }
    }
}
项目:apache-tomcat-7.0.57    文件:CometConnectionManagerValve.java   
@Override
public void sessionDestroyed(HttpSessionEvent se) {
    // Close all Comet connections associated with this session
    Request[] reqs = (Request[])
        se.getSession().getAttribute(cometRequestsAttribute);
    if (reqs != null) {
        for (int i = 0; i < reqs.length; i++) {
            Request req = reqs[i];
            try {
                CometEventImpl event = req.getEvent();
                event.setEventType(CometEvent.EventType.END);
                event.setEventSubType(CometEvent.EventSubType.SESSION_END);
                ((CometProcessor)
                        req.getWrapper().getServlet()).event(event);
                event.close();
            } catch (Exception e) {
                req.getWrapper().getParent().getLogger().warn(sm.getString(
                        "cometConnectionManagerValve.listenerEvent"), e);
            }
        }
    }
}
项目:apache-tomcat-7.0.57    文件:CometConnectionManagerValve.java   
@Override
public void sessionDestroyed(HttpSessionEvent se) {
    // Close all Comet connections associated with this session
    Request[] reqs = (Request[])
        se.getSession().getAttribute(cometRequestsAttribute);
    if (reqs != null) {
        for (int i = 0; i < reqs.length; i++) {
            Request req = reqs[i];
            try {
                CometEventImpl event = req.getEvent();
                event.setEventType(CometEvent.EventType.END);
                event.setEventSubType(CometEvent.EventSubType.SESSION_END);
                ((CometProcessor)
                        req.getWrapper().getServlet()).event(event);
                event.close();
            } catch (Exception e) {
                req.getWrapper().getParent().getLogger().warn(sm.getString(
                        "cometConnectionManagerValve.listenerEvent"), e);
            }
        }
    }
}
项目:WBSAirback    文件:CometConnectionManagerValve.java   
@Override
public void sessionDestroyed(HttpSessionEvent se) {
    // Close all Comet connections associated with this session
    Request[] reqs = (Request[])
        se.getSession().getAttribute(cometRequestsAttribute);
    if (reqs != null) {
        for (int i = 0; i < reqs.length; i++) {
            Request req = reqs[i];
            try {
                CometEventImpl event = req.getEvent();
                event.setEventType(CometEvent.EventType.END);
                event.setEventSubType(CometEvent.EventSubType.SESSION_END);
                ((CometProcessor)
                        req.getWrapper().getServlet()).event(event);
                event.close();
            } catch (Exception e) {
                req.getWrapper().getParent().getLogger().warn(sm.getString(
                        "cometConnectionManagerValve.listenerEvent"), e);
            }
        }
    }
}
项目:class-guard    文件:TestCometProcessor.java   
@Override
public void invoke(Request request, Response response)
        throws IOException, ServletException {

    CometEventImpl event = new CometEventImpl(request, response);

    getNext().invoke(request, response);

    if (request.isComet()) {
        Thread t = new AsyncCometCloseThread(event);
        t.start();
    }
}
项目:apache-tomcat-7.0.57    文件:TestCometProcessor.java   
@Override
public void invoke(Request request, Response response)
        throws IOException, ServletException {

    CometEventImpl event = new CometEventImpl(request, response);

    getNext().invoke(request, response);

    if (request.isComet()) {
        Thread t = new AsyncCometCloseThread(event);
        t.start();
    }
}
项目:apache-tomcat-7.0.57    文件:TestCometProcessor.java   
@Override
public void invoke(Request request, Response response)
        throws IOException, ServletException {

    CometEventImpl event = new CometEventImpl(request, response);

    getNext().invoke(request, response);

    if (request.isComet()) {
        Thread t = new AsyncCometCloseThread(event);
        t.start();
    }
}
项目:WBSAirback    文件:CometConnectionManagerValve.java   
@Override
public void lifecycleEvent(LifecycleEvent event) {
    if (Lifecycle.BEFORE_STOP_EVENT.equals(event.getType())) {
        // The container is getting stopped, close all current connections 
        Iterator<Request> iterator = cometRequests.iterator();
        while (iterator.hasNext()) {
            Request request = iterator.next();
            // Remove the session tracking attribute as it isn't
            // serializable or required.
            HttpSession session = request.getSession(false);
            if (session != null) {
                session.removeAttribute(cometRequestsAttribute);
            }
            // Close the comet connection
            try {
                CometEventImpl cometEvent = request.getEvent();
                cometEvent.setEventType(CometEvent.EventType.END);
                cometEvent.setEventSubType(
                        CometEvent.EventSubType.WEBAPP_RELOAD);
                getNext().event(request, request.getResponse(), cometEvent);
                cometEvent.close();
            } catch (Exception e) {
                container.getLogger().warn(
                        sm.getString("cometConnectionManagerValve.event"),
                        e);
            }
        }
        cometRequests.clear();
    }
}