Class ComputerLauncherFilter
- java.lang.Object
-
- hudson.model.AbstractDescribableImpl<ComputerLauncher>
-
- hudson.slaves.ComputerLauncher
-
- hudson.slaves.ComputerLauncherFilter
-
- All Implemented Interfaces:
ExtensionPoint,Describable<ComputerLauncher>
public abstract class ComputerLauncherFilter extends ComputerLauncher
ComputerLauncherfilter that can be used as a base class for decorators.Using this class also protects you from method additions in
ComputerLauncher, since these two classes are updated in sync.- Author:
- Kohsuke Kawaguchi
- See Also:
SlaveComputer.grabLauncher(Node)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
Fields Modifier and Type Field Description protected ComputerLaunchercore-
Fields inherited from class hudson.slaves.ComputerLauncher
LIST
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedComputerLauncherFilter(ComputerLauncher core)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterDisconnect(SlaveComputer computer, TaskListener listener)Allows theComputerLauncherto tidy-up after a disconnect.voidbeforeDisconnect(SlaveComputer computer, TaskListener listener)Allows theComputerLauncherto prepare for a disconnect.ComputerLaunchergetCore()Returns the delegation target.Descriptor<ComputerLauncher>getDescriptor()By default looks for a nested class (conventionally namedDescriptorImpl) implementingDescriptorand marked withExtension.booleanisLaunchSupported()Returns true if thisComputerLaunchersupports programmatic launch of the agent in the targetComputer.voidlaunch(SlaveComputer computer, TaskListener listener)Launches the agent for the givenComputer.-
Methods inherited from class hudson.slaves.ComputerLauncher
afterDisconnect, beforeDisconnect, checkJavaVersion, launch
-
-
-
-
Field Detail
-
core
protected volatile ComputerLauncher core
-
-
Constructor Detail
-
ComputerLauncherFilter
protected ComputerLauncherFilter(ComputerLauncher core)
-
-
Method Detail
-
getCore
public ComputerLauncher getCore()
Returns the delegation target.
-
isLaunchSupported
public boolean isLaunchSupported()
Description copied from class:ComputerLauncherReturns true if thisComputerLaunchersupports programmatic launch of the agent in the targetComputer.- Overrides:
isLaunchSupportedin classComputerLauncher
-
launch
public void launch(SlaveComputer computer, TaskListener listener) throws IOException, InterruptedException
Description copied from class:ComputerLauncherLaunches the agent for the givenComputer.If the agent is launched successfully,
SlaveComputer.setChannel(InputStream, OutputStream, TaskListener, Channel.Listener)should be invoked in the end to notify Hudson of the established connection. The operation could also fail, in which case there's no need to make any callback notification, (except to notify the user of the failure throughStreamTaskListener.) Also note that the normal return of this method call does not necessarily signify a successful launch. If someone programmatically calls this method and wants to find out if the launch was a success, useComputer.isOnline()at the end.This method must operate synchronously. Asynchrony is provided by
Computer.connect(boolean)and its correct operation depends on this.- Overrides:
launchin classComputerLauncherlistener- The progress of the launch, as well as any error, should be sent to this listener.- Throws:
IOException- if the method throws anIOExceptionorInterruptedException, the launch was considered a failure and the stack trace is reported into the listener. This handling is just so that the implementation of this method doesn't have to diligently catch those exceptions.InterruptedException
-
afterDisconnect
public void afterDisconnect(SlaveComputer computer, TaskListener listener)
Description copied from class:ComputerLauncherAllows theComputerLauncherto tidy-up after a disconnect.This method is invoked after the
Channelto this computer is terminated.Disconnect operation is performed asynchronously, so there's no guarantee that the corresponding
SlaveComputerexists for the duration of the operation.- Overrides:
afterDisconnectin classComputerLauncher
-
beforeDisconnect
public void beforeDisconnect(SlaveComputer computer, TaskListener listener)
Description copied from class:ComputerLauncherAllows theComputerLauncherto prepare for a disconnect.This method is invoked before the
Channelto this computer is terminated, thus the channel is still accessible fromSlaveComputer.getChannel(). If the channel is terminated unexpectedly, this method will not be invoked, as the channel is already gone.Disconnect operation is performed asynchronously, so there's no guarantee that the corresponding
SlaveComputerexists for the duration of the operation.- Overrides:
beforeDisconnectin classComputerLauncher
-
getDescriptor
public Descriptor<ComputerLauncher> getDescriptor()
Description copied from class:AbstractDescribableImplBy default looks for a nested class (conventionally namedDescriptorImpl) implementingDescriptorand marked withExtension.Gets the descriptor for this instance.
Descriptoris a singleton for every concreteDescribableimplementation, so ifa.getClass() == b.getClass()then by defaulta.getDescriptor() == b.getDescriptor()as well. (In rare cases a single implementation class may be used for instances with distinct descriptors.)- Specified by:
getDescriptorin interfaceDescribable<ComputerLauncher>- Overrides:
getDescriptorin classAbstractDescribableImpl<ComputerLauncher>
-
-