Package org.atmosphere.cpr

Examples of org.atmosphere.cpr.AsyncIOWriter


        if (padding) {
            r.addEventListener(new ForcePreSuspend(response));

            super.inspect(r);

            AsyncIOWriter writer = response.getAsyncIOWriter();
            if (AtmosphereInterceptorWriter.class.isAssignableFrom(writer.getClass())) {
                AtmosphereInterceptorWriter.class.cast(writer).interceptor(new AsyncIOInterceptorAdapter() {
                    private void padding() {
                        if (!r.isSuspended()) {
                            writePadding(response);
                            request.setAttribute("paddingWritten", "true");
View Full Code Here


        final AtmosphereResponse response = r.getResponse();

        super.inspect(r);

        AsyncIOWriter writer = response.getAsyncIOWriter();
        if (AtmosphereInterceptorWriter.class.isAssignableFrom(writer.getClass())) {
            AtmosphereInterceptorWriter.class.cast(writer).interceptor(interceptor);
        } else {
            logger.warn("Unable to apply {}. Your AsyncIOWriter must implement {}", getClass().getName(), AtmosphereInterceptorWriter.class.getName());
        }
        return Action.CONTINUE;
View Full Code Here

    @Override
    public AsyncSupport complete(AtmosphereResourceImpl r) {
        try {
            AtmosphereResponse response = r.getResponse(false);
            AsyncIOWriter a = response.getAsyncIOWriter();
            if (a != null) {
                a.close(response);
            }
        } catch (IOException e) {
            logger.trace("", e);
        }
        return this;
View Full Code Here

        write(r, data, 0, data.length);
        return this;
    }

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

TOP

Related Classes of org.atmosphere.cpr.AsyncIOWriter

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.