org.glassfish.grizzly.websockets
Class WebSocketAdapter

java.lang.Object
  extended by org.glassfish.grizzly.websockets.WebSocketAdapter
All Implemented Interfaces:
WebSocketListener
Direct Known Subclasses:
WebSocketApplication

public class WebSocketAdapter
extends Object
implements WebSocketListener


Constructor Summary
WebSocketAdapter()
           
 
Method Summary
 void onClose(WebSocket socket, DataFrame frame)
           Invoked when WebSocket.onClose(DataFrame) has been called on a particular WebSocket instance.
 void onConnect(WebSocket socket)
           Invoked when the opening handshake has been completed for a specific WebSocket instance.
 void onFragment(WebSocket socket, byte[] fragment, boolean last)
           Invoked when WebSocket.onFragment(boolean, byte[]) has been called on a particular WebSocket instance.
 void onFragment(WebSocket socket, String fragment, boolean last)
           Invoked when WebSocket.onFragment(boolean, String) has been called on a particular WebSocket instance.
 void onMessage(WebSocket socket, byte[] bytes)
           Invoked when WebSocket.onMessage(String) has been called on a particular WebSocket instance.
 void onMessage(WebSocket socket, String text)
           Invoked when WebSocket.onMessage(String) has been called on a particular WebSocket instance.
 void onPing(WebSocket socket, byte[] bytes)
           Invoked when WebSocket.onPing(DataFrame) has been called on a particular WebSocket instance.
 void onPong(WebSocket socket, byte[] bytes)
           Invoked when WebSocket.onPong(DataFrame) has been called on a particular WebSocket instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebSocketAdapter

public WebSocketAdapter()
Method Detail

onClose

public void onClose(WebSocket socket,
                    DataFrame frame)
Description copied from interface: WebSocketListener

Invoked when WebSocket.onClose(DataFrame) has been called on a particular WebSocket instance.

Specified by:
onClose in interface WebSocketListener
Parameters:
socket - the WebSocket being closed.
frame - the closing DataFrame sent by the remote end-point.

onConnect

public void onConnect(WebSocket socket)
Description copied from interface: WebSocketListener

Invoked when the opening handshake has been completed for a specific WebSocket instance.

Specified by:
onConnect in interface WebSocketListener
Parameters:
socket - the newly connected WebSocket

onMessage

public void onMessage(WebSocket socket,
                      String text)
Description copied from interface: WebSocketListener

Invoked when WebSocket.onMessage(String) has been called on a particular WebSocket instance.

Specified by:
onMessage in interface WebSocketListener
Parameters:
socket - the WebSocket that received a message.
text - the message received.

onMessage

public void onMessage(WebSocket socket,
                      byte[] bytes)
Description copied from interface: WebSocketListener

Invoked when WebSocket.onMessage(String) has been called on a particular WebSocket instance.

Specified by:
onMessage in interface WebSocketListener
Parameters:
socket - the WebSocket that received a message.
bytes - the message received.

onPing

public void onPing(WebSocket socket,
                   byte[] bytes)
Description copied from interface: WebSocketListener

Invoked when WebSocket.onPing(DataFrame) has been called on a particular WebSocket instance.

Specified by:
onPing in interface WebSocketListener
Parameters:
socket - the WebSocket that received the ping.
bytes - the payload of the ping frame, if any.

onPong

public void onPong(WebSocket socket,
                   byte[] bytes)
Description copied from interface: WebSocketListener

Invoked when WebSocket.onPong(DataFrame) has been called on a particular WebSocket instance.

Specified by:
onPong in interface WebSocketListener
Parameters:
socket - the WebSocket that received the pong.
bytes - the payload of the pong frame, if any.

onFragment

public void onFragment(WebSocket socket,
                       String fragment,
                       boolean last)
Description copied from interface: WebSocketListener

Invoked when WebSocket.onFragment(boolean, String) has been called on a particular WebSocket instance.

Specified by:
onFragment in interface WebSocketListener
Parameters:
socket - the WebSocket received the message fragment.
fragment - the message fragment.
last - flag indicating if this was the last fragment.

onFragment

public void onFragment(WebSocket socket,
                       byte[] fragment,
                       boolean last)
Description copied from interface: WebSocketListener

Invoked when WebSocket.onFragment(boolean, byte[]) has been called on a particular WebSocket instance.

Specified by:
onFragment in interface WebSocketListener
Parameters:
socket - the WebSocket received the message fragment.
fragment - the message fragment.
last - flag indicating if this was the last fragment.


Copyright © 2013 Oracle Corporation. All Rights Reserved.