Apache CXF API

org.apache.cxf.workqueue
Class AutomaticWorkQueueImpl

java.lang.Object
  extended by java.util.concurrent.AbstractExecutorService
      extended by java.util.concurrent.ThreadPoolExecutor
          extended by org.apache.cxf.workqueue.AutomaticWorkQueueImpl
All Implemented Interfaces:
java.util.concurrent.Executor, java.util.concurrent.ExecutorService, AutomaticWorkQueue, WorkQueue

public class AutomaticWorkQueueImpl
extends java.util.concurrent.ThreadPoolExecutor
implements AutomaticWorkQueue


Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.concurrent.ThreadPoolExecutor
java.util.concurrent.ThreadPoolExecutor.AbortPolicy, java.util.concurrent.ThreadPoolExecutor.CallerRunsPolicy, java.util.concurrent.ThreadPoolExecutor.DiscardOldestPolicy, java.util.concurrent.ThreadPoolExecutor.DiscardPolicy
 
Method Summary
 void execute(java.lang.Runnable work, long timeout)
          Submits a work item for execution at some time in the future, waiting for up to a specified amount of time for the item to be accepted.
 long getSize()
          Gets the current size of the backing queue.
 boolean isEmpty()
           
 void schedule(java.lang.Runnable work, long delay)
          Schedules a work item for execution at some time in the future.
 void shutdown(boolean processRemainingWorkItems)
          Initiates an orderly shutdown.
 java.lang.String toString()
           
 
Methods inherited from class java.util.concurrent.ThreadPoolExecutor
afterExecute, awaitTermination, beforeExecute, execute, finalize, getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getQueue, getRejectedExecutionHandler, getTaskCount, getThreadFactory, isShutdown, isTerminated, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, remove, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize, setRejectedExecutionHandler, setThreadFactory, shutdown, shutdownNow, terminated
 
Methods inherited from class java.util.concurrent.AbstractExecutorService
invokeAll, invokeAll, invokeAny, invokeAny, submit, submit, submit
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.cxf.workqueue.AutomaticWorkQueue
isShutdown
 
Methods inherited from interface java.util.concurrent.Executor
execute
 

Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

execute

public void execute(java.lang.Runnable work,
                    long timeout)
Description copied from interface: WorkQueue
Submits a work item for execution at some time in the future, waiting for up to a specified amount of time for the item to be accepted.

Specified by:
execute in interface WorkQueue
Parameters:
work - the workitem to submit for execution.
timeout - the maximum amount of time (in milliseconds) to wait for it to be accepted.

schedule

public void schedule(java.lang.Runnable work,
                     long delay)
Description copied from interface: WorkQueue
Schedules a work item for execution at some time in the future.

Specified by:
schedule in interface WorkQueue
Parameters:
work - the task to submit for execution.
delay - the delay before the task is executed

shutdown

public void shutdown(boolean processRemainingWorkItems)
Description copied from interface: AutomaticWorkQueue
Initiates an orderly shutdown. If processRemainingWorkItems is true, waits for all active items to finish execution before returning, otherwise returns immediately after removing all non active items from the queue.

Specified by:
shutdown in interface AutomaticWorkQueue

getSize

public long getSize()
Gets the current size of the backing queue.

Returns:
the current size of the backing queue.

isEmpty

public boolean isEmpty()

Apache CXF API

Apache CXF