org.atmosphere.samples.chat
Class WebSocketChat

java.lang.Object
  extended by org.atmosphere.websocket.WebSocketHandlerAdapter
      extended by org.atmosphere.samples.chat.WebSocketChat
All Implemented Interfaces:
org.atmosphere.websocket.WebSocketHandler

@WebSocketHandlerService(path="/chat",
                         broadcaster=org.atmosphere.util.SimpleBroadcaster.class)
public class WebSocketChat
extends org.atmosphere.websocket.WebSocketHandlerAdapter

Simple WebSocketHandler that implement the logic to build a Chat application.

Author:
Jeanfrancois Arcand

Nested Class Summary
static class WebSocketChat.Data
           
 
Constructor Summary
WebSocketChat()
           
 
Method Summary
 void onOpen(org.atmosphere.websocket.WebSocket webSocket)
           
 void onTextMessage(org.atmosphere.websocket.WebSocket webSocket, String message)
           
 
Methods inherited from class org.atmosphere.websocket.WebSocketHandlerAdapter
onByteMessage, onClose, onError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebSocketChat

public WebSocketChat()
Method Detail

onOpen

public void onOpen(org.atmosphere.websocket.WebSocket webSocket)
            throws IOException
Specified by:
onOpen in interface org.atmosphere.websocket.WebSocketHandler
Overrides:
onOpen in class org.atmosphere.websocket.WebSocketHandlerAdapter
Throws:
IOException

onTextMessage

public void onTextMessage(org.atmosphere.websocket.WebSocket webSocket,
                          String message)
                   throws IOException
Specified by:
onTextMessage in interface org.atmosphere.websocket.WebSocketHandler
Overrides:
onTextMessage in class org.atmosphere.websocket.WebSocketHandlerAdapter
Throws:
IOException


Copyright © 2014. All Rights Reserved.