org.atmosphere.container.version
Class JettyWebSocket

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

public class JettyWebSocket
extends WebSocketAdapter

Jetty 7.1/2 & 8 < M3 WebSocket support.

Author:
Jeanfrancois Arcand

Field Summary
 
Fields inherited from interface org.atmosphere.websocket.WebSocket
WEBSOCKET_INITIATED, WEBSOCKET_RESUME, WEBSOCKET_SUSPEND
 
Constructor Summary
JettyWebSocket(Outbound outbound)
           
 
Method Summary
 void close()
          Close the underlying 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

JettyWebSocket

public JettyWebSocket(Outbound outbound)
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


Copyright © 2011. All Rights Reserved.