org.atmosphere.cpr
Interface AsyncIOWriter

All Known Implementing Classes:
AsyncIOWriterAdapter, AtmosphereInterceptorWriter, ByteArrayAsyncWriter, Grizzly2WebSocket, GrizzlyWebSocket, JBossWebSocket, Jetty8WebSocket, Jetty9WebSocket, JSR356WebSocket, TomcatWebSocket, WebLogicWebSocket, WebSocket

public interface AsyncIOWriter

An Asynchronous I/O Writer is used by a AtmosphereResponse when writing data.

Author:
Jeanfrancois Arcand

Method Summary
 void close(AtmosphereResponse r)
          Close the underlying connection.
 AsyncIOWriter flush(AtmosphereResponse r)
          Flush the buffered content.
 AsyncIOWriter redirect(AtmosphereResponse r, String location)
          Redirect a WebSocket request to another location.
 AsyncIOWriter write(AtmosphereResponse r, byte[] data)
          Write a WebSocket message.
 AsyncIOWriter write(AtmosphereResponse r, byte[] data, int offset, int length)
          Write a WebSocket message.
 AsyncIOWriter write(AtmosphereResponse r, String data)
          Write a WebSocket message.
 AsyncIOWriter writeError(AtmosphereResponse r, int errorCode, String message)
          Write an error code.
 

Method Detail

redirect

AsyncIOWriter redirect(AtmosphereResponse r,
                       String location)
                       throws IOException
Redirect a WebSocket request to another location.

Parameters:
location -
Throws:
IOException

writeError

AsyncIOWriter writeError(AtmosphereResponse r,
                         int errorCode,
                         String message)
                         throws IOException
Write an error code.

Parameters:
errorCode - the error code
message -
Throws:
IOException

write

AsyncIOWriter write(AtmosphereResponse r,
                    String data)
                    throws IOException
Write a WebSocket message.

Parameters:
data - the WebSocket message
Throws:
IOException

write

AsyncIOWriter write(AtmosphereResponse r,
                    byte[] data)
                    throws IOException
Write a WebSocket message.

Parameters:
data - the WebSocket message
Throws:
IOException

write

AsyncIOWriter write(AtmosphereResponse r,
                    byte[] data,
                    int offset,
                    int length)
                    throws IOException
Write a WebSocket message.

Parameters:
data - the WebSocket message
offset - offset of the message
length - length of the message
Throws:
IOException

close

void close(AtmosphereResponse r)
           throws IOException
Close the underlying connection.

Throws:
IOException

flush

AsyncIOWriter flush(AtmosphereResponse r)
                    throws IOException
Flush the buffered content.

Throws:
IOException


Copyright © 2014. All Rights Reserved.