com.sun.grizzly.samples.websockets
Class ChatWebSocket

java.lang.Object
  extended by com.sun.grizzly.websockets.BaseWebSocket
      extended by com.sun.grizzly.websockets.BaseServerWebSocket
          extended by com.sun.grizzly.samples.websockets.ChatWebSocket
All Implemented Interfaces:
WebSocket

public class ChatWebSocket
extends BaseServerWebSocket


Field Summary
 
Fields inherited from class com.sun.grizzly.websockets.BaseWebSocket
logger
 
Fields inherited from interface com.sun.grizzly.websockets.WebSocket
END_POINT_GOING_DOWN, INVALID_DATA, MESSAGE_TOO_LARGE, NORMAL_CLOSURE, PROTOCOL_ERROR
 
Constructor Summary
ChatWebSocket(WebSocketListener[] listeners)
           
 
Method Summary
 String getUser()
           
 void send(String data)
          Write the data to the socket.
 void setUser(String user)
           
 
Methods inherited from class com.sun.grizzly.websockets.BaseServerWebSocket
getRequest, getResponse
 
Methods inherited from class com.sun.grizzly.websockets.BaseWebSocket
add, close, close, close, getListeners, getNetworkHandler, isConnected, onClose, onConnect, onFragment, onMessage, onMessage, onPing, onPong, remove, send, setNetworkHandler, stream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChatWebSocket

public ChatWebSocket(WebSocketListener[] listeners)
Method Detail

getUser

public String getUser()

setUser

public void setUser(String user)

send

public void send(String data)
Description copied from interface: WebSocket
Write the data to the socket. This text will be converted to a UTF-8 encoded byte[] prior to sending.

Specified by:
send in interface WebSocket
Overrides:
send in class BaseWebSocket


Copyright © 2012 Oracle Corporation. All Rights Reserved.