Package org.jenkinsci.remoting
Class CallableDecorator
java.lang.Object
org.jenkinsci.remoting.CallableDecorator
Decorator on
Callable.call()
to filter the execution.- Author:
- Kohsuke Kawaguchi
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<V> V
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-providedCallable
execution, pipe write, and so on.userRequest
(Callable<V, T> op, Callable<V, T> stem) Used to specifically decorate user-providedCallable
execution.
-
Constructor Details
-
CallableDecorator
public CallableDecorator()
-
-
Method Details
-
call
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-providedCallable
execution, pipe write, and so on.- Throws:
Exception
-
userRequest
Used to specifically decorate user-providedCallable
execution. Unlikecall(java.util.concurrent.Callable)
, this method provides an opportunity to inspect the actualCallable
object given toChannel.call(Callable)
from the other side, whereascall(java.util.concurrent.Callable)
only provides an opaque blob that itself may wrap the actual user-given operations.- Parameters:
op
- The original callable object given toChannel.call(Callable)
.stem
- Computation that represents the invocation ofop
as well as any additional decoration done by otherCallableDecorator
s.- Returns:
- Returns the a decorated
Callable
that represents the decorated computation, which normally executes some pre-processing, then delegates to thestem
, then performs some cleanup. If there's nothing to filter, returnstem
. - Throws:
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.
-