org.webbitserver.handler
Class ReconnectingWebSocketHandler

java.lang.Object
  extended by org.webbitserver.handler.ReconnectingWebSocketHandler
All Implemented Interfaces:
WebSocketHandler

public class ReconnectingWebSocketHandler
extends Object
implements WebSocketHandler


Constructor Summary
ReconnectingWebSocketHandler(WebSocketHandler handler, WebSocket webSocket, long reconnectIntervalMillis)
           
 
Method Summary
 void onClose(WebSocketConnection connection)
          Called when a connection is closed.
 void onMessage(WebSocketConnection connection, byte[] msg)
           
 void onMessage(WebSocketConnection connection, String msg)
           
 void onOpen(WebSocketConnection connection)
           
 void onPing(WebSocketConnection connection, byte[] msg)
           
 void onPong(WebSocketConnection connection, byte[] msg)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReconnectingWebSocketHandler

public ReconnectingWebSocketHandler(WebSocketHandler handler,
                                    WebSocket webSocket,
                                    long reconnectIntervalMillis)
Method Detail

onOpen

public void onOpen(WebSocketConnection connection)
            throws Throwable
Specified by:
onOpen in interface WebSocketHandler
Throws:
Throwable

onClose

public void onClose(WebSocketConnection connection)
             throws Throwable
Description copied from interface: WebSocketHandler
Called when a connection is closed.

Specified by:
onClose in interface WebSocketHandler
Parameters:
connection - the connection that was closed. Beware that the connection will be null if this handler is used in a WebSocket that fails to connect.
Throws:
Exception
Throwable

onMessage

public void onMessage(WebSocketConnection connection,
                      String msg)
               throws Throwable
Specified by:
onMessage in interface WebSocketHandler
Throws:
Throwable

onMessage

public void onMessage(WebSocketConnection connection,
                      byte[] msg)
               throws Throwable
Specified by:
onMessage in interface WebSocketHandler
Throws:
Throwable

onPing

public void onPing(WebSocketConnection connection,
                   byte[] msg)
            throws Throwable
Specified by:
onPing in interface WebSocketHandler
Throws:
Throwable

onPong

public void onPong(WebSocketConnection connection,
                   byte[] msg)
            throws Throwable
Specified by:
onPong in interface WebSocketHandler
Throws:
Throwable


Copyright © 2012. All Rights Reserved.