org.ehcache.core.spi.service
Interface ExecutionService

All Superinterfaces:
Service
All Known Implementing Classes:
OnDemandExecutionService, PooledExecutionService

public interface ExecutionService
extends Service

Configuration of ExecutionService defines named pools of threads. Consumers reference a specific pool of threads from which their "executor" is derived.

Shutdown of these derived executors shuts down the derived executors but does nothing to the underlying thread pool.


Method Summary
 java.util.concurrent.ExecutorService getOrderedExecutor(java.lang.String poolAlias, java.util.concurrent.BlockingQueue<java.lang.Runnable> queue)
          Get a pre-configured ExecutorService instance that guarantees execution in submission order.
 java.util.concurrent.ScheduledExecutorService getScheduledExecutor(java.lang.String poolAlias)
          Get a pre-configured ScheduledExecutorService instance.
 java.util.concurrent.ExecutorService getUnorderedExecutor(java.lang.String poolAlias, java.util.concurrent.BlockingQueue<java.lang.Runnable> queue)
          Get a pre-configured ExecutorService instance.
 
Methods inherited from interface org.ehcache.spi.service.Service
start, stop
 

Method Detail

getScheduledExecutor

java.util.concurrent.ScheduledExecutorService getScheduledExecutor(java.lang.String poolAlias)
                                                                   throws java.lang.IllegalArgumentException
Get a pre-configured ScheduledExecutorService instance.

Parameters:
poolAlias - the requested pool alias.
Returns:
the ScheduledExecutorService instance.
Throws:
java.lang.IllegalArgumentException - if the requested pool alias does not exist.

getOrderedExecutor

java.util.concurrent.ExecutorService getOrderedExecutor(java.lang.String poolAlias,
                                                        java.util.concurrent.BlockingQueue<java.lang.Runnable> queue)
                                                        throws java.lang.IllegalArgumentException
Get a pre-configured ExecutorService instance that guarantees execution in submission order.

Parameters:
poolAlias - the requested pool alias.
queue - the queue in which pending tasks are to be queued.
Returns:
the ExecutorService instance.
Throws:
java.lang.IllegalArgumentException - if the requested pool alias does not exist.

getUnorderedExecutor

java.util.concurrent.ExecutorService getUnorderedExecutor(java.lang.String poolAlias,
                                                          java.util.concurrent.BlockingQueue<java.lang.Runnable> queue)
                                                          throws java.lang.IllegalArgumentException
Get a pre-configured ExecutorService instance.

Parameters:
poolAlias - the requested pool alias.
queue - the queue in which pending tasks are to be queued.
Returns:
the ExecutorService instance.
Throws:
java.lang.IllegalArgumentException - if the requested pool alias does not exist.