Class DockerContainerWatchdog
- java.lang.Object
-
- java.util.TimerTask
-
- hudson.triggers.SafeTimerTask
-
- hudson.model.PeriodicWork
-
- hudson.model.AsyncPeriodicWork
-
- com.nirima.jenkins.plugins.docker.DockerContainerWatchdog
-
- All Implemented Interfaces:
ExtensionPoint
,Runnable
@Extension public class DockerContainerWatchdog extends AsyncPeriodicWork
Periodic job which gets executed by Jenkins automatically. Ensures the consistency of the containers currently running on the docker and the nodes which are attached to this Jenkins instance.- Author:
- eaglerainbow
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class hudson.triggers.SafeTimerTask
SafeTimerTask.ExceptionRunnable
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
-
Fields inherited from class hudson.model.AsyncPeriodicWork
name
-
Fields inherited from class hudson.model.PeriodicWork
DAY, HOUR, logger, MIN
-
-
Constructor Summary
Constructors Constructor Description DockerContainerWatchdog()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
execute(TaskListener listener)
protected List<DockerCloud>
getAllClouds()
protected List<Node>
getAllNodes()
protected String
getJenkinsInstanceId()
long
getRecurrencePeriod()
protected void
removeNode(DockerTransientNode dtn)
protected boolean
stopAndRemoveContainer(DockerAPI dockerApi, org.slf4j.Logger aLogger, String description, boolean removeVolumes, String containerId, boolean stop)
-
Methods inherited from class hudson.model.AsyncPeriodicWork
createListener, doRun, getErrorLoggingLevel, getLogFile, getNormalLoggingLevel, getSlowLoggingLevel
-
Methods inherited from class hudson.model.PeriodicWork
all, getInitialDelay, init
-
Methods inherited from class hudson.triggers.SafeTimerTask
getLogsRoot, of, run
-
Methods inherited from class java.util.TimerTask
cancel, scheduledExecutionTime
-
-
-
-
Method Detail
-
getRecurrencePeriod
public long getRecurrencePeriod()
- Specified by:
getRecurrencePeriod
in classPeriodicWork
-
getAllClouds
protected List<DockerCloud> getAllClouds()
-
getJenkinsInstanceId
protected String getJenkinsInstanceId()
-
removeNode
protected void removeNode(DockerTransientNode dtn) throws IOException
- Throws:
IOException
-
stopAndRemoveContainer
protected boolean stopAndRemoveContainer(DockerAPI dockerApi, org.slf4j.Logger aLogger, String description, boolean removeVolumes, String containerId, boolean stop)
-
execute
protected void execute(TaskListener listener) throws IOException, InterruptedException
- Specified by:
execute
in classAsyncPeriodicWork
- Throws:
IOException
InterruptedException
-
-