org.atmosphere.container.version
Class Jetty8WebSocket

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

public class Jetty8WebSocket
extends WebSocketAdapter

Jetty 8 WebSocket support.

Author:
Jeanfrancois Arcand

Field Summary
 
Fields inherited from interface org.atmosphere.websocket.WebSocket
WEBSOCKET_INITIATED, WEBSOCKET_RESUME, WEBSOCKET_SUSPEND
 
Constructor Summary
Jetty8WebSocket(WebSocket.Connection connection)
           
 
Method Summary
 void close()
          Close the underlying WebSocket connection
 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
resource, setAtmosphereResource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Jetty8WebSocket

public Jetty8WebSocket(WebSocket.Connection connection)
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 WebSocket connection

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


Copyright © 2011. All Rights Reserved.