AS AgentScopeAPI 手册 / API Reference

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.

返回Returns CompletableFuture<Void>
返回CompletableFuture。Returns completable future.
源码Source io/agentscope/runtime/engine/shared/ServiceWithLifecycleManager.java:26–27

stop

public abstract CompletableFuture<Void> stop()
abstract

返回停止。

Returns the stop.

返回Returns CompletableFuture<Void>
返回CompletableFuture。Returns completable future.
源码Source io/agentscope/runtime/engine/shared/ServiceWithLifecycleManager.java:29–30

health

public abstract CompletableFuture<Boolean> health()
abstract

返回健康状态。

Returns the health.

返回Returns CompletableFuture<Boolean>
返回CompletableFuture。Returns completable future.
源码Source io/agentscope/runtime/engine/shared/ServiceWithLifecycleManager.java:32–33

close

public void close() throws Exception

关闭连接并释放相关资源。

Releases resources and connections.

抛出Throws
  • Exception 可能抛出 `Exception`。Thrown when the operation cannot be completed.
源码Source io/agentscope/runtime/engine/shared/ServiceWithLifecycleManager.java:35–38
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.