org.atmosphere.container.version
Class GrizzlyWebSocket

java.lang.Object
  extended by org.atmosphere.websocket.WebSocketAdapter
      extended by org.atmosphere.container.version.GrizzlyWebSocket
All Implemented Interfaces:
AsyncIOWriter, WebSocket

public final class GrizzlyWebSocket
extends WebSocketAdapter


Field Summary
 
Fields inherited from class org.atmosphere.websocket.WebSocketAdapter
lastWrite
 
Fields inherited from interface org.atmosphere.websocket.WebSocket
WEBSOCKET_ACCEPT_DONE, WEBSOCKET_INITIATED, WEBSOCKET_RESUME, WEBSOCKET_SUSPEND
 
Constructor Summary
GrizzlyWebSocket(com.sun.grizzly.websockets.WebSocket webSocket)
           
 
Method Summary
 void close()
          Close the underlying connection.
 void flush()
          Flush the buffered content
 void redirect(String location)
          Redirect a WebSocket request to another location
 void write(byte[] data)
          Write a WebSocket message
 void write(byte[] data, int offset, int length)
          Write a WebSocket message
 void write(String data)
          Write a WebSocket message
 void writeError(int errorCode, String message)
          Write an error code
 
Methods inherited from class org.atmosphere.websocket.WebSocketAdapter
lastTick, resource, setAtmosphereResource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GrizzlyWebSocket

public GrizzlyWebSocket(com.sun.grizzly.websockets.WebSocket webSocket)
Method Detail

writeError

public void writeError(int errorCode,
                       String message)
                throws IOException
Write an error code

Parameters:
errorCode - the error code
Throws:
IOException

redirect

public void redirect(String location)
              throws IOException
Redirect a WebSocket request to another location

Throws:
IOException

write

public void write(String data)
           throws IOException
Write a WebSocket message

Parameters:
data - the WebSocket message
Throws:
IOException

write

public void write(byte[] data)
           throws IOException
Write a WebSocket message

Parameters:
data - the WebSocket message
Throws:
IOException

write

public void write(byte[] data,
                  int offset,
                  int length)
           throws IOException
Write a WebSocket message

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

close

public void close()
           throws IOException
Close the underlying connection.

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

flush

public void flush()
           throws IOException
Flush the buffered content

Throws:
IOException


Copyright © 2012. All Rights Reserved.