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

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

@Path(value="long-running")
public class LongRunningEchoResource
extends java.lang.Object

Example of a simple resource with a long-running operation executed in a custom application thread.

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

Constructor Summary
LongRunningEchoResource()
           
 
Method Summary
 void asyncEcho(java.lang.String echo, AsyncResponse ar)
          Asynchronously echo the last path segment after sleeping for a long time.
 java.lang.String syncEcho(java.lang.String echo)
          Synchronously echo the last path segment after sleeping for a long time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LongRunningEchoResource

public LongRunningEchoResource()
Method Detail

syncEcho

@Path(value="sync/{echo}")
public java.lang.String syncEcho(java.lang.String echo)
Synchronously echo the last path segment after sleeping for a long time.

Parameters:
echo - message to echo.
Returns:
echoed message.

asyncEcho

@Path(value="async/{echo}")
public void asyncEcho(java.lang.String echo,
                                @Suspended
                                AsyncResponse ar)
Asynchronously echo the last path segment after sleeping for a long time.

Parameters:
echo - message to echo.


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