Package jenkins.slaves.restarter
Class JnlpSlaveRestarterInstaller
java.lang.Object
hudson.slaves.ComputerListener
jenkins.slaves.restarter.JnlpSlaveRestarterInstaller
- All Implemented Interfaces:
ExtensionPoint
,Serializable
@Extension
public class JnlpSlaveRestarterInstaller
extends ComputerListener
implements Serializable
Actual agent restart logic.
Use ComputerListener
to install EngineListener
on Computer
instances tied to DumbSlave
,
which in turn gets executed when the agent gets disconnected.
- Author:
- Kohsuke Kawaguchi
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
onOnline
(Computer c, TaskListener listener) Called right after aComputer
comes online.Methods inherited from class hudson.slaves.ComputerListener
all, onConfigurationChange, onIdle, onLaunchFailure, onOffline, onOffline, onOnline, onTemporarilyOffline, onTemporarilyOnline, preLaunch, preOnline, register, unregister
-
Constructor Details
-
JnlpSlaveRestarterInstaller
public JnlpSlaveRestarterInstaller()
-
-
Method Details
-
onOnline
Description copied from class:ComputerListener
Called right after aComputer
comes online.This enables you to do some work on all the agents as they get connected. Any thrown
Exception
s will be recorded to the listener. NoException
will put the computer offline, however anyError
will put the computer offline since they indicate unrecoverable conditions.Starting Hudson 1.312, this method is also invoked for the master, not just for agents.
- Overrides:
onOnline
in classComputerListener
listener
- This is connected to the launch log of the computer or Jenkins master. Since this method is called synchronously from the thread that launches a computer, if this method performs a time-consuming operation, this listener should be notified of the progress. This is also a good listener for reporting problems.- Throws:
IOException
- Exceptions will be recorded to the listener. Note that throwing an exception doesn't put the computer offline.InterruptedException
- Exceptions will be recorded to the listener. Note that throwing an exception doesn't put the computer offline.- See Also:
-