Package hudson
Class TcpSlaveAgentListener.TcpSlaveAgentListenerRescheduler
- java.lang.Object
-
- java.util.TimerTask
-
- hudson.triggers.SafeTimerTask
-
- hudson.model.AperiodicWork
-
- hudson.TcpSlaveAgentListener.TcpSlaveAgentListenerRescheduler
-
- All Implemented Interfaces:
ExtensionPoint
,Runnable
- Enclosing class:
- TcpSlaveAgentListener
@Extension @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static class TcpSlaveAgentListener.TcpSlaveAgentListenerRescheduler extends AperiodicWork
Reschedules theTcpSlaveAgentListener
on demand. Disables itself after running.
-
-
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.AperiodicWork
logger
-
-
Constructor Summary
Constructors Constructor Description TcpSlaveAgentListenerRescheduler()
TcpSlaveAgentListenerRescheduler(Thread originThread, Throwable cause)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doAperiodicRun()
AperiodicWork
getNewInstance()
Gets new instance of task to be executed.long
getRecurrencePeriod()
Gets the number of milliseconds between successive executions.static void
schedule(Thread originThread, Throwable cause)
static void
schedule(Thread originThread, Throwable cause, long approxDelay)
void
setActive(boolean active)
void
setCause(Throwable cause)
void
setOriginThread(Thread originThread)
-
Methods inherited from class hudson.model.AperiodicWork
all, doRun, getInitialDelay, init
-
Methods inherited from class hudson.triggers.SafeTimerTask
getLogsRoot, of, run
-
Methods inherited from class java.util.TimerTask
cancel, scheduledExecutionTime
-
-
-
-
Method Detail
-
setOriginThread
public void setOriginThread(Thread originThread)
-
setCause
public void setCause(Throwable cause)
-
setActive
public void setActive(boolean active)
-
getRecurrencePeriod
public long getRecurrencePeriod()
Description copied from class:AperiodicWork
Gets the number of milliseconds between successive executions.Jenkins calls this method every time the timer task is scheduled.
- Specified by:
getRecurrencePeriod
in classAperiodicWork
-
getNewInstance
public AperiodicWork getNewInstance()
Description copied from class:AperiodicWork
Gets new instance of task to be executed. Method should return new instance each time, as there no check, if previously scheduled task already finished. Returning same instance could lead to throwingIllegalStateException
(especially in case ofAsyncAperiodicWork
) and therefore scheduling of next tasks will be broken.- Specified by:
getNewInstance
in classAperiodicWork
- Returns:
- AperiodicWork - timer task instance to be executed
-
doAperiodicRun
protected void doAperiodicRun()
- Specified by:
doAperiodicRun
in classAperiodicWork
-
-