110 likes | 212 Views
The YinYang System Manager facilitates the management of Jini services, including registering and deregistering other managers, domains, and active agents. Key functionalities include launching and running agents locally or remotely, handling communication between domains and agents, and managing agent life cycles. Agents can extend the abstract class, utilize GUIs, and communicate via inboxes. The system also supports email operations using JavaMail for sending and receiving messages, making it a comprehensive solution for agent and domain management in a dynamic environment.
E N D
Manager • Register/Deregister other Managers • Register/Deregister Domains • Register/Deregister Active Agents • Handle an Agent Service • Management the communication between Domains • Implement Interface Plug
Domain • Launch an active agent (local or remote) • Run an agent (local or remote) • Kill an active agent • Management the communication between active agents • Register its agents, Get agent information, Search agents
Agents • Status • MOBILE • STATIC • DOWNLOAD • PRIVATE • Manager and Domain are Jini Services, but Agents are not. • Build an agent by extending the abstract class Agent.
Agents • Agent can have an ”AgentFrame” (GUI) • Agent can use ”inbox ” to store messages • Agent can build a KQML Message • Agent can readMessage, can getMessage and handle it. • Agents need to implement the method AgentServiceResult perform(Object par)
HelloAgent • public class HelloAgent extends Agent implements Serializable { ..} • public HelloAgent() { super(Agent.MOBILE); } • public AgentServiceResult perform(Object par) { • AgentServiceResult res = new AgentServiceResult(); String str = doWork(par); res.setResult(str); return res; }
JavaMail • Packages: mail.jar, activation.jar • Send a mail • Make a Session • Make a MimeMessage msg • Send the message: Transport.send(msg)
Read a mail • Make a Session • Get the store and establish the connection • Open the folder • Get all message in the folder • Read a specified message.