Class UnlimitedPipelineExecutor<O>
java.lang.Object
java.util.concurrent.AbstractExecutorService
java.util.concurrent.ThreadPoolExecutor
de.aristaflow.adept2.util.threading.AFThreadPoolExecutor
de.aristaflow.adept2.util.threading.CachedThreadPoolExecutor
de.aristaflow.adept2.util.threading.executor.AbstractObjectSpecificExecutor<O,P,Queue<Runnable>>
de.aristaflow.adept2.util.threading.executor.AbstractPipeliningExecutor<O,O>
de.aristaflow.adept2.util.threading.executor.UnlimitedPipelineExecutor<O>
- Type Parameters:
O- The type of object for which work is registered and which identifies a pipeline.
- All Implemented Interfaces:
Executor,ExecutorService
A pipeline executor that has a separate pipeline for each registered object
and therefore also no upper limit concerning the amount of pipelines as well
as the amount of threads.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.concurrent.ThreadPoolExecutor
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy -
Field Summary
Fields inherited from class de.aristaflow.adept2.util.threading.executor.AbstractObjectSpecificExecutor
abortCount, flushPending, logger, objects, shutdownPendingFields inherited from class de.aristaflow.adept2.util.threading.CachedThreadPoolExecutor
fullSize, realCoreSize, realMaxSize, workSizeFields inherited from class de.aristaflow.adept2.util.threading.AFThreadPoolExecutor
activeThreads, completedTasks, HYSTERESIS, submittedTasks -
Constructor Summary
ConstructorsConstructorDescriptionUnlimitedPipelineExecutor(int maxPoolSize, Adept2ThreadFactory threadFactory) Creates a new thread pool executor with one pipeline per registered object and the designated maximum amount of threads.UnlimitedPipelineExecutor(Adept2ThreadFactory threadFactory) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionprotected OgetIndexObjectFor(O object) Gets the object used for managing and executing runnables within this executor.Methods inherited from class de.aristaflow.adept2.util.threading.executor.AbstractPipeliningExecutor
addRunnable, cancelAndFlush, clearAbortedPendingWork, createPipelineRunnable, executeShutdown, getOutstandingRunnablesMethods inherited from class de.aristaflow.adept2.util.threading.executor.AbstractObjectSpecificExecutor
execute, flushAndExecute, flushAndExecuteUnchecked, isShutdown, restart, restartPendingWork, shutdown, shutdownNow, shutdownRunnableRun, submit, submit, submitAndFlushMethods inherited from class de.aristaflow.adept2.util.threading.CachedThreadPoolExecutor
afterExecute, executeMethods inherited from class de.aristaflow.adept2.util.threading.AFThreadPoolExecutor
beforeExecute, logPoolStatistics, newTaskFor, newTaskFor, recalculateLogLimits, setCorePoolSize, setLogExecuteCallStack, setMaximumPoolSize, updateQueueLimitMethods inherited from class java.util.concurrent.ThreadPoolExecutor
allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, finalize, getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getQueue, getRejectedExecutionHandler, getTaskCount, getThreadFactory, isTerminated, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, remove, setKeepAliveTime, setRejectedExecutionHandler, setThreadFactory, terminated, toString
-
Constructor Details
-
UnlimitedPipelineExecutor
@Deprecated(since="14.4.0", forRemoval=true) public UnlimitedPipelineExecutor(Adept2ThreadFactory threadFactory) Deprecated, for removal: This API element is subject to removal in a future version.UseUnlimitedPipelineExecutor(int, Adept2ThreadFactory)instead.Creates a new thread pool executor with one pipeline per registered object and no limit for the threads. The threads will stay idle for 60 seconds before they terminate.- Parameters:
threadFactory- The factory to use when the executor creates a new thread.
-
UnlimitedPipelineExecutor
Creates a new thread pool executor with one pipeline per registered object and the designated maximum amount of threads. The threads will stay idle for 60 seconds before they terminate.- Parameters:
maxPoolSize- The maximum number of threads allowed in the pool. Set this to a sensible value (<Integer.MAX_VALUE).threadFactory- The factory to use when the executor creates a new thread.
-
-
Method Details
-
getIndexObjectFor
Description copied from class:AbstractObjectSpecificExecutorGets the object used for managing and executing runnables within this executor.- Specified by:
getIndexObjectForin classAbstractObjectSpecificExecutor<O,O, Queue<Runnable>> - Parameters:
object- The object for which a runnable is registered.- Returns:
- The object used for managing and executing runnables (registered for the designated object) within this executor.
-
UnlimitedPipelineExecutor(int, Adept2ThreadFactory)instead.