Class Scheduler


  • public class Scheduler
    extends Object
    This interface represents only the adding part a scheduler.
    Author:
    Maksim Tkachenko, Ween Jiann Lee
    • Constructor Detail

      • Scheduler

        public Scheduler​(BlockingQueue<Job> queue)
        Constructs an instance of Scheduler.
        Parameters:
        queue - an instance of BlockingQueue
    • Method Detail

      • add

        public final void add​(@NotNull
                              @NotNull Request request,
                              Handler handler,
                              @NotNull
                              @NotNull JobAttribute... jobAttributes)
        Adds a request to the queue.

        This request would be parsed by the handler specified.

        Parameters:
        request - request to fetch when dequeued.
        handler - handler to be used to parse the request.
        jobAttributes - attributes to insert to the job.
      • add

        public final void add​(@NotNull
                              @NotNull Request request,
                              @NotNull
                              @NotNull JobAttribute... jobAttributes)
        Adds a request to the queue.

        This request would be parsed by the handler specified.

        Parameters:
        request - request to fetch when dequeued.
        jobAttributes - attributes to insert to the job.
      • add

        public final void add​(Request request,
                              @NotNull
                              @NotNull Handler handler)
        Adds a request to the queue.

        This request would be parsed by the handler specified.

        Parameters:
        request - request to fetch when dequeued.
        handler - handler to be used to parse the request.
      • add

        public final void add​(@NotNull
                              @NotNull Request request)
        Adds a request to the queue.

        This request would be parsed by a handler defined in Router or otherwise defined.

        Parameters:
        request - request to fetch when dequeued.
      • add

        @Deprecated
        public final void add​(@NotNull
                              @NotNull Request r,
                              Handler h,
                              Priority p,
                              Priority pf)
        Deprecated.
        Adds a request to the queue. Will be removed in the next release.

        This request would be parsed by the handler specified, and its priority can be downgraded to a minimum priority specified.

        Parameters:
        r - request to fetch when dequeued
        h - handler to be used to parse the request
        p - initial priority of the request
        pf - the minimum (floor) priority of this request
      • add

        @Deprecated
        public final void add​(@NotNull
                              @NotNull Request r,
                              Handler h,
                              Priority p)
        Deprecated.
        Adds a request to the queue. Will be removed in the next release.

        This request would be parsed by the handler specified, and its priority can be downgraded to the default minimum priority.

        Parameters:
        r - request to fetch when dequeued
        h - handler to be used to parse the request
        p - initial priority of the request
      • add

        @Deprecated
        public final void add​(@NotNull
                              @NotNull Request r,
                              Priority p,
                              Priority pf)
        Deprecated.
        Adds a request to the queue. Will be removed in the next release.

        This request would be parsed by a handler defined in Router or otherwise, and its priority can be downgraded to a minimum priority specified.

        Parameters:
        r - request to fetch when dequeued
        p - initial priority of the request
        pf - the minimum (floor) priority of this request
      • add

        @Deprecated
        public final void add​(@NotNull
                              @NotNull Request r,
                              Priority p)
        Deprecated.
        Adds a request to the queue. Will be removed in the next release.

        This request would be parsed by a handler defined in Router or otherwise defined, and its priority can be downgraded to the default minimum priority.

        Parameters:
        r - request to fetch when dequeued
        p - initial priority of the request