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 Detail

      • call

        V call()
        throws T extends Throwable
        Performs computation and returns the result, or throws some exception.
        Throws:
        T extends Throwable
      • 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