Package org.atmosphere.cpr

Examples of org.atmosphere.cpr.AtmosphereRequest.removeAttribute()


        RemoteEndpointImpl remoteEndpoint = (RemoteEndpointImpl) request.getAttribute(RemoteEndpointImpl.class.getName());

        if (remoteEndpoint != null) {
            if (event.isCancelled() || event.isClosedByClient()) {
                remoteEndpoint.status().status(event.isCancelled() ? Status.STATUS.UNEXPECTED_CLOSE : Status.STATUS.CLOSED_BY_CLIENT);
                request.removeAttribute(RemoteEndpointImpl.class.getName());
                trackedUUID.remove(r.uuid());

                invokeOpenOrClose(onCloseMethod, remoteEndpoint);
            } else if (event.isResumedOnTimeout() || event.isResuming()) {
                remoteEndpoint.status().status(Status.STATUS.CLOSED_BY_TIMEOUT);
View Full Code Here


                trackedUUID.remove(r.uuid());

                invokeOpenOrClose(onCloseMethod, remoteEndpoint);
            } else if (event.isResumedOnTimeout() || event.isResuming()) {
                remoteEndpoint.status().status(Status.STATUS.CLOSED_BY_TIMEOUT);
                request.removeAttribute(RemoteEndpointImpl.class.getName());

                invokeOpenOrClose(onTimeoutMethod, remoteEndpoint);
            } else {
                super.onStateChange(event);
            }
View Full Code Here

                        req.setAttribute(MAX_INACTIVE, (long) -1);

                        logger.debug("IdleResourceInterceptor disconnecting {}", r);
                        Future<?> f = (Future<?>) req.getAttribute(HeartbeatInterceptor.HEARTBEAT_FUTURE);
                        if (f != null) f.cancel(false);
                        req.removeAttribute(HeartbeatInterceptor.HEARTBEAT_FUTURE);

                        WebSocket webSocket = AtmosphereResourceImpl.class.cast(r).webSocket();
                        if (webSocket != null) {
                            webSocket.close();
                        } else {
View Full Code Here

    private MethodInfo.EncoderObject message(AtmosphereResource resource, Object o) {
        AtmosphereRequest request = AtmosphereResourceImpl.class.cast(resource).getRequest(false);
        try {

            Method invokedMethod = (Method) request.getAttribute(getClass().getName());
            request.removeAttribute(getClass().getName());

            if (invokedMethod != null) {
                for (MethodInfo m : onRuntimeMethod) {
                    if (invokedMethod.equals(m.method)) {
                        return m.encode(encoders, o);
View Full Code Here

        RemoteEndpointImpl remoteEndpoint = (RemoteEndpointImpl) request.getAttribute(RemoteEndpointImpl.class.getName());

        if (event.isCancelled() || event.isClosedByClient()) {
            remoteEndpoint.status().status(event.isCancelled() ? Status.STATUS.UNEXPECTED_CLOSE : Status.STATUS.CLOSED_BY_CLIENT);
            request.removeAttribute(RemoteEndpointImpl.class.getName());
            trackedUUID.remove(r.uuid());

            invokeOpenOrClose(onCloseMethod, remoteEndpoint);
        } else if (event.isResumedOnTimeout() || event.isResuming()) {
            remoteEndpoint.status().status(Status.STATUS.CLOSED_BY_TIMEOUT);
View Full Code Here

            trackedUUID.remove(r.uuid());

            invokeOpenOrClose(onCloseMethod, remoteEndpoint);
        } else if (event.isResumedOnTimeout() || event.isResuming()) {
            remoteEndpoint.status().status(Status.STATUS.CLOSED_BY_TIMEOUT);
            request.removeAttribute(RemoteEndpointImpl.class.getName());

            invokeOpenOrClose(onTimeoutMethod, remoteEndpoint);
        } else {
            super.onStateChange(event);
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.