org.ehcache.impl.internal.executor
Class OnDemandExecutionService

java.lang.Object
  extended by org.ehcache.impl.internal.executor.OnDemandExecutionService
All Implemented Interfaces:
ExecutionService, Service

public class OnDemandExecutionService
extends java.lang.Object
implements ExecutionService


Constructor Summary
OnDemandExecutionService()
           
 
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.
 void start(ServiceProvider serviceProvider)
          Start this service using the provided configuration and ServiceProvider.
 void stop()
          Stops this service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OnDemandExecutionService

public OnDemandExecutionService()
Method Detail

getScheduledExecutor

public java.util.concurrent.ScheduledExecutorService getScheduledExecutor(java.lang.String poolAlias)
Description copied from interface: ExecutionService
Get a pre-configured ScheduledExecutorService instance.

Specified by:
getScheduledExecutor in interface ExecutionService
Parameters:
poolAlias - the requested pool alias.
Returns:
the ScheduledExecutorService instance.

getOrderedExecutor

public java.util.concurrent.ExecutorService getOrderedExecutor(java.lang.String poolAlias,
                                                               java.util.concurrent.BlockingQueue<java.lang.Runnable> queue)
Description copied from interface: ExecutionService
Get a pre-configured ExecutorService instance that guarantees execution in submission order.

Specified by:
getOrderedExecutor in interface ExecutionService
Parameters:
poolAlias - the requested pool alias.
queue - the queue in which pending tasks are to be queued.
Returns:
the ExecutorService instance.

getUnorderedExecutor

public java.util.concurrent.ExecutorService getUnorderedExecutor(java.lang.String poolAlias,
                                                                 java.util.concurrent.BlockingQueue<java.lang.Runnable> queue)
Description copied from interface: ExecutionService
Get a pre-configured ExecutorService instance.

Specified by:
getUnorderedExecutor in interface ExecutionService
Parameters:
poolAlias - the requested pool alias.
queue - the queue in which pending tasks are to be queued.
Returns:
the ExecutorService instance.

start

public void start(ServiceProvider serviceProvider)
Description copied from interface: Service
Start this service using the provided configuration and ServiceProvider.

The goal of the service provider is to allow a service to use other services.

Specified by:
start in interface Service
Parameters:
serviceProvider - the service provider.

stop

public void stop()
Description copied from interface: Service
Stops this service.

Specified by:
stop in interface Service