io.sarl.sre.janus.services.lifecycle
Class AbtractAgentCreatorProvider
All Superinterfaces:
AgentCreatorProvider
abstract class AbtractAgentCreatorProvider
extends java.lang.Object
implements AgentCreatorProvider
Abstract implementation of a provider of agent instance creator. The implementation of an AgentCreatorProvider must be thread safe, i.e. the call to the getAgentCreator function must not need to be synchronized.
Maven Group Identifier:
io.sarl.sre.janus
Maven Artifact Identifier:
janus.kernel
Since:
0.12
Action Summary
Modifier and type Action and description
protected Agent createAgent(Constructor<T>,Class<T>,UUID,UUID,DynamicSkillProvider*)
Create the instance of the agent.
protected java.lang.reflect.Constructor<T> getAgentConstructor(Class<T>)
Find the best constructor for creating an agent.
Action Details
createAgent(Constructor<T>,Class<T>,UUID,UUID,DynamicSkillProvider*)
protected def createAgent(Constructor<T>,Class<T>,UUID,UUID,DynamicSkillProvider*) : Agent
Create the instance of the agent.

If the given constructor has three parameters, the arguments are parentId, agentId and view to the skillProvider. If the given constructor has two parameters, the arguments are parentId and agentId.
Parameters:
constructor - the constructor to call.
agentType - the type of agent to create.
parentId - the identifier of the parent agent.
agentId - the identifier of the new agent.
skillProvider - the list of skill providers.
Returns:
the agent instance.
getAgentConstructor(Class<T>)
protected def getAgentConstructor(Class<T>) : java.lang.reflect.Constructor<T>

with T extends Agent

Find the best constructor for creating an agent.

The function checks for the following constructors in this order:
  • AgentType(UUID, UUID)
  • AgentType(UUID, UUID, DynamicSkillProvider)
Parameters:
agentType - the type of a agent.
Returns:
the constructor.