public abstract class CallableDecorator extends Object
Callable.call()
to filter the execution.Channel#addLocalExecutionInterceptor(CallableDecorator)
Constructor and Description |
---|
CallableDecorator() |
Modifier and Type | Method and Description |
---|---|
<V> V |
call(Callable<V> callable)
Used to decorate everything that executes in the channel as a result of a request from the other side,
such as RPC executions on exported objects, user-provided
Callable execution, pipe write, and so on. |
<V,T extends Throwable> |
userRequest(Callable<V,T> op,
Callable<V,T> stem)
Used to specifically decorate user-provided
Callable execution. |
public <V> V call(Callable<V> callable) throws Exception
Callable
execution, pipe write, and so on.Exception
public <V,T extends Throwable> Callable<V,T> userRequest(Callable<V,T> op, Callable<V,T> stem)
Callable
execution.
Unlike call(java.util.concurrent.Callable)
, this method provides an opportunity
to inspect the actual Callable
object given to Channel#call(Callable)
from the other side, whereas call(java.util.concurrent.Callable)
only
provides an opaque blob that itself may wrap the actual user-given operations.op
- The original callable object given to Channel#call(Callable)
.stem
- Computation that represents the invocation of op
as well as any additional decoration done by other
CallableDecorator
s.Callable
that represents the decorated computation,
which normally executes some pre-processing, then delegates to the stem
, then performs some cleanup.
If there's nothing to filter, return stem
.RuntimeException
- Any exception thrown from this method will be propagated to the other side as if the execution of
the callable had failed with this exception.Copyright © 2016. All rights reserved.