Class AgenorRuntime
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic final recordRuntime statistics record -
Method Summary
Modifier and TypeMethodDescriptionstatic AgenorRuntime.Builderbuilder()Create a new runtime builder<T extends Agent>
TcreateAgent(Class<T> agentClass) Create an agent from a class using annotation discoveryGet an agent by IDReturns anAgentContextwrapping the core runtime services.Get the agent directoryGet all registered agentsReturns the singletonApprovalHandlefor this runtime.Get the behavior schedulerGet the current configurationReturns where this runtime records a message whose delivery it gave up on.Get the lifecycle managerReturns theMessageDispatcherfor this runtime.getStats()Get runtime statisticsReturns theAgenorTelemetryinstance wired into this runtime.booleanCheck if runtime is currently runningvoidregisterAgent(Agent agent) Register a new agent instancestart()Start the runtime and all registered agentsstop()Stop the runtime and all agentsunregisterAgent(String agentId) Unregister an agent from runtime and directory
-
Method Details
-
start
Start the runtime and all registered agents -
stop
Stop the runtime and all agents -
getAgent
Get an agent by ID -
getAgents
Get all registered agents -
registerAgent
Register a new agent instance -
createAgent
Create an agent from a class using annotation discovery -
getAgentDirectory
Get the agent directory -
getMessageDispatcher
Returns theMessageDispatcherfor this runtime.- Returns:
- the message dispatcher; never null
- Since:
- 0.20.0
-
getDeadLetterQueue
Returns where this runtime records a message whose delivery it gave up on.Defaults to a bounded in-memory window. A dispatcher this runtime did not build itself writes here only if it was given the same queue instance — see
AgenorRuntime.Builder.deadLetterQueue(DeadLetterQueue).- Returns:
- the dead-letter queue; never null
- Since:
- 0.32.0
-
getBehaviorScheduler
Get the behavior scheduler -
getAgentContext
Returns anAgentContextwrapping the core runtime services.Useful when manually instantiating agents that implement
Agentdirectly (without extendingBaseAgent) and need all services in a single object:var agent = new MyDomainAgent(runtime.getAgentContext()); runtime.registerAgent(agent);When agents are discovered via package scanning,
AgentFactorybuilds and injects the context automatically — this method is only needed for manually registered agents.- Returns:
- a new
AgentContextbuilt from the current runtime services - Since:
- 0.10.0
-
isRunning
public boolean isRunning()Check if runtime is currently running -
getLifecycleManager
Get the lifecycle manager -
getConfiguration
Get the current configuration -
getStats
Get runtime statistics -
getTelemetry
Returns theAgenorTelemetryinstance wired into this runtime.- Returns:
- the telemetry instance; never
null(falls back to noop) - Since:
- 0.19.0
-
getApprovalService
Returns the singletonApprovalHandlefor this runtime.External systems (HTTP handlers, tests, webhooks) call this handle to submit human approval decisions for pending
HumanCheckpointBehaviorexecutions.Returns a
NoopApprovalHandlewhen no HITL provider (e.g.agenor-runtime-ext) is on the classpath; its mutating methods throwUnsupportedOperationException.- Returns:
- the approval handle; never
null - Since:
- 0.13.0
-
unregisterAgent
Unregister an agent from runtime and directory -
builder
Create a new runtime builder
-