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.Demand
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final boolean
final int
Number 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 TypeMethodDescriptionlong
check
(EC2Computer c) protected Object
void
start
(EC2Computer c) Called when a newEC2Computer
object is introduced (such as when Hudson started, or when a new agent is added.)void
taskAccepted
(Executor executor, Queue.Task task) void
taskCompleted
(Executor executor, Queue.Task task, long durationMS) void
taskCompletedWithProblems
(Executor executor, Queue.Task task, long durationMS, Throwable problems) Methods inherited from class hudson.slaves.RetentionStrategy
all, isAcceptingTasks, isManualLaunchAllowed
Methods inherited from class hudson.model.AbstractDescribableImpl
getDescriptor
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
check
in classRetentionStrategy<EC2Computer>
-
start
Called when a newEC2Computer
object 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:
start
in classRetentionStrategy<EC2Computer>
-
readResolve
-
taskAccepted
- Specified by:
taskAccepted
in interfaceExecutorListener
-
taskCompleted
- Specified by:
taskCompleted
in interfaceExecutorListener
-
taskCompletedWithProblems
public void taskCompletedWithProblems(Executor executor, Queue.Task task, long durationMS, Throwable problems) - Specified by:
taskCompletedWithProblems
in interfaceExecutorListener
-