Package com.tnsai.agents.init
Class AgentInitializer
java.lang.Object
com.tnsai.agents.init.AgentInitializer
Handles the initialization of Agent components.
This class extracts initialization logic from Agent to:
- Separate initialization concerns from agent behavior
- Improve testability (can mock InitializerContext)
- Centralize BDI state and resilience component creation
Usage:
AgentInitializer initializer = new AgentInitializer(agentContext);
InitializationResult result = initializer.initialize();
// Apply result to agent fields
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classResult of agent initialization containing all initialized components.static interfaceContext interface for accessing Agent internals needed for initialization. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringderiveNameFromClass(Class<?> clazz) Derives a human-readable name from the agent's class name.static booleanhasProtocolAnnotations(Class<?> clazz) Checks if the agent class has protocol annotations.Performs the initialization and returns the result.
-
Constructor Details
-
AgentInitializer
-
-
Method Details
-
initialize
Performs the initialization and returns the result.- Returns:
- InitializationResult containing all initialized components
-
deriveNameFromClass
Derives a human-readable name from the agent's class name. -
hasProtocolAnnotations
Checks if the agent class has protocol annotations.
-