Package hudson.plugins.ec2
Class EC2RetentionStrategy
- All Implemented Interfaces:
ExtensionPoint,Describable<RetentionStrategy<?>>,ExecutorListener
public class EC2RetentionStrategy
extends RetentionStrategy<EC2Computer>
implements ExecutorListener
RetentionStrategy for EC2.- Author:
- Kohsuke Kawaguchi
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class hudson.slaves.RetentionStrategy
RetentionStrategy.Always, RetentionStrategy.DemandNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final booleanfinal intNumber of minutes of idleness before an instance should be terminated.Fields inherited from class hudson.slaves.RetentionStrategy
INSTANCE, LIST, NOOP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongcheck(EC2Computer c) protected Objectvoidstart(EC2Computer c) Called when a newEC2Computerobject is introduced (such as when Hudson started, or when a new agent is added.)voidtaskAccepted(Executor executor, Queue.Task task) voidtaskCompleted(Executor executor, Queue.Task task, long durationMS) voidtaskCompletedWithProblems(Executor executor, Queue.Task task, long durationMS, Throwable problems) Methods inherited from class hudson.slaves.RetentionStrategy
all, isAcceptingTasks, isManualLaunchAllowedMethods inherited from class hudson.model.AbstractDescribableImpl
getDescriptorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface hudson.model.ExecutorListener
taskStarted
-
Field Details
-
DISABLED
public static final boolean DISABLED -
idleTerminationMinutes
public final int idleTerminationMinutesNumber of minutes of idleness before an instance should be terminated. A value of zero indicates that the instance should never be automatically terminated. Negative values are times in remaining minutes before end of billing period.
-
-
Constructor Details
-
EC2RetentionStrategy
-
-
Method Details
-
check
- Specified by:
checkin classRetentionStrategy<EC2Computer>
-
start
Called when a newEC2Computerobject is introduced (such as when Hudson started, or when a new agent is added.)When Jenkins has just started, we don't want to spin up all the instances, so we only start if the EC2 instance is already running
- Overrides:
startin classRetentionStrategy<EC2Computer>
-
readResolve
-
taskAccepted
- Specified by:
taskAcceptedin interfaceExecutorListener
-
taskCompleted
- Specified by:
taskCompletedin interfaceExecutorListener
-
taskCompletedWithProblems
public void taskCompletedWithProblems(Executor executor, Queue.Task task, long durationMS, Throwable problems) - Specified by:
taskCompletedWithProblemsin interfaceExecutorListener
-