io.sarl.sre.janus.capacities
Capacity InternalSchedules
All Superinterfaces:
Schedules, Capacity
All Known Implementing Classes:
SchedulesSkill
capacity InternalSchedules
implements Schedules
Capacity for executing tasks with specific functions for the SRE platform.
Maven Group Identifier:
io.sarl.sre.janus
Maven Artifact Identifier:
janus.kernel
Since:
0.6
Property Summary
Modifier and type Property and description
org.arakhne.afc.vmutil.json.JsonBuffer executorServiceStateRepresentation
Replies a Json representation of the internal thread executor's state.
Inherited: activeTasks
Action Summary
Modifier and type Action and description
abstract AgentTask executeAsap(Runnable)
Submit the given task for being run as soon as possible.
abstract void executeBlockingTasks(Collection<E>,[boolean])
Submit tasks to the executor service and wait for the termination of all the tasks.
abstract org.arakhne.afc.vmutil.json.JsonBuffer getExecutorServiceStateRepresentation
Replies a Json representation of the internal thread executor's state.
abstract void releaseInternalResources(Behavior)
Release any resource that is dedicated to the behavior itself.
abstract void unregisterTasksForBehavior(Behavior)
Finish the tasks associated to the given behavior.
Property Details
executorServiceStateRepresentation
val executorServiceStateRepresentation : org.arakhne.afc.vmutil.json.JsonBuffer
Replies a Json representation of the internal thread executor's state.

This property is an alias for the action: getExecutorServiceStateRepresentation

Returns:
the representation of the executor's state.
Since:
0.12
Action Details
executeAsap(Runnable)
def executeAsap(Runnable) : AgentTask
Submit the given task for being run as soon as possible.
Parameters:
task - the task to run.
Returns:
the definition of the task reference.
Since:
0.11
executeBlockingTasks(Collection<E>,[boolean])
def executeBlockingTasks(Collection<E>,[boolean])
Submit tasks to the executor service and wait for the termination of all the tasks. This function ensures that the caller's thread is blocked until all the given tasks have been finished.

According to the implementation of the service, the given tasks may be run in the same or separated thread than the one of the caller.

If an exception occurs into the given task, the exception is thrown if thrownExceptions evaluates to true. If it is evaluates to false, the exception is logged.
Parameters:
task - the task to submit.
thrownExceptions - indicates if the exceptions in the given tasks are thrown forward by this function.
Since:
0.11
getExecutorServiceStateRepresentation
def getExecutorServiceStateRepresentation : org.arakhne.afc.vmutil.json.JsonBuffer
Replies a Json representation of the internal thread executor's state.
Returns:
the representation of the executor's state.
Since:
0.12
releaseInternalResources(Behavior)
def releaseInternalResources(Behavior)
Release any resource that is dedicated to the behavior itself.
Parameters:
behavior - the behavior.
unregisterTasksForBehavior(Behavior)
def unregisterTasksForBehavior(Behavior)
Finish the tasks associated to the given behavior.
Parameters:
behavior - the behavior.