Class ScheduledExecutorScheduler

  • All Implemented Interfaces:
    Dumpable, LifeCycle, Scheduler

    @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 of Scheduler based on JDK's ScheduledThreadPoolExecutor.

    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.

    • 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 name
        daemon - True if scheduler threads should be daemon
        classLoader - The classloader to run the threads with or null to use the current thread context classloader
        threadGroup - The threadgroup to use or null for no thread group
        threads - The number of threads to pass to the the core ScheduledThreadPoolExecutor 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.
        Specified by:
        schedule in interface Scheduler
      • dump

        public java.lang.String dump()
        Deprecated.
        Specified by:
        dump in interface Dumpable
      • 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.
        Specified by:
        dump in interface Dumpable
        Parameters:
        out - The appendable to dump to
        indent - The indent to apply after any new lines.
        Throws:
        java.io.IOException - if unable to write to Appendable
      • 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.