Top Description Inners Fields Constructors Methods
org.eclipse.jetty.util.thread

public Class TimerScheduler

extends AbstractLifeCycle
implements Scheduler, Runnable
Class Inheritance
All Implemented Interfaces
java.lang.Runnable, org.eclipse.jetty.util.thread.Scheduler, org.eclipse.jetty.util.component.LifeCycle
Imports
java.util.Timer, .TimerTask, java.util.concurrent.RejectedExecutionException, .TimeUnit, org.eclipse.jetty.util.component.AbstractLifeCycle, org.slf4j.Logger, .LoggerFactory

A scheduler based on the the JVM Timer class

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private final boolean
private final String
private Timer
private static final Logger
Inherited from org.eclipse.jetty.util.component.AbstractLifeCycle:
FAILEDSTARTEDSTARTINGSTOPPEDSTOPPING

Constructor Summary

AccessConstructor and Description
public
public
TimerScheduler(String name, boolean daemon)

Method Summary

Modifier and TypeMethod and Description
protected void
doStart()

Overrides org.eclipse.jetty.util.component.AbstractLifeCycle.doStart.

Method to override to start the lifecycle

protected void
doStop()

Overrides org.eclipse.jetty.util.component.AbstractLifeCycle.doStop.

Method to override to stop the lifecycle

public void
run()

Implements java.lang.Runnable.run.

Runs this operation.

public Scheduler.Task
schedule(final Runnable task, final long delay, final TimeUnit units)

Implements org.eclipse.jetty.util.thread.Scheduler.schedule.

Inherited from org.eclipse.jetty.util.component.AbstractLifeCycle:
addEventListenergetEventListenersgetStategetStateisFailedisRunningisStartedisStartingisStoppedisStoppingremoveEventListenersetEventListenersstartstoptoString

Field Detail

_daemonback to summary
private final boolean _daemon
_nameback to summary
private final String _name
_timerback to summary
private Timer _timer
LOGback to summary
private static final Logger LOG

Hides org.eclipse.jetty.util.component.AbstractLifeCycle.LOG.

Constructor Detail

TimerSchedulerback to summary
public TimerScheduler()
TimerSchedulerback to summary
public TimerScheduler(String name, boolean daemon)

Method Detail

doStartback to summary
protected void doStart() throws Exception

Overrides org.eclipse.jetty.util.component.AbstractLifeCycle.doStart.

Doc from org.eclipse.jetty.util.component.AbstractLifeCycle.doStart.

Method to override to start the lifecycle

Annotations
@Override
Exceptions
Exception:
If there was a problem starting. Will cause a transition to FAILED state
doStopback to summary
protected void doStop() throws Exception

Overrides org.eclipse.jetty.util.component.AbstractLifeCycle.doStop.

Doc from org.eclipse.jetty.util.component.AbstractLifeCycle.doStop.

Method to override to stop the lifecycle

Annotations
@Override
Exceptions
Exception:
If there was a problem stopping. Will cause a transition to FAILED state
runback to summary
public void run()

Implements java.lang.Runnable.run.

Doc from java.lang.Runnable.run.

Runs this operation.

Annotations
@Override
scheduleback to summary
public Scheduler.Task schedule(final Runnable task, final long delay, final TimeUnit units)

Implements org.eclipse.jetty.util.thread.Scheduler.schedule.

Annotations
@Override
org.eclipse.jetty.util.thread back to summary

private Class TimerScheduler.SimpleTask

extends TimerTask
implements Task
Class Inheritance
All Implemented Interfaces
org.eclipse.jetty.util.thread.Scheduler.Task

Field Summary

Modifier and TypeField and Description
private final Runnable

Constructor Summary

AccessConstructor and Description
private
SimpleTask(Runnable runnable)

Method Summary

Modifier and TypeMethod and Description
public void
run()

Implements abstract java.util.TimerTask.run.

Implements java.lang.Runnable.run.

The action to be performed by this timer task.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.util.TimerTask:
cancelscheduledExecutionTime

Field Detail

_taskback to summary
private final Runnable _task

Constructor Detail

SimpleTaskback to summary
private SimpleTask(Runnable runnable)

Method Detail

runback to summary
public void run()

Implements abstract java.util.TimerTask.run.

Implements java.lang.Runnable.run.

Doc from java.util.TimerTask.run.

The action to be performed by this timer task.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override