Package org.atmosphere.cpr.AtmosphereServlet

Examples of org.atmosphere.cpr.AtmosphereServlet.Action


        String connection = req.getHeader("Connection");
        if (!"Upgrade".equalsIgnoreCase(connection)) {
            return super.service(req, res);
        } else {
            Action action = suspended(req, res);
            if (action.type == Action.TYPE.SUSPEND) {
                if (logger.isLoggable(Level.FINE)) {
                    logger.fine("Suspending" + res);
                }
            } else if (action.type == Action.TYPE.RESUME) {
View Full Code Here


    /**
     * {@inheritDoc}
     */
    public Action service(HttpServletRequest req, HttpServletResponse res)
            throws IOException, ServletException {
        Action action = suspended(req, res);
        if (action.type == Action.TYPE.SUSPEND) {
            if (logger.isLoggable(Level.FINE)) {
                logger.fine("Suspending" + res);
            }
        } else if (action.type == Action.TYPE.RESUME) {
            if (logger.isLoggable(Level.FINE)) {
                logger.fine("Resuming" + res);
            }

            Action nextAction = resumed(req, res);
            if (nextAction.type == Action.TYPE.SUSPEND) {
                if (logger.isLoggable(Level.FINE)) {
                    logger.fine("Suspending after Resuming" + res);
                }
            }
View Full Code Here

     * {@inheritDoc}
     */
    public Action service(HttpServletRequest req, HttpServletResponse res)
            throws IOException, ServletException {
        Continuation c = ContinuationSupport.getContinuation(req, null);
        Action action = null;

        if (!c.isResumed() && !c.isPending()) {
            // This will throw an exception
            action = suspended(req, res);
            if (action.type == Action.TYPE.SUSPEND) {
View Full Code Here

    @Override
    public Action cancelled(HttpServletRequest req, HttpServletResponse res)
            throws IOException, ServletException {

        Action action =  super.cancelled(req,res);
        if (req.getAttribute(MAX_INACTIVE) != null && Long.class.cast(req.getAttribute(MAX_INACTIVE)) == -1) {
            Continuation c = ContinuationSupport.getContinuation(req, null);
            if (c != null) {
                c.resume();
            }
View Full Code Here

     * {@inheritDoc}
     */
    public Action service(HttpServletRequest req, HttpServletResponse res)
            throws IOException, ServletException {
        CometContext ctx = CometEngine.getEngine().getCometContext(atmosphereCtx);
        Action action = suspended(req, res);
        if (action.type == Action.TYPE.SUSPEND) {
            if (logger.isLoggable(Level.FINE)) {
                logger.fine("Suspending" + res);
            }
            suspend(ctx, action, req, res);
View Full Code Here

    @Override
    public Action cancelled(HttpServletRequest req, HttpServletResponse res)
            throws IOException, ServletException {

        Action action =  super.cancelled(req,res);
        if (req.getAttribute(MAX_INACTIVE) != null && Long.class.cast(req.getAttribute(MAX_INACTIVE)) == -1) {
           resume(req, CometEngine.getEngine().getCometContext(atmosphereCtx));
        }
        return action;
    }
View Full Code Here

        String upgrade = req.getHeader("Connection");
        if (upgrade != null && upgrade.equalsIgnoreCase("Upgrade") && !supportWebSocket()) {
            res.setStatus(501);
            res.addHeader("X-Atmosphere-error","Websocket protocol not supported");
            res.flushBuffer();
            return new Action();
        }

        if (supportSession()) {
            // Create the session needed to support the Resume
            // operation from disparate requests.
View Full Code Here

     * @throws IOException
     * @throws ServletException
     */
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
            throws IOException, ServletException {
        Action a = as.doCometSupport((HttpServletRequest) request, (HttpServletResponse) response);
        if (a == null || a.type != Action.TYPE.SUSPEND) {
            chain.doFilter(request, response);
        }
    }
View Full Code Here

TOP

Related Classes of org.atmosphere.cpr.AtmosphereServlet.Action

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.