com.eurotech.framework.core.util
Class ExecutorUtil
java.lang.Object
java.util.concurrent.AbstractExecutorService
java.util.concurrent.ThreadPoolExecutor
java.util.concurrent.ScheduledThreadPoolExecutor
com.eurotech.framework.core.util.ExecutorUtil
- All Implemented Interfaces:
- Executor, ExecutorService, ScheduledExecutorService
public class ExecutorUtil
- extends ScheduledThreadPoolExecutor
ExecutorUtil should be used for any asynchronous threads to be kicked off by a bundle/service.
ExecutorUtil centralizes the number of threads running in the whole JVM instance by
controlling the Thread pool and queuing tasks if resources are not available.
TODO: use configuration service/file to parametrize this as sizing
may depend on the hardware configuration
Method Summary |
static ExecutorUtil |
getInstance()
Returns the ExecutorUtil instance that should be used
by all service/bundles when they need to kick off
background or asynchronous tasks. |
Methods inherited from class java.util.concurrent.ScheduledThreadPoolExecutor |
decorateTask, decorateTask, execute, getContinueExistingPeriodicTasksAfterShutdownPolicy, getExecuteExistingDelayedTasksAfterShutdownPolicy, getQueue, remove, schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay, setContinueExistingPeriodicTasksAfterShutdownPolicy, setExecuteExistingDelayedTasksAfterShutdownPolicy, 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, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize, setRejectedExecutionHandler, setThreadFactory, terminated |
getInstance
public static ExecutorUtil getInstance()
- Returns the ExecutorUtil instance that should be used
by all service/bundles when they need to kick off
background or asynchronous tasks.
- Returns:
- ExecutorUtil
Copyright © 2013. All Rights Reserved.