Package hudson.remoting
Class LocalChannel
java.lang.Object
hudson.remoting.LocalChannel
- All Implemented Interfaces:
VirtualChannel
VirtualChannel that performs computation on the local JVM.- Author:
- Kohsuke Kawaguchi
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<V,T extends Throwable>
VMakes a remote procedure call.Makes an asynchronous remote procedure call.voidclose()Performs an orderly shut down of this channel (and the remote peer.)<T> TExports an object for remoting to the otherChannelby creating a remotable proxy.voidjoin()Waits for thisChannelto be closed down.voidjoin(long timeout) Waits for thisChannelto be closed down, but only up the given milliseconds.voidBlocks until all the I/O packets sent from remote is fully locally executed, then return.
-
Constructor Details
-
LocalChannel
-
-
Method Details
-
call
Description copied from interface:VirtualChannelMakes a remote procedure call.Sends
Callableto the remote system, executes it, and returns its result. Such calls will be considered as user-space requests. If the channel cannot execute the requests (e.g. when it is being closed), the operations may be rejected even if the channel is still active.- Specified by:
callin interfaceVirtualChannel- Parameters:
callable- Callable to be executed- Throws:
T- User exception defined by the callable
-
callAsync
Description copied from interface:VirtualChannelMakes an asynchronous remote procedure call.Similar to
VirtualChannel.call(Callable)but returns immediately. The result of theCallablecan be obtained through theFutureobject. Such calls will be considered as user-space requests. If the channel cannot execute the requests (e.g. when it is being closed), the operations may be rejected even if the channel is still active.- Specified by:
callAsyncin interfaceVirtualChannel- Returns:
- The
Futureobject that can be used to wait for the completion.
-
close
public void close()Description copied from interface:VirtualChannelPerforms an orderly shut down of this channel (and the remote peer.)- Specified by:
closein interfaceVirtualChannel
-
join
Description copied from interface:VirtualChannelWaits for thisChannelto be closed down. The close-down of aChannelmight be initiated locally or remotely.- Specified by:
joinin interfaceVirtualChannel- Throws:
InterruptedException- If the current thread is interrupted while waiting for the completion.
-
join
Description copied from interface:VirtualChannelWaits for thisChannelto be closed down, but only up the given milliseconds.- Specified by:
joinin interfaceVirtualChannel- Parameters:
timeout- Timeout in milliseconds- Throws:
InterruptedException- If the current thread is interrupted while waiting for the completion.
-
export
Description copied from interface:VirtualChannelExports an object for remoting to the otherChannelby creating a remotable proxy. The returned reference must be kept if there is ongoing operation on the remote side. Once it is released, the exported object will be deallocated as well. Please keep in mind that the object may be also released earlier than expected by JVM (e.g. see JENKINS-23271).- Specified by:
exportin interfaceVirtualChannel- Type Parameters:
T- Type- Parameters:
intf- Interface to be remoted.instance- Instance to be exported.nullinstances won't be exported to the remote instance.All the parameters and return values must be serializable.
- Returns:
- the proxy object that implements
T. This object can be transferred to the otherChannel, and calling methods on it from the remote side will invoke the same method on the given localinstanceobject.nullif the input instance isnull.
-
syncLocalIO
Description copied from interface:VirtualChannelBlocks until all the I/O packets sent from remote is fully locally executed, then return.- Specified by:
syncLocalIOin interfaceVirtualChannel- Throws:
InterruptedException
-