public class AsyncExecutionService extends BasicService implements IExecutionService
EMPTY_SERVICES
Constructor and Description |
---|
AsyncExecutionService(IServiceProvider provider)
Create a new asynchronous executor service.
|
AsyncExecutionService(IServiceProvider provider,
Map<String,Object> properties)
Create a new asynchronous executor service.
|
Modifier and Type | Method and Description |
---|---|
IFuture<Void> |
cancel(IExecutable task)
Cancel a task.
|
boolean |
customIsValid()
Test if the service is valid.
|
void |
execute(IExecutable task)
Execute a task in its own thread.
|
IFuture<Void> |
getNextIdleFuture()
Get the future indicating that executor is idle.
|
IExecutable[] |
getTasks()
Get the currently running or waiting tasks.
|
IFuture<Void> |
shutdownService()
Shutdown the executor service.
// todo: make callable more than once
|
IFuture<Void> |
startService()
Start the execution service.
|
createServiceIdentifier, createServiceIdentifier, equals, generateServiceName, getPropertyMap, getServiceIdentifier, isValid, setPropertyMap
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getPropertyMap, getServiceIdentifier, isValid
public AsyncExecutionService(IServiceProvider provider)
public AsyncExecutionService(IServiceProvider provider, Map<String,Object> properties)
public void execute(IExecutable task)
execute
in interface IExecutionService
task
- The task to execute.
(called from arbitrary threads)public IFuture<Void> cancel(IExecutable task)
cancel
in interface IExecutionService
task
- The task to execute.listener
- The listener.public IExecutable[] getTasks()
getTasks
in interface IExecutionService
public IFuture<Void> startService()
startService
in interface IInternalService
startService
in class BasicService
public IFuture<Void> shutdownService()
shutdownService
in interface IInternalService
shutdownService
in class BasicService
public boolean customIsValid()
public IFuture<Void> getNextIdleFuture()
getNextIdleFuture
in interface IExecutionService
Copyright © 2012. All Rights Reserved.