Package com.sun.corba.ee.impl.threadpool
Class WorkQueueImpl
- java.lang.Object
-
- com.sun.corba.ee.impl.threadpool.WorkQueueImpl
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Stringnameprivate java.util.Queue<Work>queueprivate longtotalTimeInQueueprivate ThreadPoolworkerThreadPoolprivate longworkItemsAddedprivate longworkItemsDequeuedstatic java.lang.StringWORKQUEUE_DEFAULT_NAME
-
Constructor Summary
Constructors Constructor Description WorkQueueImpl()WorkQueueImpl(ThreadPool workerThreadPool)WorkQueueImpl(ThreadPool workerThreadPool, java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddWork(Work work)This method is used to add work to the WorkQueuelongaverageTimeInQueue()Returns the average amount Work items have spent in the Queue waiting to be processed.java.lang.StringgetName()This method will return the name of the WorkQueue.ThreadPoolgetThreadPool()Get the ThreadPool instance servicing this WorkQueueprivate intgetWorkQueueSize()(package private) WorkrequestWork(long waitTime)voidsetThreadPool(ThreadPool workerThreadPool)Set the ThreadPool instance servicing this WorkQueuelongtotalWorkItemsAdded()Returns the total number of Work items added to the Queue.intworkItemsInQueue()Returns the total number of Work items in the Queue to be processed.
-
-
-
Field Detail
-
WORKQUEUE_DEFAULT_NAME
public static final java.lang.String WORKQUEUE_DEFAULT_NAME
- See Also:
- Constant Field Values
-
queue
private final java.util.Queue<Work> queue
-
workerThreadPool
private ThreadPool workerThreadPool
-
workItemsAdded
private long workItemsAdded
-
workItemsDequeued
private long workItemsDequeued
-
totalTimeInQueue
private long totalTimeInQueue
-
name
private final java.lang.String name
-
-
Constructor Detail
-
WorkQueueImpl
public WorkQueueImpl()
-
WorkQueueImpl
public WorkQueueImpl(ThreadPool workerThreadPool)
-
WorkQueueImpl
public WorkQueueImpl(ThreadPool workerThreadPool, java.lang.String name)
-
-
Method Detail
-
getWorkQueueSize
private int getWorkQueueSize()
-
addWork
public void addWork(Work work)
Description copied from interface:WorkQueueThis method is used to add work to the WorkQueue
-
requestWork
Work requestWork(long waitTime) throws WorkerThreadNotNeededException, java.lang.InterruptedException
- Throws:
WorkerThreadNotNeededExceptionjava.lang.InterruptedException
-
setThreadPool
public void setThreadPool(ThreadPool workerThreadPool)
Description copied from interface:WorkQueueSet the ThreadPool instance servicing this WorkQueue- Specified by:
setThreadPoolin interfaceWorkQueue
-
getThreadPool
public ThreadPool getThreadPool()
Description copied from interface:WorkQueueGet the ThreadPool instance servicing this WorkQueue- Specified by:
getThreadPoolin interfaceWorkQueue
-
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:
totalWorkItemsAddedin interfaceWorkQueue
-
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:
workItemsInQueuein interfaceWorkQueue
-
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:
averageTimeInQueuein interfaceWorkQueue
-
-