org.atmosphere.cpr
Class AsyncIOWriterAdapter

java.lang.Object
  extended by org.atmosphere.cpr.AsyncIOWriterAdapter
All Implemented Interfaces:
AsyncIOWriter
Direct Known Subclasses:
AtmosphereInterceptorWriter, ByteArrayAsyncWriter, WebSocket

public abstract class AsyncIOWriterAdapter
extends Object
implements AsyncIOWriter

Adapter class for AsyncIOWriter. Implementation of this class must implements one of each method to prevent a StackOverflow.

Author:
Jeanfrancois Arcand

Constructor Summary
AsyncIOWriterAdapter()
           
AsyncIOWriterAdapter(AtmosphereResponse r)
           
 
Method Summary
 void close()
          No OPS
 void close(AtmosphereResponse r)
          No OPS
 AsyncIOWriter flush()
          No OPS
 AsyncIOWriter flush(AtmosphereResponse r)
          No OPS
 AsyncIOWriter redirect(AtmosphereResponse r, String location)
          No OPS
 AsyncIOWriter redirect(String location)
          No OPS
 AsyncIOWriter write(AtmosphereResponse r, byte[] data)
          No OPS
 AsyncIOWriter write(AtmosphereResponse r, byte[] data, int offset, int length)
          No OPS
 AsyncIOWriter write(AtmosphereResponse r, String data)
          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(AtmosphereResponse r, int errorCode, String message)
          No OPS
 AsyncIOWriter writeError(int errorCode, String message)
          No OPS
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AsyncIOWriterAdapter

public AsyncIOWriterAdapter(AtmosphereResponse r)

AsyncIOWriterAdapter

public AsyncIOWriterAdapter()
Method Detail

redirect

public AsyncIOWriter redirect(String location)
                       throws IOException
No OPS

Specified by:
redirect in interface AsyncIOWriter
Throws:
IOException

writeError

public AsyncIOWriter writeError(int errorCode,
                                String message)
                         throws IOException
No OPS

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

write

public AsyncIOWriter write(String data)
                    throws IOException
No OPS

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

write

public AsyncIOWriter write(byte[] data)
                    throws IOException
No OPS

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

write

public AsyncIOWriter write(byte[] data,
                           int offset,
                           int length)
                    throws IOException
No OPS

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

close

public void close()
           throws IOException
No OPS

Specified by:
close in interface AsyncIOWriter
Throws:
IOException

flush

public AsyncIOWriter flush()
                    throws IOException
No OPS

Specified by:
flush in interface AsyncIOWriter
Throws:
IOException

redirect

public AsyncIOWriter redirect(AtmosphereResponse r,
                              String location)
                       throws IOException
No OPS

Specified by:
redirect in interface AsyncIOWriter
Throws:
IOException

writeError

public AsyncIOWriter writeError(AtmosphereResponse r,
                                int errorCode,
                                String message)
                         throws IOException
No OPS

Specified by:
writeError in interface AsyncIOWriter
errorCode - the error code
Throws:
IOException

write

public AsyncIOWriter write(AtmosphereResponse r,
                           String data)
                    throws IOException
No OPS

Specified by:
write in interface AsyncIOWriter
data - the WebSocket message
Throws:
IOException

write

public AsyncIOWriter write(AtmosphereResponse r,
                           byte[] data)
                    throws IOException
No OPS

Specified by:
write in interface AsyncIOWriter
data - the WebSocket message
Throws:
IOException

write

public AsyncIOWriter write(AtmosphereResponse r,
                           byte[] data,
                           int offset,
                           int length)
                    throws IOException
No OPS

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

close

public void close(AtmosphereResponse r)
           throws IOException
No OPS

Specified by:
close in interface AsyncIOWriter
Throws:
IOException

flush

public AsyncIOWriter flush(AtmosphereResponse r)
                    throws IOException
No OPS

Specified by:
flush in interface AsyncIOWriter
Throws:
IOException


Copyright © 2013. All Rights Reserved.