Annotation Interface Agent
When package scanning is enabled on AgenorRuntime, all classes annotated
with @Agent are discovered, instantiated, and registered in the
AgentDirectory. The runtime then calls start() on
each agent that has autoStart() set to true.
Example usage:
@Agent(value = "order-processor", type = "processor",
capabilities = {"order.processing", "inventory.check"})
public class OrderProcessorAgent extends BaseAgent {
@Behavior(type = CYCLIC, interval = "10s")
public void processPendingOrders() { ... }
}
- Since:
- 0.1.0
- See Also:
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionbooleanWhether the runtime should start this agent automatically after registration.String[]Capability identifiers advertised by this agent.An optional type label used for grouping and querying agents.The agent identifier used for registration and discovery.
-
Element Details
-
value
String valueThe agent identifier used for registration and discovery.When left empty, the runtime defaults to the simple class name converted to a kebab-case (e.g.,
OrderProcessorAgent→order-processor-agent). The value must be unique within the runtime.- Returns:
- the agent identifier, or empty string to use the class-name default
- Default:
""
-
type
String typeAn optional type label used for grouping and querying agents.Types allow callers to query the
AgentDirectoryfor all agents of a given type (e.g.,"processor","collector","monitor"). The type has no effect on agent behavior.- Returns:
- the agent type label, or empty string if not categorized
- Default:
""
-
capabilities
String[] capabilitiesCapability identifiers advertised by this agent.Capabilities are arbitrary strings that describe what this agent can do (e.g.,
"order.processing","report.generation"). Other agents can query the directory to find agents with specific capabilities.- Returns:
- declared capability strings, empty array if none
- Default:
{}
-
autoStart
boolean autoStartWhether the runtime should start this agent automatically after registration.Set to
falsefor agents that should be started manually or on demand. Defaults totrue.- Returns:
trueto start automatically,falsefor manual start
- Default:
true
-