Package org.eclipse.jetty.util.thread
Class ScheduledExecutorScheduler
- java.lang.Object
-
- org.eclipse.jetty.util.component.AbstractLifeCycle
-
- org.eclipse.jetty.util.thread.ScheduledExecutorScheduler
-
@ManagedObject @Deprecated(since="2021-05-27") public class ScheduledExecutorScheduler extends AbstractLifeCycle implements Scheduler, Dumpable
Deprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.Implementation ofScheduler
based on JDK'sScheduledThreadPoolExecutor
.While use of
ScheduledThreadPoolExecutor
creates futures that will not be used, it has the advantage of allowing to set a property to remove cancelled tasks from its queue even if the task did not fire, which provides a huge benefit in the performance of garbage collection in young generation.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainer
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.thread.Scheduler
Scheduler.Task
-
-
Constructor Summary
Constructors Constructor Description ScheduledExecutorScheduler()
Deprecated.ScheduledExecutorScheduler(java.lang.String name, boolean daemon)
Deprecated.ScheduledExecutorScheduler(java.lang.String name, boolean daemon, int threads)
Deprecated.ScheduledExecutorScheduler(java.lang.String name, boolean daemon, java.lang.ClassLoader classLoader)
Deprecated.ScheduledExecutorScheduler(java.lang.String name, boolean daemon, java.lang.ClassLoader classLoader, java.lang.ThreadGroup threadGroup)
Deprecated.ScheduledExecutorScheduler(java.lang.String name, boolean daemon, java.lang.ClassLoader classLoader, java.lang.ThreadGroup threadGroup, int threads)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.String
dump()
Deprecated.void
dump(java.lang.Appendable out, java.lang.String indent)
Deprecated.Dump this object (and children) into an Appendable using the provided indent after any new lines.java.lang.String
getName()
Deprecated.int
getThreads()
Deprecated.boolean
isDaemon()
Deprecated.Scheduler.Task
schedule(java.lang.Runnable task, long delay, java.util.concurrent.TimeUnit unit)
Deprecated.-
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, setStopTimeout, start, stop, toString
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.jetty.util.component.LifeCycle
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
-
-
-
-
Constructor Detail
-
ScheduledExecutorScheduler
public ScheduledExecutorScheduler()
Deprecated.
-
ScheduledExecutorScheduler
public ScheduledExecutorScheduler(java.lang.String name, boolean daemon)
Deprecated.
-
ScheduledExecutorScheduler
public ScheduledExecutorScheduler(@Name("name") java.lang.String name, @Name("daemon") boolean daemon, @Name("threads") int threads)
Deprecated.
-
ScheduledExecutorScheduler
public ScheduledExecutorScheduler(java.lang.String name, boolean daemon, java.lang.ClassLoader classLoader)
Deprecated.
-
ScheduledExecutorScheduler
public ScheduledExecutorScheduler(java.lang.String name, boolean daemon, java.lang.ClassLoader classLoader, java.lang.ThreadGroup threadGroup)
Deprecated.
-
ScheduledExecutorScheduler
public ScheduledExecutorScheduler(@Name("name") java.lang.String name, @Name("daemon") boolean daemon, @Name("classLoader") java.lang.ClassLoader classLoader, @Name("threadGroup") java.lang.ThreadGroup threadGroup, @Name("threads") int threads)
Deprecated.- Parameters:
name
- The name of the scheduler threads or null for automatic namedaemon
- True if scheduler threads should be daemonclassLoader
- The classloader to run the threads with or null to use the current thread context classloaderthreadGroup
- The threadgroup to use or null for no thread groupthreads
- The number of threads to pass to the the coreScheduledThreadPoolExecutor
or -1 for a heuristic determined number of threads.
-
-
Method Detail
-
schedule
public Scheduler.Task schedule(java.lang.Runnable task, long delay, java.util.concurrent.TimeUnit unit)
Deprecated.
-
dump
public void dump(java.lang.Appendable out, java.lang.String indent) throws java.io.IOException
Deprecated.Description copied from interface:Dumpable
Dump this object (and children) into an Appendable using the provided indent after any new lines. The indent should not be applied to the first object dumped.
-
getName
@ManagedAttribute("The name of the scheduler") public java.lang.String getName()
Deprecated.
-
isDaemon
@ManagedAttribute("Whether the scheduler uses daemon threads") public boolean isDaemon()
Deprecated.
-
getThreads
@ManagedAttribute("The number of scheduler threads") public int getThreads()
Deprecated.
-
-