com.samskivert.servlet.util
Class ServiceWaiter<T>

java.lang.Object
  extended by com.samskivert.util.ServiceWaiter<T>
      extended by com.samskivert.servlet.util.ServiceWaiter<T>
All Implemented Interfaces:
ResultListener<T>

public class ServiceWaiter<T>
extends ServiceWaiter<T>

Extends the basic ServiceWaiter to be useful for servlets.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.samskivert.util.ServiceWaiter
ServiceWaiter.TimeoutException
 
Nested classes/interfaces inherited from interface com.samskivert.util.ResultListener
ResultListener.NOOP<T>
 
Field Summary
static int NO_TIMEOUT
          Timeout to specify when you don't want a timeout.
 
Fields inherited from class com.samskivert.util.ServiceWaiter
_argument, _error, _success, _timeout, DEFAULT_WAITER_TIMEOUT
 
Fields inherited from interface com.samskivert.util.ResultListener
NOOP
 
Constructor Summary
ServiceWaiter()
          Construct a ServiceWaiter with the default (30 second) timeout.
ServiceWaiter(int timeout)
          Construct a ServiceWaiter with the specified timeout.
 
Method Summary
 boolean awaitFriendlyResponse(String friendlyText)
          Blocks waiting for the response.
 
Methods inherited from class com.samskivert.util.ServiceWaiter
getArgument, getError, postFailure, postSuccess, requestCompleted, requestFailed, reset, setTimeout, waitForResponse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_TIMEOUT

public static final int NO_TIMEOUT
Timeout to specify when you don't want a timeout. Use at your own risk.

See Also:
Constant Field Values
Constructor Detail

ServiceWaiter

public ServiceWaiter()
Construct a ServiceWaiter with the default (30 second) timeout.


ServiceWaiter

public ServiceWaiter(int timeout)
Construct a ServiceWaiter with the specified timeout.

Parameters:
timeout - the timeout, in seconds.
Method Detail

awaitFriendlyResponse

public boolean awaitFriendlyResponse(String friendlyText)
                              throws FriendlyException
Blocks waiting for the response.

Returns:
true if a success response was posted, false if a failure repsonse was posted.
Throws:
FriendlyException


Copyright © 2000-2008 Michael Bayne. All Rights Reserved.