org.glassfish.jersey.examples.server.async
Class FireAndForgetChatResource

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

@Path(value="async/messaging/fireAndForget")
@Produces(value="text/plain")
@Consumes(value="text/plain")
public class FireAndForgetChatResource
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)

Field Summary
static String POST_NOTIFICATION_RESPONSE
           
 
Constructor Summary
FireAndForgetChatResource()
           
 
Method Summary
 void pickUpMessage(AsyncResponse ar, String messageId)
           
 String postMessage(String message)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

POST_NOTIFICATION_RESPONSE

public static final String POST_NOTIFICATION_RESPONSE
See Also:
Constant Field Values
Constructor Detail

FireAndForgetChatResource

public FireAndForgetChatResource()
Method Detail

pickUpMessage

@GET
public void pickUpMessage(@Suspended
                              AsyncResponse ar,
                              @QueryParam(value="id")
                              String messageId)
                   throws InterruptedException
Throws:
InterruptedException

postMessage

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


Copyright © 2007-2013 Oracle Corporation. All Rights Reserved. Use is subject to license terms.