Class WorkQueueImpl

java.lang.Object
com.sun.corba.ee.impl.threadpool.WorkQueueImpl
All Implemented Interfaces:
WorkQueue

public class WorkQueueImpl extends Object implements WorkQueue
  • Field Details

    • WORKQUEUE_DEFAULT_NAME

      public static final String WORKQUEUE_DEFAULT_NAME
      See Also:
    • queue

      private final Queue<Work> queue
    • workerThreadPool

      private ThreadPool workerThreadPool
    • workItemsAdded

      private long workItemsAdded
    • workItemsDequeued

      private long workItemsDequeued
    • totalTimeInQueue

      private long totalTimeInQueue
    • name

      private final String name
  • Constructor Details

    • WorkQueueImpl

      public WorkQueueImpl()
    • WorkQueueImpl

      public WorkQueueImpl(ThreadPool workerThreadPool)
    • WorkQueueImpl

      public WorkQueueImpl(ThreadPool workerThreadPool, String name)
  • Method Details

    • getWorkQueueSize

      private int getWorkQueueSize()
    • addWork

      public void addWork(Work work)
      Description copied from interface: WorkQueue
      This method is used to add work to the WorkQueue
      Specified by:
      addWork in interface WorkQueue
    • requestWork

      Work requestWork(long waitTime) throws WorkerThreadNotNeededException, InterruptedException
      Throws:
      WorkerThreadNotNeededException
      InterruptedException
    • setThreadPool

      public void setThreadPool(ThreadPool workerThreadPool)
      Description copied from interface: WorkQueue
      Set the ThreadPool instance servicing this WorkQueue
      Specified by:
      setThreadPool in interface WorkQueue
    • getThreadPool

      public ThreadPool getThreadPool()
      Description copied from interface: WorkQueue
      Get the ThreadPool instance servicing this WorkQueue
      Specified by:
      getThreadPool in interface WorkQueue
    • totalWorkItemsAdded

      @ManagedAttribute @Description("Total number of items added to the queue") public long totalWorkItemsAdded()
      Returns the total number of Work items added to the Queue.
      Specified by:
      totalWorkItemsAdded in interface WorkQueue
    • workItemsInQueue

      @ManagedAttribute @Description("Total number of items in the queue to be processed") public int workItemsInQueue()
      Returns the total number of Work items in the Queue to be processed.
      Specified by:
      workItemsInQueue in interface WorkQueue
    • averageTimeInQueue

      @ManagedAttribute @Description("Average time work items spend waiting in the queue in milliseconds") public long averageTimeInQueue()
      Returns the average amount Work items have spent in the Queue waiting to be processed.
      Specified by:
      averageTimeInQueue in interface WorkQueue
    • getName

      @NameValue public String getName()
      Description copied from interface: WorkQueue
      This method will return the name of the WorkQueue.
      Specified by:
      getName in interface WorkQueue