Package hudson.plugins.ec2
Class EC2RetentionStrategy
- java.lang.Object
-
- hudson.model.AbstractDescribableImpl<RetentionStrategy<?>>
-
- hudson.slaves.RetentionStrategy<EC2Computer>
-
- hudson.plugins.ec2.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 Classes Modifier and Type Class Description static class
EC2RetentionStrategy.DescriptorImpl
-
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 boolean
DISABLED
int
idleTerminationMinutes
Number of minutes of idleness before an instance should be terminated.-
Fields inherited from class hudson.slaves.RetentionStrategy
INSTANCE, LIST, NOOP
-
-
Constructor Summary
Constructors Constructor Description EC2RetentionStrategy(String idleTerminationMinutes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
check(EC2Computer c)
protected Object
readResolve()
void
start(EC2Computer c)
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 runningvoid
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 Detail
-
DISABLED
public static final boolean DISABLED
-
idleTerminationMinutes
public final int idleTerminationMinutes
Number 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 Detail
-
EC2RetentionStrategy
@DataBoundConstructor public EC2RetentionStrategy(String idleTerminationMinutes)
-
-
Method Detail
-
check
public long check(EC2Computer c)
- Specified by:
check
in classRetentionStrategy<EC2Computer>
-
start
public void start(EC2Computer c)
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
protected Object readResolve()
-
taskAccepted
public void taskAccepted(Executor executor, Queue.Task task)
- Specified by:
taskAccepted
in interfaceExecutorListener
-
taskCompleted
public void taskCompleted(Executor executor, Queue.Task task, long durationMS)
- Specified by:
taskCompleted
in interfaceExecutorListener
-
taskCompletedWithProblems
public void taskCompletedWithProblems(Executor executor, Queue.Task task, long durationMS, Throwable problems)
- Specified by:
taskCompletedWithProblems
in interfaceExecutorListener
-
-