Package hudson.remoting
Interface Callable<V,T extends Throwable>
-
- All Superinterfaces:
RoleSensitive
,Serializable
- All Known Subinterfaces:
DelegatingCallable<V,T>
public interface Callable<V,T extends Throwable> extends Serializable, RoleSensitive
Represents computation to be done on a remote system.You probably don't want to implement this directly in Jenkins, instead choose
MasterToSlaveCallable
,NotReallyRoleSensitiveCallable
, or (in rare cases)SlaveToMasterCallable
.- Author:
- Kohsuke Kawaguchi
- See Also:
Channel
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description V
call()
Performs computation and returns the result, or throws some exception.default Channel
getChannelOrFail()
Gets a channel for the operation inside callable.default Channel
getOpenChannelOrFail()
Gets an open channel, which is ready to accept commands.-
Methods inherited from interface org.jenkinsci.remoting.RoleSensitive
checkRoles
-
-
-
-
Method Detail
-
call
V call() throws T extends Throwable
Performs computation and returns the result, or throws some exception.
-
getChannelOrFail
@NonNull default Channel getChannelOrFail() throws ChannelStateException
Gets a channel for the operation inside callable.- Returns:
- Channel Instance
- Throws:
ChannelStateException
- Channel is not associated with the thread- Since:
- 3.15
-
getOpenChannelOrFail
@NonNull default Channel getOpenChannelOrFail() throws ChannelStateException
Gets an open channel, which is ready to accept commands. It is a convenience method for cases, when a callable needs to invoke call backs on the controller. In such case the requests will be likely failed by UserRequest logic anyway, but it is better to fail fast.- Returns:
- Channel instance
- Throws:
ChannelStateException
- The channel is closing down or has been closed. Also happens if the channel is not associated with the thread at all.- Since:
- 3.15
-
-