org.atmosphere.cpr
Class AtmosphereInterceptorWriter

java.lang.Object
  extended by org.atmosphere.cpr.AsyncIOWriterAdapter
      extended by org.atmosphere.cpr.AtmosphereInterceptorWriter
All Implemented Interfaces:
AsyncIOWriter

public class AtmosphereInterceptorWriter
extends AsyncIOWriterAdapter

An AsyncIOWriter that delegates the write operation to it's AsyncIOInterceptor. If no AsyncIOInterceptor are specified, this class does nothing and the response's will never get written.

Author:
Jeanfrancois Arcand

Constructor Summary
AtmosphereInterceptorWriter(AtmosphereResponse response)
           
 
Method Summary
 void close()
          No OPS
 AsyncIOWriter flush()
          No OPS
 AtmosphereInterceptorWriter interceptor(AsyncIOInterceptor filter)
           
 AsyncIOWriter redirect(String location)
          No OPS
 AsyncIOWriter write(byte[] data)
          No OPS
 AsyncIOWriter write(byte[] data, int offset, int length)
          No OPS
 AsyncIOWriter write(String data)
          No OPS
 AsyncIOWriter writeError(int errorCode, String message)
          No OPS
 
Methods inherited from class org.atmosphere.cpr.AsyncIOWriterAdapter
close, flush, redirect, write, write, write, writeError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AtmosphereInterceptorWriter

public AtmosphereInterceptorWriter(AtmosphereResponse response)
Method Detail

redirect

public AsyncIOWriter redirect(String location)
                       throws IOException
Description copied from class: AsyncIOWriterAdapter
No OPS

Specified by:
redirect in interface AsyncIOWriter
Overrides:
redirect in class AsyncIOWriterAdapter
Throws:
IOException

writeError

public AsyncIOWriter writeError(int errorCode,
                                String message)
                         throws IOException
Description copied from class: AsyncIOWriterAdapter
No OPS

Specified by:
writeError in interface AsyncIOWriter
Overrides:
writeError in class AsyncIOWriterAdapter
Parameters:
errorCode - the error code
Throws:
IOException

write

public AsyncIOWriter write(String data)
                    throws IOException
Description copied from class: AsyncIOWriterAdapter
No OPS

Specified by:
write in interface AsyncIOWriter
Overrides:
write in class AsyncIOWriterAdapter
Parameters:
data - the WebSocket message
Throws:
IOException

write

public AsyncIOWriter write(byte[] data)
                    throws IOException
Description copied from class: AsyncIOWriterAdapter
No OPS

Specified by:
write in interface AsyncIOWriter
Overrides:
write in class AsyncIOWriterAdapter
Parameters:
data - the WebSocket message
Throws:
IOException

write

public AsyncIOWriter write(byte[] data,
                           int offset,
                           int length)
                    throws IOException
Description copied from class: AsyncIOWriterAdapter
No OPS

Specified by:
write in interface AsyncIOWriter
Overrides:
write in class AsyncIOWriterAdapter
Parameters:
data - the WebSocket message
offset - offset of the message
length - length if the message
Throws:
IOException

close

public void close()
           throws IOException
Description copied from class: AsyncIOWriterAdapter
No OPS

Specified by:
close in interface AsyncIOWriter
Overrides:
close in class AsyncIOWriterAdapter
Throws:
IOException

flush

public AsyncIOWriter flush()
                    throws IOException
Description copied from class: AsyncIOWriterAdapter
No OPS

Specified by:
flush in interface AsyncIOWriter
Overrides:
flush in class AsyncIOWriterAdapter
Throws:
IOException

interceptor

public AtmosphereInterceptorWriter interceptor(AsyncIOInterceptor filter)


Copyright © 2013. All Rights Reserved.