org.atmosphere.container.version
Class TomcatWebSocket

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

public class TomcatWebSocket
extends WebSocketAdapter

Tomcat WebSocket Support

Author:
Jeanfrancois Arcand

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
TomcatWebSocket(org.apache.catalina.websocket.WsOutbound outbound, AtmosphereConfig config)
           
 
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
 String toString()
           
 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, wait, wait, wait
 

Constructor Detail

TomcatWebSocket

public TomcatWebSocket(org.apache.catalina.websocket.WsOutbound outbound,
                       AtmosphereConfig config)
Method Detail

redirect

public void redirect(String location)
              throws IOException
Description copied from interface: AsyncIOWriter
Redirect a WebSocket request to another location

Throws:
IOException

writeError

public void writeError(int errorCode,
                       String message)
                throws IOException
Description copied from interface: AsyncIOWriter
Write an error code

Parameters:
errorCode - the error code
Throws:
IOException

write

public void write(String data)
           throws IOException
Description copied from interface: AsyncIOWriter
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

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2012. All Rights Reserved.