Package org.cip4.jdflib.util.thread
Class MultiJobTaskQueue
- java.lang.Object
-
- java.lang.Thread
-
- org.cip4.jdflib.util.thread.OrderedTaskQueue
-
- org.cip4.jdflib.util.thread.MultiTaskQueue
-
- org.cip4.jdflib.util.thread.MultiJobTaskQueue
-
- All Implemented Interfaces:
java.lang.Runnable
public class MultiJobTaskQueue extends MultiTaskQueue
class to run multiple tasks in parallel while ensuring that all tasks that belong to one job remain in order
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MultiJobTaskQueuegetCreateJobQueue(java.lang.String name, int maxParallel)grab the queuebooleanisUnique()booleanqueue(java.lang.Runnable task)ensure we don't accidentally queue non-runpairsbooleanqueue(java.lang.Runnable task, java.lang.Object mutex)voidsetUnique(boolean unique)java.lang.StringtoString()-
Methods inherited from class org.cip4.jdflib.util.thread.MultiTaskQueue
executing, getCreateQueue, getCurrentRunning, getMaxParallel, getPercentQueue, interruptCurrent, interruptTask, setMaxParallel, setPercentQueue, shutDown, start
-
Methods inherited from class org.cip4.jdflib.util.thread.OrderedTaskQueue
getAvQueue, getAvRun, getCreateQueue, getDone, getSumQueue, getSumRun, isLive, run, shortString, shutDown, shutDownAll, size, waiting
-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, stop, suspend, yield
-
-
-
-
Method Detail
-
isUnique
public boolean isUnique()
- Returns:
- the unique
-
setUnique
public void setUnique(boolean unique)
- Parameters:
unique- the unique to set
-
getCreateJobQueue
public static MultiJobTaskQueue getCreateJobQueue(java.lang.String name, int maxParallel)
grab the queue- Parameters:
name- - must not be nullmaxParallel- ignored if <=0- Returns:
- the queue to fill with tasks
-
queue
public boolean queue(java.lang.Runnable task, java.lang.Object mutex)- Parameters:
task-mutex- all tasks wit the same mutex will be run in sequence- Returns:
-
queue
public boolean queue(java.lang.Runnable task)
ensure we don't accidentally queue non-runpairs- Overrides:
queuein classOrderedTaskQueue- Parameters:
task- the thing to send off- Returns:
- true if successfully queued
- See Also:
OrderedTaskQueue.queue(java.lang.Runnable)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classMultiTaskQueue- See Also:
Object.toString()
-
-