org.compass.core.executor.concurrent
Class ScheduledExecutorManager
java.lang.Object
org.compass.core.executor.concurrent.ScheduledExecutorManager
- All Implemented Interfaces:
- CompassConfigurable, InternalExecutorManager
public class ScheduledExecutorManager
- extends Object
- implements InternalExecutorManager, CompassConfigurable
An executor manager based on ScheduledExecutorService.
Reads the CompassEnvironment.ExecutorManager.Scheduled.CORE_POOL_SIZE in order
to configure the inital thread count and uses the ScheduledExecutorService for all operations.
- Author:
- kimchy
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ScheduledExecutorManager
public ScheduledExecutorManager()
configure
public void configure(CompassSettings settings)
throws CompassException
- Description copied from interface:
CompassConfigurable
- Configure using the given settings.
- Specified by:
configure in interface CompassConfigurable
- Parameters:
settings - The settings for the configured object
- Throws:
CompassException
submit
public void submit(Runnable task)
- Specified by:
submit in interface InternalExecutorManager
- See Also:
ExecutorService.submit(Runnable)
submit
public <T> Future<T> submit(Callable<T> task)
- Specified by:
submit in interface InternalExecutorManager
- See Also:
ExecutorService.submit(java.util.concurrent.Callable)
invokeAll
public <T> List<Future<T>> invokeAll(Collection<Callable<T>> tasks)
throws InterruptedException
- Specified by:
invokeAll in interface InternalExecutorManager
- Throws:
InterruptedException- See Also:
ExecutorService.invokeAll(java.util.Collection)
schedule
public <V> ScheduledFuture<V> schedule(Callable<V> callable,
long delay,
TimeUnit unit)
- Specified by:
schedule in interface InternalExecutorManager
- See Also:
ScheduledExecutorService.schedule(java.util.concurrent.Callable, long, java.util.concurrent.TimeUnit)
scheduleAtFixedRate
public ScheduledFuture<?> scheduleAtFixedRate(Runnable command,
long initialDelay,
long period,
TimeUnit unit)
- Specified by:
scheduleAtFixedRate in interface InternalExecutorManager
- See Also:
ScheduledExecutorService.scheduleAtFixedRate(Runnable, long, long, java.util.concurrent.TimeUnit)
scheduleWithFixedDelay
public ScheduledFuture<?> scheduleWithFixedDelay(Runnable command,
long initialDelay,
long delay,
TimeUnit unit)
- Specified by:
scheduleWithFixedDelay in interface InternalExecutorManager
- See Also:
ScheduledExecutorService.scheduleWithFixedDelay(Runnable, long, long, java.util.concurrent.TimeUnit)
close
public void close()
- Description copied from interface:
InternalExecutorManager
- Shuts down this executor manager.
- Specified by:
close in interface InternalExecutorManager
Copyright (c) 2004-2008 The Compass Project.