org.atmosphere.samples.chat.jersey
Class Jaxrs2Chat

java.lang.Object
  extended by org.atmosphere.samples.chat.jersey.Jaxrs2Chat

public class Jaxrs2Chat
extends Object

Simple chat resource demonstrating the power of Atmosphere using JAXRS 2 Spec This resource supports transport like WebSocket, Streaming, JSONP and Long-Polling.

Author:
Jeanfrancois Arcand

Constructor Summary
Jaxrs2Chat()
           
 
Method Summary
 Response broadcast(Message message)
          Broadcast the received message object to all suspended response.
 String suspend()
          Suspend the response without writing anything back to the client.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Jaxrs2Chat

public Jaxrs2Chat()
Method Detail

suspend

@Suspend
public String suspend()
Suspend the response without writing anything back to the client.

Returns:
a white space

broadcast

public Response broadcast(Message message)
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.