类 AbstractProcedureScheduler

    • 方法概要

      所有方法 实例方法 抽象方法 具体方法 
      修饰符和类型 方法 说明
      void addBack​(Procedure procedure)
      Inserts the specified element at the end of this queue.
      void addBack​(Procedure procedure, boolean notify)
      Inserts the specified element at the end of this queue.
      void addFront​(Procedure procedure)
      Inserts the specified element at the front of this queue.
      void addFront​(Procedure procedure, boolean notify)
      Inserts the specified element at the front of this queue.
      protected abstract Procedure dequeue()
      Fetch one Procedure from the queue NOTE: this method is called with the sched lock held.
      protected abstract void enqueue​(Procedure procedure, boolean addFront)
      Add the procedure to the queue.
      boolean hasRunnables()  
      Procedure poll()
      Fetch one Procedure from the queue
      Procedure poll​(long nanos)  
      Procedure poll​(long timeout, java.util.concurrent.TimeUnit unit)
      Fetch one Procedure from the queue
      protected void push​(Procedure procedure, boolean addFront, boolean notify)  
      protected abstract boolean queueHasRunnables()
      Returns true if there are procedures available to process.
      protected abstract int queueSize()
      Returns the number of elements in this queue.
      protected void schedLock()  
      protected void schedUnlock()  
      void signalAll()
      In case the class is blocking on poll() waiting for items to be added, this method should awake poll() and poll() should return.
      int size()
      Returns the number of elements in this queue.
      void start()
      Start the scheduler
      void stop()
      Stop the scheduler
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 构造器详细资料

      • AbstractProcedureScheduler

        public AbstractProcedureScheduler()
    • 方法详细资料

      • signalAll

        public void signalAll()
        从接口复制的说明: ProcedureScheduler
        In case the class is blocking on poll() waiting for items to be added, this method should awake poll() and poll() should return.
        指定者:
        signalAll 在接口中 ProcedureScheduler
      • enqueue

        protected abstract void enqueue​(Procedure procedure,
                                        boolean addFront)
        Add the procedure to the queue. NOTE: this method is called with the sched lock held.
        参数:
        procedure - the Procedure to add
        addFront - true if the item should be added to the front of the queue
      • addFront

        public void addFront​(Procedure procedure,
                             boolean notify)
        从接口复制的说明: ProcedureScheduler
        Inserts the specified element at the front of this queue.
        指定者:
        addFront 在接口中 ProcedureScheduler
        参数:
        procedure - the Procedure to add
        notify - whether need to notify worker
      • addBack

        public void addBack​(Procedure procedure,
                            boolean notify)
        从接口复制的说明: ProcedureScheduler
        Inserts the specified element at the end of this queue.
        指定者:
        addBack 在接口中 ProcedureScheduler
        参数:
        procedure - the Procedure to add
        notify - whether need to notify worker
      • push

        protected void push​(Procedure procedure,
                            boolean addFront,
                            boolean notify)
      • dequeue

        protected abstract Procedure dequeue()
        Fetch one Procedure from the queue NOTE: this method is called with the sched lock held.
        返回:
        the Procedure to execute, or null if nothing is available.
      • poll

        public Procedure poll​(long timeout,
                              java.util.concurrent.TimeUnit unit)
        从接口复制的说明: ProcedureScheduler
        Fetch one Procedure from the queue
        指定者:
        poll 在接口中 ProcedureScheduler
        参数:
        timeout - how long to wait before giving up, in units of unit
        unit - a TimeUnit determining how to interpret the timeout parameter
        返回:
        the Procedure to execute, or null if nothing present.
      • poll

        public Procedure poll​(long nanos)
      • queueSize

        protected abstract int queueSize()
        Returns the number of elements in this queue. NOTE: this method is called with the sched lock held.
        返回:
        the number of elements in this queue.
      • queueHasRunnables

        protected abstract boolean queueHasRunnables()
        Returns true if there are procedures available to process. NOTE: this method is called with the sched lock held.
        返回:
        true if there are procedures available to process, otherwise false.
      • size

        public int size()
        从接口复制的说明: ProcedureScheduler
        Returns the number of elements in this queue.
        指定者:
        size 在接口中 ProcedureScheduler
        返回:
        the number of elements in this queue.
      • hasRunnables

        public boolean hasRunnables()
        指定者:
        hasRunnables 在接口中 ProcedureScheduler
        返回:
        true if there are procedures available to process, otherwise false.
      • schedLock

        protected void schedLock()
      • schedUnlock

        protected void schedUnlock()