public class AcpAgentSupport
extends java.lang.Object
This class provides a fluent builder API to configure and run annotation-based agents without requiring Spring or other frameworks.
Example usage:
{@code| 限定符和类型 | 类和说明 |
|---|---|
static class |
AcpAgentSupport.Builder
Builder for AcpAgentSupport.
|
| 限定符和类型 | 方法和说明 |
|---|---|
static AcpAgentSupport.Builder |
builder()
Create a new empty builder.
|
void |
close()
Close the agent gracefully.
|
static AcpAgentSupport.Builder |
create(java.lang.Class<?> agentClass)
Create a new builder for an agent class (requires no-arg constructor).
|
static AcpAgentSupport.Builder |
create(java.lang.Object agentInstance)
Create a new builder for an agent instance.
|
AcpSyncAgent |
getAgent()
Get the underlying sync agent.
|
void |
run()
Run the agent (blocking until close).
|
void |
start()
Start the agent (non-blocking).
|
public static AcpAgentSupport.Builder create(java.lang.Object agentInstance)
agentInstance - the annotated agent instancepublic static AcpAgentSupport.Builder create(java.lang.Class<?> agentClass)
agentClass - the annotated agent classpublic static AcpAgentSupport.Builder builder()
public void start()
public void run()
public void close()
public AcpSyncAgent getAgent()