org.glassfish.jersey.examples.server.async.managed
Class ChatResource

java.lang.Object
  extended by org.glassfish.jersey.examples.server.async.managed.ChatResource

@Path(value="chat")
@Produces(value="application/json")
public class ChatResource
extends Object

Example of a simple fire&forget point-to-point messaging resource. This version of the messaging resource does not block when POSTing a new message.

Author:
Marek Potociar (marek.potociar at oracle.com)

Constructor Summary
ChatResource()
           
 
Method Summary
 void getMessage(javax.ws.rs.container.AsyncResponse ar)
           
 String postMessage(Message message)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChatResource

public ChatResource()
Method Detail

getMessage

@GET
@ManagedAsync
public void getMessage(@Suspended
                                        javax.ws.rs.container.AsyncResponse ar)
                throws InterruptedException
Throws:
InterruptedException

postMessage

@POST
@ManagedAsync
public String postMessage(Message message)
                   throws InterruptedException
Throws:
InterruptedException


Copyright © 2007-2014, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.