Package org.atmosphere.cpr.AtmosphereResourceEventListenerAdapter

Examples of org.atmosphere.cpr.AtmosphereResourceEventListenerAdapter.OnSuspend


    public final static class ManagedMessage {

        @Get
        public void get(AtmosphereResource resource) {
            r.set(resource);
            resource.addEventListener(new OnSuspend() {
                @Override
                public void onSuspend(AtmosphereResourceEvent event) {
                    AtmosphereRequest request = new AtmosphereRequest.Builder().pathInfo("/e").method("POST").body("message").build();

                    try {
View Full Code Here


    public final static class ManagedMessageWithResource {

        @Get
        public void get(AtmosphereResource resource) {
            r.set(resource);
            resource.addEventListener(new OnSuspend() {
                @Override
                public void onSuspend(AtmosphereResourceEvent event) {
                    AtmosphereRequest request = new AtmosphereRequest.Builder().pathInfo("/k").method("POST").body("message").build();

                    try {
View Full Code Here

    @ManagedService(path = "/readerInjection")
    public final static class ReaderInjection {
        @Get
        public void get(AtmosphereResource resource) {
            r.set(resource);
            resource.addEventListener(new OnSuspend() {
                @Override
                public void onSuspend(AtmosphereResourceEvent event) {
                    AtmosphereRequest request = new AtmosphereRequest.Builder().pathInfo("/readerInjection").method("POST").body("message").build();

                    try {
View Full Code Here

    @ManagedService(path = "/inputStreamInjection")
    public final static class InputStreamInjection {
        @Get
        public void get(AtmosphereResource resource) {
            r.set(resource);
            resource.addEventListener(new OnSuspend() {
                @Override
                public void onSuspend(AtmosphereResourceEvent event) {
                    AtmosphereRequest request = new AtmosphereRequest.Builder().pathInfo("/inputStreamInjection").method("POST").body("message").build();

                    try {
View Full Code Here

        private AtmosphereResourceSessionFactory sessionFactory;

        @Get
        public void get(AtmosphereResource resource) {
            r.set(resource);
            resource.addEventListener(new OnSuspend() {
                @Override
                public void onSuspend(AtmosphereResourceEvent event) {
                    AtmosphereRequest request = new AtmosphereRequest.Builder().pathInfo("/injectAnnotation").method("POST").body("message").build();

                    try {
View Full Code Here

            if (cachedMessages.size() > 0) {
                logger.trace("cached messages");
                writeCache(r, cachedMessages);
                return Action.CANCELLED;
            } else {
                r.addEventListener(new OnSuspend() {
                    public void onSuspend(AtmosphereResourceEvent event) {
                        r.removeEventListener(this);

                        logger.trace("onSuspend first");
                        final AtomicBoolean doNotSuspend = new AtomicBoolean(false);
View Full Code Here

                    }
                }
            }

            if (!Utils.resumableTransport(r.transport())) {
                OnSuspend a = new OnSuspend() {
                    @Override
                    public void onSuspend(AtmosphereResourceEvent event) {
                        response.write(protocolMessage.get());
                        try {
                            response.flushBuffer();
View Full Code Here

        boolean polling = Utils.pollableTransport(resource.transport());
        boolean webSocketMessage = Utils.webSocketMessage(resource);

        if (!webSocketMessage) {
            if (onReadyMethod != null && !polling) {
                resource.addEventListener(new OnSuspend() {
                    @Override
                    public void onSuspend(AtmosphereResourceEvent event) {
                        processReady(event.getResource());
                        resource.removeEventListener(this);
                    }
View Full Code Here

                                }
                            }
                        }
                        final Object entity = response.getEntity();

                        r.addEventListener(new OnSuspend() {
                            @Override
                            public void onSuspend(AtmosphereResourceEvent event) {
                                try {
                                    if (entity != null) {
                                        if (waitForResource) {
View Full Code Here

TOP

Related Classes of org.atmosphere.cpr.AtmosphereResourceEventListenerAdapter.OnSuspend

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.