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

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

@Path(value="message")
public class MessagingResource
extends java.lang.Object

Example of a simple blocking point-to-point messaging resource. This version of the messaging resource blocks when POSTing a new message until the message is retrieved.

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

Constructor Summary
MessagingResource()
           
 
Method Summary
 void pickUpMessage(AsyncResponse ar)
          Retrieve a message from the blocking message queue.
 void postMessage(AsyncResponse ar, java.lang.String message)
          Post a new message to the blocking message queue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessagingResource

public MessagingResource()
Method Detail

pickUpMessage

public void pickUpMessage(@Suspended
                          AsyncResponse ar)
Retrieve a message from the blocking message queue.

Parameters:
ar - suspended asynchronous JAX-RS response.

postMessage

public void postMessage(@Suspended
                        AsyncResponse ar,
                        java.lang.String message)
Post a new message to the blocking message queue.

Parameters:
ar - suspended asynchronous JAX-RS response.
message - message to be posted.


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