Examples of asyncIOWriter()


Examples of org.atmosphere.cpr.AtmosphereResponse.asyncIOWriter()

            }

            final Transport transport = transports.get(protocol + "-" + version);
            if (transport != null) {
                if (!SocketIOAtmosphereHandler.class.isAssignableFrom(atmosphereHandler.getClass())) {
                    response.asyncIOWriter(new AsyncIOWriterAdapter() {
                        @Override
                        public AsyncIOWriter write(AtmosphereResponse r, String data) throws IOException {
                            SocketIOSessionOutbound outbound = (SocketIOSessionOutbound)
                                    request.getAttribute(SocketIOAtmosphereHandler.SOCKETIO_SESSION_OUTBOUND);
                            SocketIOSessionManagerImpl.SocketIOProtocol p = (SocketIOSessionManagerImpl.SocketIOProtocol)
View Full Code Here

Examples of org.atmosphere.cpr.AtmosphereResponse.asyncIOWriter()

                            filters.addLast(filter);
                        }
                        return this;
                    }
                };
                res.asyncIOWriter(writer);
            }
            //REVIST need a better way to add a custom filter at the first entry and not at the last as
            // e.g. interceptor(AsyncIOInterceptor interceptor, int position)
            LinkedList<AsyncIOInterceptor> filters = AtmosphereInterceptorWriter.class.cast(writer).filters();
            if (!filters.contains(interceptor)) {
View Full Code Here

Examples of org.atmosphere.cpr.AtmosphereResponse.asyncIOWriter()

        AtmosphereRequest request = new AtmosphereRequest.Builder().pathInfo("/h").method("GET").build();
        AtmosphereResponse response = AtmosphereResponse.newInstance();
        final AtomicReference<String> ref = new AtomicReference();

        response.asyncIOWriter(new AsyncIOWriterAdapter() {
            @Override
            public AsyncIOWriter write(AtmosphereResponse r, byte[] data) throws IOException {
                ref.set(new String(data));
                return this;
            }
View Full Code Here

Examples of org.atmosphere.cpr.AtmosphereResponse.asyncIOWriter()

    protected byte[] transform(byte[] b, int offset, int length) throws IOException {
        AtmosphereResponse response = r.getResponse();
        AsyncIOWriter a = response.getAsyncIOWriter();
        try {
            response.asyncIOWriter(buffer);
            invokeInterceptor(response, b, offset, length);
            return buffer.stream().toByteArray();
        } finally {
            buffer.close(null);
            response.asyncIOWriter(a);
View Full Code Here

Examples of org.atmosphere.cpr.AtmosphereResponse.asyncIOWriter()

            response.asyncIOWriter(buffer);
            invokeInterceptor(response, b, offset, length);
            return buffer.stream().toByteArray();
        } finally {
            buffer.close(null);
            response.asyncIOWriter(a);
        }
    }

    @Override
    public WebSocket write(AtmosphereResponse r, String data) throws IOException {
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.