|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ValueT
- the result type returned by call()
.public interface BeforeAfterCallable<ValueT>
See the main description page on Yost.com.
Nested Class Summary | |
---|---|
static interface |
BeforeAfterCallable.AllowCallToProceed
The interface containing the proceed() method,
which triggers BeforeAfterCaller
to proceed with calling call() . |
Method Summary | |
---|---|
void |
after(ValueT futureResult,
Throwable callThrowable)
Clean up after call() ,
whether or not it was successful. |
void |
before(BeforeAfterCallable.AllowCallToProceed allowCallToProceed)
Peform the setup required before call() can be called. |
ValueT |
call()
Computes a result, or throws an exception if unable to do so. |
Method Detail |
---|
void before(BeforeAfterCallable.AllowCallToProceed allowCallToProceed) throws Exception
call()
can be called.
before()
must either directly call
allowCallToProceed.proceed()
,
or it must call a method that blocks and
triggers the calling of proceed()
in another thread.
In the latter case, the blocking method must block
at least until proceed()
has been called;
typically the blocking method will
block until after()
does something to allow it to unblock.
It is the call to proceed()
that triggers
BeforeAfterCaller
to call call()
followed by after()
in the worker thread.
The call to proceed
should be the last thing
done by before()
allowCallToProceed
- the object
whose proceed()
method must be called.
Exception
ValueT call() throws Exception
Exception
- if unable to compute a resultvoid after(ValueT futureResult, Throwable callThrowable) throws Exception
call()
,
whether or not it was successful.
futureResult
- the result of the call()
method, if anycallThrowable
- the Throwable
thrown by call()
, if any
Exception
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |