Package hudson.slaves
Class CloudRetentionStrategy
- java.lang.Object
-
- hudson.model.AbstractDescribableImpl<RetentionStrategy<?>>
-
- hudson.slaves.RetentionStrategy<AbstractCloudComputer>
-
- hudson.slaves.CloudRetentionStrategy
-
- All Implemented Interfaces:
ExtensionPoint,Describable<RetentionStrategy<?>>
public class CloudRetentionStrategy extends RetentionStrategy<AbstractCloudComputer>
RetentionStrategyimplementation forAbstractCloudComputerthat terminates it if it remains idle for X minutes.- Since:
- 1.382
- Author:
- Kohsuke Kawaguchi
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class hudson.slaves.RetentionStrategy
RetentionStrategy.Always, RetentionStrategy.Demand
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
Fields Modifier and Type Field Description static booleandisabled-
Fields inherited from class hudson.slaves.RetentionStrategy
INSTANCE, LIST, NOOP
-
-
Constructor Summary
Constructors Constructor Description CloudRetentionStrategy(int idleMinutes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longcheck(AbstractCloudComputer c)This method will be called periodically to allow this strategy to decide what to do with its owning agent.voidstart(AbstractCloudComputer c)Try to connect to it ASAP.-
Methods inherited from class hudson.slaves.RetentionStrategy
all, isAcceptingTasks, isManualLaunchAllowed
-
Methods inherited from class hudson.model.AbstractDescribableImpl
getDescriptor
-
-
-
-
Method Detail
-
check
public long check(AbstractCloudComputer c)
Description copied from class:RetentionStrategyThis method will be called periodically to allow this strategy to decide what to do with its owning agent.- Specified by:
checkin classRetentionStrategy<AbstractCloudComputer>- Parameters:
c-Computerfor which this strategy is assigned. This computer may be online or offline. This object also exposes a bunch of properties that the callee can use to decide what action to take.- Returns:
- The number of minutes after which the strategy would like to be checked again. The strategy may be rechecked earlier or later than this!
-
start
public void start(AbstractCloudComputer c)
Try to connect to it ASAP.- Overrides:
startin classRetentionStrategy<AbstractCloudComputer>- Parameters:
c- Computer instance
-
-