| Modifier and type | Property and description |
|---|---|
| protected ExecutorService | executor |
| protected java.util.logging.Logger | logger
Replies the backend logger. |
| java.lang.Class<T> | referenceType |
| boolean | spawnEnable |
| Modifier and type | Type and description |
|---|---|
| protected class | AbstractLifecycleService.AgentCreationProcess
A class that is runnable into a thread and implements the creation of a single agent. |
| protected class | AbstractLifecycleService.AgentIdProvider
A dynamic provider of UUID for the newly created agents. |
| protected class | AbstractLifecycleService.ShutdownLookUp
A class that is looking for stopping the SRE kernel when o more agent is alive. |
| protected class | AbstractLifecycleService.SpawnQueries
A class enables to update the number of "spawn" queries and supporting the multiple spawning of agents within a single call to "spawn". |
| Constructor and description |
|---|
| new(SarlSpecificationChecker,AgentCreatorProvider,Provider<T>,Provider<T>,Provider<T>,Provider<T>,DynamicSkillProvider,SkillUninstaller,ExecutorService,LoggingService,LifecycleConfig)
Constructs the service. |
| Modifier and type | Action and description |
|---|---|
| void | addDynamicSkillProvider(DynamicSkillProvider)
Add a dynamic skill provider that must be used for the agents that are spawned after the call to this function. |
| void | addKernelAgentLifecycleListener(KernelAgentLifecycleListener) |
| void | addLifecycleServiceListener(LifecycleServiceListener) |
| boolean | canSpawnAgent
Replies if the service can spawn. |
| protected void | fireAgentDestroy(Agent,ConcurrentCollection<T>,Object)
Notify the listeners outside the parent context. |
| protected void | fireAgentDestructionEvents(Agent,ContextReference,ConcurrentCollection<T>,Object) |
| protected void | fireAgentKillFailureEvent(Agent,ContextReference,Object)
Fire the events related a failure of agent killing. |
| protected void | fireAgentSpawned(UUID,Context,Class<T>,Agent,Object*)
Notify the listeners outside the parent context. |
| protected void | fireAgentSpawnFailureEvent(UUID,Context,Class<T>,String)
Fire the events related a failure of agent spawn. |
| protected void | fireAgentSpawningEvents(UUID,Context,Class<T>,Object,Agent)
Fire the events related to the agent spawn. |
| protected void | fireKernelAgentDestroy
Notifies the listeners about the kernel agent destruction. |
| protected ExecutorService | getExecutor |
| protected java.util.logging.Logger | getLogger
Replies the backend logger. |
| java.lang.Class<T> | getReferenceType |
| boolean | getSpawnEnable |
| boolean | isAlive(AgentLife)
Replies if the agent is alive. |
| protected boolean | isEmptyRootContext(Context)
Replies if the given context is the root context and is empty. |
| boolean | isKillableAgent(AgentLife,UUID)
Replies if the given agent could be kill according to the SARL specification. |
| boolean | killAgent(Agent,boolean,Object) |
| protected AgentCreationProcess | newAgentCreatorProcess(SpawnQueries,UUID,Context,Class<T>,Object,Function0<Result>,Function1<Param,Result>)
Invoked to create the function for launching an agent. |
| protected void | onAgentCreated(Agent)
This function is called each time an agent was created. |
| protected void | onAgentFrameworkStop
This function is called each time the agent framework should be stopped. |
| protected void | onAgentKilled(Agent)
This function is called each time an agent was killed. |
| void | onStart |
| void | onStop |
| void | removeDynamicSkillProvider(DynamicSkillProvider)
Remove a dynamic skill provider that must be not be used any more for the agents that are spawned. |
| void | removeKernelAgentLifecycleListener(KernelAgentLifecycleListener) |
| void | removeLifecycleServiceListener(LifecycleServiceListener) |
| void | setSpawnEnable(boolean) |
| protected void | spawnAgent(int,UUID,Context,Class<T>,Object,Function0<Result>)
Spawn agents of the given type, and pass the parameters to its initialization function. |
| final void | spawnAgent(int,UUID,Context,UUID,Class<T>,Object) |
protected val executor : ExecutorService
This property is an alias for the action: getExecutor
protected val logger : java.util.logging.Logger
This property is an alias for the action: getLogger
val referenceType : java.lang.Class<T>
This property is an alias for the action: getReferenceType
var spawnEnable : boolean
This property is an alias for the action: getSpawnEnable
new(SarlSpecificationChecker,AgentCreatorProvider,Provider<T>,Provider<T>,Provider<T>,Provider<T>,DynamicSkillProvider,SkillUninstaller,ExecutorService,LoggingService,LifecycleConfig)
def addDynamicSkillProvider(DynamicSkillProvider)
def addKernelAgentLifecycleListener(KernelAgentLifecycleListener)
def addLifecycleServiceListener(LifecycleServiceListener)
def canSpawnAgent : boolean
protected def fireAgentDestroy(Agent,ConcurrentCollection<T>,Object)
protected def fireAgentDestructionEvents(Agent,ContextReference,ConcurrentCollection<T>,Object)
protected def fireAgentKillFailureEvent(Agent,ContextReference,Object)
protected def fireAgentSpawned(UUID,Context,Class<T>,Agent,Object*)
protected def fireAgentSpawnFailureEvent(UUID,Context,Class<T>,String)
protected def fireAgentSpawningEvents(UUID,Context,Class<T>,Object,Agent)
protected def fireKernelAgentDestroy
protected def getExecutor : ExecutorService
protected def getLogger : java.util.logging.Logger
def getReferenceType : java.lang.Class<T>
def getSpawnEnable : boolean
def isAlive(AgentLife) : boolean
protected def isEmptyRootContext(Context) : boolean
def isKillableAgent(AgentLife,UUID) : boolean
def killAgent(Agent,boolean,Object) : boolean
protected def newAgentCreatorProcess(SpawnQueries,UUID,Context,Class<T>,Object,Function0<Result>,Function1<Param,Result>) : AgentCreationProcess
protected def onAgentCreated(Agent)
AbstractLifecycleService, this function does nothing.
protected def onAgentFrameworkStop
AbstractLifecycleService, this function fires the kernel agent destruction event.
protected def onAgentKilled(Agent)
AbstractLifecycleService, this function does nothing.
def onStart
def onStop
def removeDynamicSkillProvider(DynamicSkillProvider)
def removeKernelAgentLifecycleListener(KernelAgentLifecycleListener)
def removeLifecycleServiceListener(LifecycleServiceListener)
def setSpawnEnable(boolean)
protected def spawnAgent(int,UUID,Context,Class<T>,Object,Function0<Result>)
def spawnAgent(int,UUID,Context,UUID,Class<T>,Object)