翡翠代理容器
谁能告诉我如何通过java代码找到可用的代理容器? 我正在使用 JADE 代理框架,并且已经弄清楚如何创建新容器但找不到现有容器(以便可以在其中部署代理)。
Can anyone tell me how to find available agent containers through java code? I am using the JADE agent framework and I have figured out how to create new containers but not find existing containers (so that agents can be deployed in them).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有两种方法可以执行此操作,具体取决于您是希望通过正在进行的服务还是消息中的当前快照接收信息。
要获取当前可用代理容器 ID 的快照,请向代理管理服务 (AMS) 发送请求消息并等待其回复。 使用 JADE 管理本体和 QueryPlatformLocationsAction 术语,发送和接收方法将是:
要将此信息作为持续服务获取,并在每个容器注册到 AMS 时接收每个容器的 ContainerID,请创建扩展 AMSSubscriber 的行为。 为 AddedContainer 事件注册一个处理程序,您将能够访问新可用容器的 ContainerID:
希望这有帮助,
Russ
There are two ways of doing this, depending on whether you want to receive the information via an ongoing service or the current snapshot in a message.
To get a snapshot of the IDs of the currently available agent containers, send a Request message to the Agent Management Service (AMS) and wait for its reply. Using the JADE Management Ontology and the QueryPlatformLocationsAction term, the sending and receiving methods would be:
To get this information as an ongoing service, and to receive the ContainerID of each container as it registers with the AMS, create a Behaviour that extends the AMSSubscriber. Register a handler for the AddedContainer event and you will be able to access the ContainerID of the newly available container:
Hope this helps,
Russ