org.atmosphere.container.version
Class TomcatWebSocket

java.lang.Object
  extended by org.atmosphere.cpr.AsyncIOWriterAdapter
      extended by org.atmosphere.cpr.AtmosphereInterceptorWriter
          extended by org.atmosphere.websocket.WebSocket
              extended by org.atmosphere.container.version.TomcatWebSocket
All Implemented Interfaces:
AsyncIOWriter

public class TomcatWebSocket
extends WebSocket

Tomcat WebSocket Support

Author:
Jeanfrancois Arcand

Field Summary
 
Fields inherited from class org.atmosphere.websocket.WebSocket
bb, binaryWrite, cb, lastWrite, logger, NOT_SUPPORTED, WEBSOCKET_ACCEPT_DONE, WEBSOCKET_INITIATED, WEBSOCKET_RESUME, WEBSOCKET_SUSPEND
 
Fields inherited from class org.atmosphere.cpr.AtmosphereInterceptorWriter
filters
 
Constructor Summary
TomcatWebSocket(org.apache.catalina.websocket.WsOutbound outbound, AtmosphereConfig config)
           
 
Method Summary
 void close()
          Close the underlying WebSocket
 void close(AtmosphereResponse r)
          Close the underlying connection.
 WebSocket flush(AtmosphereResponse r)
          Flush the buffered content.
 boolean isOpen()
          Is the underlying WebSocket open.
 String toString()
           
 WebSocket write(byte[] b, int offset, int length)
          Use the underlying container's websocket to write the byte.
 WebSocket write(String s)
          Use the underlying container's websocket to write the String.
 
Methods inherited from class org.atmosphere.websocket.WebSocket
broadcast, config, lastWriteTimeStampInMilliseconds, notSupported, redirect, resource, resource, retrieveUUID, transform, webSocketHandler, webSocketHandler, write, write, write, writeError
 
Methods inherited from class org.atmosphere.cpr.AtmosphereInterceptorWriter
interceptor, invokeInterceptor, writeReady
 
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

isOpen

public boolean isOpen()
Description copied from class: WebSocket
Is the underlying WebSocket open.

Specified by:
isOpen in class WebSocket
Returns:
true is opened

write

public WebSocket write(String s)
                throws IOException
Description copied from class: WebSocket
Use the underlying container's websocket to write the String.

Specified by:
write in class WebSocket
Parameters:
s - a websocket String message
Returns:
this
Throws:
IOException

write

public WebSocket write(byte[] b,
                       int offset,
                       int length)
                throws IOException
Description copied from class: WebSocket
Use the underlying container's websocket to write the byte.

Specified by:
write in class WebSocket
Parameters:
b - a websocket byte message
offset - start
length - end
Returns:
this
Throws:
IOException

close

public void close()
Description copied from class: WebSocket
Close the underlying WebSocket

Specified by:
close in class WebSocket

close

public void close(AtmosphereResponse r)
           throws IOException
Description copied from interface: AsyncIOWriter
Close the underlying connection.

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

flush

public WebSocket flush(AtmosphereResponse r)
                throws IOException
Description copied from interface: AsyncIOWriter
Flush the buffered content.

Specified by:
flush in interface AsyncIOWriter
Overrides:
flush in class WebSocket
Throws:
IOException

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2014. All Rights Reserved.