ServiceWithLifecycleManager
public abstract class ServiceWithLifecycleManager implements Service, AutoCloseable
源码Source
io/agentscope/runtime/engine/shared/ServiceWithLifecycleManager.java:24–39服务使用生命周期管理器,承载智能体的部署、调度与服务化运行。位于 io.agentscope.runtime.engine.shared 包,实现 Service、AutoCloseable。核心成员包括 start、stop、health、close。
Base class for services with lifecycle management capabilities Combines Service interface and lifecycle management functionality, providing a convenient base class for most service implementations
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public abstract CompletableFuture<Void> start()abstract | 返回启动。 Returns the start. |
public abstract CompletableFuture<Void> stop()abstract | 返回停止。 Returns the stop. |
public abstract CompletableFuture<Boolean> health()abstract | 返回健康状态。 Returns the health. |
public void close() throws Exception | 关闭连接并释放相关资源。 Releases resources and connections. |
方法详情Method Detail
start
public abstract CompletableFuture<Void> start()
abstract
返回启动。
Returns the start.
CompletableFuture<Void>返回CompletableFuture。Returns completable future.
源码Source
io/agentscope/runtime/engine/shared/ServiceWithLifecycleManager.java:26–27stop
public abstract CompletableFuture<Void> stop()
abstract
返回停止。
Returns the stop.
CompletableFuture<Void>返回CompletableFuture。Returns completable future.
源码Source
io/agentscope/runtime/engine/shared/ServiceWithLifecycleManager.java:29–30health
public abstract CompletableFuture<Boolean> health()
abstract
返回健康状态。
Returns the health.
CompletableFuture<Boolean>返回CompletableFuture。Returns completable future.
源码Source
io/agentscope/runtime/engine/shared/ServiceWithLifecycleManager.java:32–33close
public void close() throws Exception
关闭连接并释放相关资源。
Releases resources and connections.
Exception可能抛出 `Exception`。Thrown when the operation cannot be completed.
源码Source
io/agentscope/runtime/engine/shared/ServiceWithLifecycleManager.java:35–38