Package net.anwiba.commons.thread.queue
Class WorkQueue
- java.lang.Object
-
- net.anwiba.commons.thread.queue.WorkQueue
-
- All Implemented Interfaces:
IWorkQueue
public class WorkQueue extends java.lang.Object implements IWorkQueue
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classWorkQueue.ExecutionHandlerstatic classWorkQueue.ProcessScheduledFuture<V>static classWorkQueue.QueueState
-
Constructor Summary
Constructors Constructor Description WorkQueue(java.util.concurrent.ScheduledThreadPoolExecutor executor)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancel(IProcessIdentfier identifier)static IWorkQueuecreate(ILogger logger, java.lang.String queueName, int threadCount, boolean asDaemon, int priority)IProcessIdentfierexecute(IRunnable runnable)voidremove(IProcessIdentfier identifier)voidshutdown()voidwaitForWorkQueueFinished(long timeout)
-
-
-
Method Detail
-
create
public static IWorkQueue create(ILogger logger, java.lang.String queueName, int threadCount, boolean asDaemon, int priority)
-
execute
public IProcessIdentfier execute(IRunnable runnable) throws java.lang.IllegalStateException
- Specified by:
executein interfaceIWorkQueue- Throws:
java.lang.IllegalStateException
-
shutdown
public void shutdown()
- Specified by:
shutdownin interfaceIWorkQueue
-
waitForWorkQueueFinished
public void waitForWorkQueueFinished(long timeout)
- Specified by:
waitForWorkQueueFinishedin interfaceIWorkQueue
-
remove
public void remove(IProcessIdentfier identifier)
- Specified by:
removein interfaceIWorkQueue
-
cancel
public void cancel(IProcessIdentfier identifier)
- Specified by:
cancelin interfaceIWorkQueue
-
-