Class ScheduledPinnedThreadPoolExecutor
- java.lang.Object
-
- java.util.concurrent.AbstractExecutorService
-
- java.util.concurrent.ThreadPoolExecutor
-
- java.util.concurrent.ScheduledThreadPoolExecutor
-
- org.sheinbergon.needle.concurrent.ScheduledPinnedThreadPoolExecutor
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,java.util.concurrent.Executor,java.util.concurrent.ExecutorService,java.util.concurrent.ScheduledExecutorService
public final class ScheduledPinnedThreadPoolExecutor extends java.util.concurrent.ScheduledThreadPoolExecutor implements java.io.Closeable
-
-
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
-
-
Constructor Summary
Constructors Constructor Description ScheduledPinnedThreadPoolExecutor(int size, PinnedThreadFactory factory)Creates a newScheduledPinnedThreadPoolExecutorwith the given initial parameters.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()static java.util.concurrent.ScheduledExecutorServicenewScheduledPinnedThreadPool(int size, PinnedThreadFactory factory)Static factory methods for affinity aware fixed-sizeScheduledExecutorServiceinception.static java.util.concurrent.ScheduledExecutorServicenewSinglePinnedThreadScheduledExecutor(PinnedThreadFactory factory)Static factory methods for affinity aware single-threadScheduledExecutorServiceinception.-
Methods inherited from class java.util.concurrent.ScheduledThreadPoolExecutor
decorateTask, decorateTask, execute, getContinueExistingPeriodicTasksAfterShutdownPolicy, getExecuteExistingDelayedTasksAfterShutdownPolicy, getQueue, getRemoveOnCancelPolicy, schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay, setContinueExistingPeriodicTasksAfterShutdownPolicy, setExecuteExistingDelayedTasksAfterShutdownPolicy, setRemoveOnCancelPolicy, shutdown, shutdownNow, submit, submit, submit
-
Methods inherited from class java.util.concurrent.ThreadPoolExecutor
afterExecute, allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, beforeExecute, finalize, getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getRejectedExecutionHandler, getTaskCount, getThreadFactory, isShutdown, isTerminated, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, remove, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize, setRejectedExecutionHandler, setThreadFactory, terminated, toString
-
Methods inherited from class java.util.concurrent.AbstractExecutorService
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor
-
-
-
-
Constructor Detail
-
ScheduledPinnedThreadPoolExecutor
public ScheduledPinnedThreadPoolExecutor(int size, @Nonnull PinnedThreadFactory factory)Creates a newScheduledPinnedThreadPoolExecutorwith the given initial parameters.- Parameters:
size- the number ofPinnedThreadinstances to keep in the poolfactory- the factory to use when the executor creates a new thread
-
-
Method Detail
-
newSinglePinnedThreadScheduledExecutor
public static java.util.concurrent.ScheduledExecutorService newSinglePinnedThreadScheduledExecutor(@Nonnull PinnedThreadFactory factory)Static factory methods for affinity aware single-threadScheduledExecutorServiceinception.- Parameters:
factory- thePinnedThreadFactoryused create affinity awarePinnedThreadinstances- Returns:
- the affinity aware
ScheduledExecutorService
-
newScheduledPinnedThreadPool
public static java.util.concurrent.ScheduledExecutorService newScheduledPinnedThreadPool(int size, @Nonnull PinnedThreadFactory factory)Static factory methods for affinity aware fixed-sizeScheduledExecutorServiceinception.- Parameters:
size- number ofPinnedThreadinstances to maintain in the poolfactory- thePinnedThreadFactoryused create affinity awarePinnedThreadinstances- Returns:
- the affinity aware
ScheduledExecutorService
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable
-
-