Package jenkins.slaves.restarter
Class SlaveRestarter
- java.lang.Object
-
- jenkins.slaves.restarter.SlaveRestarter
-
- All Implemented Interfaces:
ExtensionPoint
,Serializable
- Direct Known Subclasses:
UnixSlaveRestarter
,WinswSlaveRestarter
public abstract class SlaveRestarter extends Object implements ExtensionPoint, Serializable
Extension point to control how to restart an inbound agent when it loses the connection with the master.Objects are instantiated on the master, then transferred to an agent via serialization.
- Author:
- Kohsuke Kawaguchi
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Constructor Description SlaveRestarter()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static ExtensionList<SlaveRestarter>
all()
abstract boolean
canWork()
Called on the agent to see if this restarter can work on this agent.abstract void
restart()
IfcanWork()
method returns true, this method is called later when the connection is lost to restart the agent.
-
-
-
Method Detail
-
canWork
public abstract boolean canWork()
Called on the agent to see if this restarter can work on this agent.
-
restart
public abstract void restart() throws Exception
IfcanWork()
method returns true, this method is called later when the connection is lost to restart the agent.Note that by the time this method is called, classloader is no longer capable of loading any additional classes. Therefore
canWork()
method must have exercised enough of the actual restart process so that this call can proceed without trying to load additional classes nor resources.This method is not expected to return, and the JVM should terminate before this call returns. If the method returns normally, the agent will move on to the reconnection without restart. If an exception is thrown, it is reported as an error and then the agent will move on to the reconnection without restart.
- Throws:
Exception
-
all
public static ExtensionList<SlaveRestarter> all()
-
-