org.directwebremoting.util
Class Continuation

java.lang.Object
  extended by org.directwebremoting.util.Continuation

public class Continuation
extends java.lang.Object

A wrapper around Jetty and Grizzly Ajax Continuations

Author:
Joe Walker [joe at getahead dot ltd dot uk]

Constructor Summary
Continuation(javax.servlet.http.HttpServletRequest request)
          Fish the continuation out of the request if it exists.
 
Method Summary
 boolean isAvailable()
          Are continuations working? If this method returns false then all the other methods will fail.
static boolean isGrizzly()
           
static boolean isJetty()
           
 void resume()
          Resume a continuation.
static void rethrowIfContinuation(java.lang.Throwable th)
          We shouldn't be catching Jetty RetryRequests so we re-throw them.
 void suspend()
          Suspend the thread for a maximum of sleepTime milliseconds
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Continuation

public Continuation(javax.servlet.http.HttpServletRequest request)
Fish the continuation out of the request if it exists.

Parameters:
request - The http request
Method Detail

isAvailable

public boolean isAvailable()
Are continuations working? If this method returns false then all the other methods will fail.

Returns:
true if Continuations are working

suspend

public void suspend()
             throws java.lang.Exception
Suspend the thread for a maximum of sleepTime milliseconds

Throws:
java.lang.Exception - If reflection breaks

resume

public void resume()
            throws java.lang.Exception
Resume a continuation. For Jetty: does not work like a real continuation because it restarts the http request.

Throws:
java.lang.Exception - If reflection breaks

rethrowIfContinuation

public static void rethrowIfContinuation(java.lang.Throwable th)
We shouldn't be catching Jetty RetryRequests so we re-throw them.

Parameters:
th - The exception to test for continuation-ness

isJetty

public static boolean isJetty()
Returns:
True if we have detected Jetty classes

isGrizzly

public static boolean isGrizzly()
Returns:
True if we have detected Grizzly classes

Copyright 2008