public class SyncExecutionService
extends jadex.bridge.service.BasicService
implements jadex.bridge.service.types.execution.IExecutionService
Modifier and Type | Class and Description |
---|---|
static class |
SyncExecutionService.State
The possible states of the service.
|
Modifier and Type | Field and Description |
---|---|
protected jadex.commons.concurrent.Executor |
executor
The executor.
|
protected jadex.commons.future.Future<java.lang.Void> |
idlefuture
The idle future.
|
protected jadex.bridge.IInternalAccess |
provider
The provider.
|
protected java.util.Set<jadex.commons.concurrent.IExecutable> |
queue
The queue of tasks to be executed.
|
protected java.util.List<jadex.commons.future.Future<java.lang.Void>> |
removedfut
The removed listeners.
|
protected jadex.commons.concurrent.IExecutable |
removedtask
Flag that indicates that the current task has been removed.
|
protected SyncExecutionService.State |
state
The state of the service.
|
protected jadex.commons.concurrent.IExecutable |
task
The current task.
|
Constructor and Description |
---|
SyncExecutionService(jadex.bridge.IInternalAccess provider)
Create a new synchronous executor service.
|
SyncExecutionService(jadex.bridge.IInternalAccess provider,
java.util.Map<java.lang.String,java.lang.Object> properties)
Create a new synchronous executor service.
|
Modifier and Type | Method and Description |
---|---|
jadex.commons.future.IFuture<java.lang.Void> |
cancel(jadex.commons.concurrent.IExecutable task)
Cancel a task.
|
boolean |
customIsValid()
Test if the service is valid.
|
void |
execute(jadex.commons.concurrent.IExecutable task)
Execute a task.
|
jadex.commons.future.IFuture<java.lang.Void> |
getNextIdleFuture()
Get the future indicating that executor is idle.
|
jadex.commons.concurrent.IExecutable[] |
getRunningTasks()
Get the currently running or waiting tasks.
|
jadex.commons.future.IFuture<java.lang.Void> |
shutdownService()
Shutdown the executor service.
|
jadex.commons.future.IFuture<java.lang.Void> |
startService()
Start the executor service.
|
createServiceIdentifier, createServiceIdentifier, equals, generateServiceName, getInterfaceType, getInternalAccess, getMethodTimeout, getPropertyMap, getProviderId, getServiceIdentifier, hashCode, initNFProperties, isValid, setComponentAccess, setPropertyMap, toString
protected java.util.Set<jadex.commons.concurrent.IExecutable> queue
protected jadex.commons.concurrent.Executor executor
protected jadex.commons.future.Future<java.lang.Void> idlefuture
protected SyncExecutionService.State state
protected jadex.commons.concurrent.IExecutable task
protected jadex.commons.concurrent.IExecutable removedtask
protected java.util.List<jadex.commons.future.Future<java.lang.Void>> removedfut
protected jadex.bridge.IInternalAccess provider
public SyncExecutionService(jadex.bridge.IInternalAccess provider)
public SyncExecutionService(jadex.bridge.IInternalAccess provider, java.util.Map<java.lang.String,java.lang.Object> properties)
public void execute(jadex.commons.concurrent.IExecutable task)
execute
in interface jadex.bridge.service.types.execution.IExecutionService
task
- The task to execute.public jadex.commons.future.IFuture<java.lang.Void> cancel(jadex.commons.concurrent.IExecutable task)
cancel
in interface jadex.bridge.service.types.execution.IExecutionService
task
- The task to execute.public jadex.commons.concurrent.IExecutable[] getRunningTasks()
getRunningTasks
in interface jadex.bridge.service.types.execution.IExecutionService
public boolean customIsValid()
public jadex.commons.future.IFuture<java.lang.Void> startService()
startService
in interface jadex.bridge.service.IInternalService
startService
in class jadex.bridge.service.BasicService
public jadex.commons.future.IFuture<java.lang.Void> shutdownService()
shutdownService
in interface jadex.bridge.service.IInternalService
shutdownService
in class jadex.bridge.service.BasicService
public jadex.commons.future.IFuture<java.lang.Void> getNextIdleFuture()
getNextIdleFuture
in interface jadex.bridge.service.types.execution.IExecutionService