net.sf.asyncobjects.util
Class AsyncProcess.ProcessWhen<I>

java.lang.Object
  extended by net.sf.asyncobjects.When<I,Void>
      extended by net.sf.asyncobjects.util.AsyncProcess.ProcessWhen<I>
Type Parameters:
I - promise input
All Implemented Interfaces:
ExplicitSharing
Enclosing class:
AsyncProcess<R>

protected abstract class AsyncProcess.ProcessWhen<I>
extends When<I,Void>

A utility when variant that fails process (using AsyncProcess.failure(Throwable)) if promise is smashed or body is smashed. Note that AsyncProcess.success(Object) should still called explicitly.


Nested Class Summary
 
Nested classes/interfaces inherited from class net.sf.asyncobjects.When
When.InternalArgumentListener, When.InternalBodyPromiseResolver, When.InternalFinallyListenerAfterFault, When.InternalFinallyListenerAfterSuccess, When.InternalResultPromiseResolver
 
Constructor Summary
AsyncProcess.ProcessWhen(I ao)
          A consctoructor,
AsyncProcess.ProcessWhen(Promise<I> p)
          A constructor
 
Method Summary
protected  Promise<Void> smashed(Throwable problem)
          This imlementation just fails process using AsyncProcess.failure(Throwable) method.
 
Methods inherited from class net.sf.asyncobjects.When
bodySmashed, finallyDo, promise, resolved
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AsyncProcess.ProcessWhen

public AsyncProcess.ProcessWhen(Promise<I> p)
A constructor

Parameters:
p - a promiose

AsyncProcess.ProcessWhen

public AsyncProcess.ProcessWhen(I ao)
A consctoructor,

Parameters:
ao - a reference to asynchronous object
Method Detail

smashed

protected Promise<Void> smashed(Throwable problem)
                         throws Throwable
This imlementation just fails process using AsyncProcess.failure(Throwable) method.

Overrides:
smashed in class When<I,Void>
Parameters:
problem - a problem that broken a promise.
Returns:
a value becomes curren result of promise
Throws:
Throwable - if there is a problem
See Also:
When.smashed(java.lang.Throwable)


Copyright © 2002-2007 Constantine Plotnikov. All Rights Reserved.