org.atmosphere.samples.chat.jersey
Class ChatResource
java.lang.Object
org.atmosphere.samples.chat.jersey.ChatResource
public class ChatResource
- extends Object
Simple chat resource demonstrating the power of Atmosphere. This resource supports transport like WebSocket, Streaming, JSONP and Long-Polling.
- Author:
- Jeanfrancois Arcand
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ChatResource
public ChatResource()
suspend
@Suspend(contentType="application/json")
public String suspend()
- Suspend the response without writing anything back to the client.
- Returns:
- a white space
broadcast
public Response broadcast(Message message,
@Context
AtmosphereResource r,
@Context
Broadcaster b)
- Broadcast the received message object to all suspended response. Do not write back the message to the calling connection.
- Parameters:
message - a Message
- Returns:
- a
Response
Copyright © 2012. All Rights Reserved.