Agent-based management system having an open layered architecture for synchronous and/or asynchronous messaging handling6226666Abstract A communication infrastructure providing communication between agents, between agents and agent-hosting servers, and between agent-hosting servers. The communication infrastructure consists of three layers (from bottom to top): Mail Facility Layer, Message Facility Layer, and Agent Management Communication Facility Layer. The Mail Facility Layer is the lowest layer providing a general, semantics-free mail paradigm for asynchronous communication between distributed objects, whether they are local or remote to each other. The Mail Facility Layer provides a level of abstraction in terms of mail, virtual mailbox, post office, and mail queue, and hides the details of implementation and actual transport. It is designed to provide location transparency and to be implementable using various transport protocols. The next Message Facility Layer provides a typed messaging paradigm for asynchronous and synchronous message passing between distributed objects. The Message Facility Layer uses the Mail Facility Layer for sending messages and for getting responses to requests sent. It allows for the association of typed message handlers with typed messages such that the format and semantics of messages are encapsulated through their types, are extensible, and can be processed by the associated message handlers. The Agent Management Communication Facility Layer is the highest layer providing the services for inter-agent communication between agents, agent-agent-server communication between an agent and an agent server, and inter-agent-server communication between agent servers for managing agents such as locating an agent, dispatching an agent, retrieving an agent, etc. The key abstractions provided in this layer include agent manager, agent, and agent identifier. It uses the Message Claims We claim: Description A portion of the Disclosure of this patent document contains material which is subject to copyright protection. The copyright owner has no objection to the facsimile reproduction by anyone of the patent document or the patent disclosure, as it appears in the Patent and Trademark Office patent file or records, but otherwise reserves all copyright rights whatsoever.
TABLE 1
Mode
Message Type Asynchronous One-Way Synchronous Deferred
Event X
KQML X
Request/Response X X X
Agent Transfer X X
To send a message 605 of FIG. 6 via the Message Facility Layer 220, a user first creates a message 605 and then calls send() which creates a mail 610 specifying the type of content and the content wherein the type of content is the type of the message and the content is the message 605. The message 605 also creates a virtual mailbox 615 specifying the virtual mailbox name 620 that represents the destination for the mail 625, which is the receiver virtual mailbox of the message 605. Thereafter, the message 605 puts the mail 610 in the virtual mailbox 615 which causes the Mail Facility Layer 210 to deliver the message 605 to the destination 625. To receive a message via the Message Facility Layer 220, a user creates a virtual mailbox 665 specifying the virtual mailbox name 670 that represents the physical location 675 of the mail. The user then gets the mail 660, whose content is the message 655, from the virtual mailbox 665 which causes the Mail Facility Layer 210 to get the mail 660 from the location post office 675 through the local main post office 680 into the virtual mailbox 665. In summary, the Message Facility Layer 220 is a general purpose, message passing service for Java objects and uses the Mail Facility Layer 210 for actual message delivery. It serves as a flexible middle layer for the communication infrastructure. It provides an extensible framework for handling typed messages and associated handlers, and it allows for message passing, where appropriate, in asynchronous, synchronous, or deferred mode. Agent Management Communication Facility The Agent Management Communication Facility Layer 230 is the highest layer of the communication infrastructure. It is designed to provide a uniform scheme for handling inter-agent communication, whether the agents involved are stationary or mobile, and inter-agent-server communication. It uses the Message Facility Layer 220 and Mail Facility Layer 210 to carry out the communication. A key abstraction provided is that of an agent manager (705, 710, and 715). An agent manager manages a group of agents, stationary or mobile, and is responsible for working with other agent managers to locate an agent, send a message to an agent, dispatch an agent, retrieve an agent, etc. Each agent is autonomous and has an agent identifier which uniquely identifies it regardless whether it moves or not. The message passing between agents is illustrated in FIG. 7, where AgentManager (705, 710, and 715) and Agent (720 and 725) are Java classes. Inter-agent Communication Communication between mobile agents is done through the collaboration of agent managers. A mobile agent's owning agent manager is aware of an agent's whereabouts at all times and can cause appropriate message forwarding to the current location of an agent. A local agent manager manages agents located at the local agent manager's location or system. If there are one or more local agent managers at a location, then a local main agent manager is the default agent manager. If a mobile agent moves to a location other than that of its owning agent manager, then the managing agent manager at that current location of the agent is known as a destination agent manager. Each agent manager (705, 710, and 715) owns one or more virtual mailboxes (730, 735, 740, and 790) and uses them to exchange messages (745, 750, and 755) via mail (760, 765, 770, and 785). For example, if an agent manager 705 is asked to send a message 745 to an agent 720, it will generate a mail 760 (with the message 745 encapsulated as its content) and put in the owning agent manager's virtual mailbox 730. The owning agent manager 710 then will, at an appropriate time, receive the message 750, thus causing a mail 765 to be retrieved from its virtual mailbox 735. If the agent 720 is owned and managed by owning agent manager 710, then the owning agent manager 710 will locate the agent 720 and request the agent 720 to handle the message 750. If the agent 725 is owned, but not managed by, agent manager 710, then the message needs to be redirected to the managing destination agent manager 715. In this situation, owning agent manager 710 generates a mail 785 (with the message 750 encapsulated as its content) and puts the mail 785 in the destination agent manager's 715 virtual mailbox 790. The destination agent manager 715 then will, at an appropriate time, receive the message 755, thus causing a mail 770 to be retrieved from its virtual mailbox 740. The destination agent manager 715 will then locate the agent 725 and request the agent 725 to handle the message 755. From the above discussion it can be seen that the present invention provides a uniform facility for communication between agents, whether they are stationary or mobile, and for communication between agent managers for the purpose of managing agents, e.g., transferring an agent to a new location. Referring next to FIG. 8 through FIG. 28, flowcharts illustrating operations preferred in carrying out the present invention are shown. In the flowcharts, the graphical conventions of a diamond for a test or decision and a rectangle for a process or function are used. These conventions are well understood by those skilled in the art, and the flowcharts are sufficient to enable one of ordinary skill to write code in any suitable computer programming language. Mail Facility Layer Preferred Embodiment Referring first to FIG. 8 through FIG. 15, the operations preferred in carrying out the Mail Facility Layer 210 of the present invention are illustrated. FIG. 8 through FIG. 11 illustrate the operations preferred in sending mail, and FIG. 12 through FIG. 15 illustrate the operations preferred in receiving mail. To send mail, a user creates a mail 305 specifying the type of content and the content by use of API (Application Program Interface) <new Mail(type, content)>(process block 810 of FIG. 8). The user may also set a response destination for the mail 305 so that a reply may be returned to that destination or so that the mail 305 can be returned in case of delivery failure, <Mail. setResponseDestination(respDest)>(process block 820). The user then creates a virtual destination mailbox 310 by specifying a virtual mailbox name 315 that represents a destination for the mail 325, <new Mailbox(mbName)>(process block 830). The virtual mailbox name 315 comprises a post office name 350 and a mailbox id. The post office name 350 comprises a protocol, host, port, and post office id. This supports multiple protocols (e.g., RMI, which is the default), and the protocol determines the type of post office to be used for sending/receiving mail (e.g., an RMI post office is used in process block 920). Thereafter, the user puts the mail 305 in the virtual mailbox 310, <Mail.putMail(mail)>(process block 840). Referring next to FIG. 9, the operations preferred in carrying out the virtual mailbox (310 and 900) portion of the Mail Facility Layer 210 of the present invention are illustrated. After the mail 305 has been put into the virtual mailbox 310 by process block 840, process block 920 of FIG. 9 causes the virtual mailbox 310 to get the local main post office 320, <PostOfficeRMI.getLocalPostOffice()>, and process block 930 sends the mail 305 through the local main post office 320, <PostOffice.sendMail(mbName, mail)>. Referring now to FIG. 10, the operations preferred in carrying out the local main post office (320 and 1000) portion of the Mail Facility Layer 210 of the present invention are illustrated. The local main post office 320 extracts the destination post office name 350 from the virtual mailbox name 315 and uses it to find the destination post office 325, whether local or remote (process block 1010). If the destination post office is not available, then the local main post office 320 may put the mail 305 in the sending mail queue 330 and repeat this step later. This supports disconnected operation. Thereafter, the local main post office 320 generates and sets the mail id for the mail, <Mail.setMailId(mailId)>(process block 1020), and sets the destination for the mail specifying the virtual mailbox name 315, <Mail. setDestination(mbName)>(process block 1030). Process block 1040 then causes the local mail post office 320 to deliver the mail 305 to the destination post office 325 specifying the mailbox id, which is extracted from the virtual mailbox name, <PostOfficeRMI.deliverMail(mbId, mail)>. Referring now to FIG. 11, the operations preferred in carrying out the destination post office (325 and 1100) portion of the Mail Facility Layer 210 of the present invention are illustrated. After the mail 305 is received at the destination post office 325, the destination post office 325 obtains the receiving mail queue 335 for the mail 305 using the mailbox id (process block 1120), and then the destination post office 325 puts the mail 305 in the mail queue 335, <MailQueue.enqueue(mail)>(process block 1130). Different types of mail queues may provide different quality of service. For example, in-memory mail queue <MemMailQueue>provides fast access, whereas database mail queue <SQLMailQueue>provides persistent storage of mail. The use of these is determined by the post office and is transparent to the user. Referring now to FIG. 12 through FIG. 15, the operations preferred in receiving mail are illustrated. Referring first to FIG. 12, the user operations preferred in receiving mail via a virtual mailbox 410 are illustrated. A user creates a virtual mailbox 410 specifying the virtual mailbox name 415 that represents the physical location of the mail located at post office 425, <new Mailbox(mbName)>(process block 1210). Thereafter, the user gets the mail 405 from the virtual mailbox 410, <Mail.getMail()>(process block 1220). Alternatively, the user may get the mail with a specific type of content or a specific correlation identifier. The correlation identifier or correlation id associates two or more pieces of mail, for example a mail object and a reply to that mail object. Referring next to FIG. 13, the operations preferred in the virtual mailbox 410 when receiving mail are illustrated. In response to the user getting the mail 405 from the virtual mailbox 410 (process block 1220), the virtual mailbox 410 gets the local main post office 420, <PostOfficeRMI.getLocalPostOffice()>(process block 1310), and thereafter the virtual mailbox 410 receives the mail 405 through the local main post office 420, <PostOffice.receiveMail(mbName)>(process block 1320). Alternatively, the virtual mailbox may receive the mail with a specific type of content or a specific correlation id. Referring next to FIG. 14, the operations preferred in the local main post office 420 when receiving mail are illustrated. In response to the virtual mailbox 410 getting the local main post office 420 (process block 1320), the local main post office 420 extracts the location post office name 450 from the virtual mailbox name 415 and uses it to find the location post office 425, whether local or remote (process block 1410). The location post office is the physical location of the mail to be received. If the location post office 425 is not available, the local main post office 420 will repeat process block 1410 later, thus supporting disconnected operation. Thereafter, the local mail post office 420 retrieves the mail 405 from the location post office 425 specifying the mailbox id, which is extracted from the virtual mailbox name 415, <PostOfficeRMI.retrieveMail(mbId, mail)>(process block 1420). Referring next to FIG. 15, the operations preferred in the location post office 425 when receiving mail are illustrated. In response to the local mail post office 420 retrieving the mail 405 from the location post office 425 (process block 1420), the location post office 425 obtains the receiving mail queue 435 for the mail 405 using the mailbox id (process block 1510), and then gets the mail 405 from the mail queue 435, <MailQueue.dequeue()>(process block 1520). Alternatively, the location post office 425 may get the mail with a specific type of content or a specific correlation id. The mail obtained by process block 1520 is returned to process block 1420 which causes the mail to be returned to process block 1320 which causes the mail to be returned to process block 1220. Message Facility Layer Preferred Embodiment Referring now to FIG. 16 through FIG. 18, the operations preferred in carrying out the Message Facility Layer 220 of the present invention are illustrated. FIG. 16 illustrates sending a message, FIG. 17 illustrates the sending of a message via the Mail Facility Layer 210, and FIG. 18 illustrates the receiving of a message. Referring first to FIG. 16 illustrating the operations preferred in sending a message, a user creates a message 605 of a particular type, <e.g., new KQMLMessage()>(process block 1610). The user sets the sender of the message, <Message.setSender()>(process block 1620); sets the receiver of the message, <Message.setReceiver()>(process block 1630), and sets other attributes of the message as needed, <e.g., KQMLMessage.setPerformative(pero)>(process block 1640). The user then sends the message, <Message. send()>(process block 1650). Referring next to FIG. 17 illustrating the operations preferred in the sending of a message 605 via the Mail Facility Layer 210, the message 605 creates a mail 610 specifying the type of content and the content wherein the type of content is the type of the message and the content is the message 605, <new Mail(type, content)>(process block 1710). The message 605 may also set a response destination for the mail 610 so that a reply may be returned to the destination or so that it can be returned in case of delivery failure, <Mail.setResponseDestination(respDest)>(process block 1720). The response destination is the sender virtual mailbox of the message. The message 605 also creates a virtual mailbox 615 specifying the virtual mailbox name 620 that represents the destination for the mail 625, <new Mailbox(mbName)>(process block 1730), which is the receiver virtual mailbox of the message 605. Thereafter, the message 605 puts the mail 610 in the virtual mailbox 615, <Mail.putMail(mail)>(process block 1740), which invokes the Virtual Mailbox processing 900 of the Mail Facility Layer 210 starting with process block 920 of FIG. 9 wherein the message 605 is the user of the Mail Facility Layer 210. Referring next to FIG. 18 illustrating the operations preferred in the receiving of a message via the Message Facility Layer 220, a user creates a virtual mailbox 665 specifying the virtual mailbox name 670 that represents the physical location 675 of the mail, <new Mailbox(mbName)>(process block 1810). The user then gets the mail 660 from the virtual mailbox 665, <Mail.getMail()>(process block 1820), which invokes the Virtual Mailbox processing 1300 of the Mail Facility Layer 210 starting with process block 1310 of FIG. 13 wherein the message 655 is the user of the Mail Facility Layer 210. After process block 1320 has received the mail 660 into the virtual mailbox 665 from the local main post office 680, the user gets the content of the mail 660, which is the message 655, <Mail.getContent()>(process block 1830). Alternatively, process block 1820 may allow the user to optionally get the mail with a specific type of content which represents the type of message to be received. Request/Response Messaging Preferred Embodiment Referring next to FIG. 19 through FIG. 24, the operations preferred in carrying out the Request/Response Messaging of the present invention are illustrated. FIG. 19 illustrates the operations preferred in sending a request message; FIG. 20 illustrates the operations preferred in receiving a request message; FIG. 21 illustrates the operations preferred in carrying out the Request Message Handler; FIG. 22 illustrates the operations preferred in a one-way mode of Request/Response Messaging; FIG. 23 illustrates the operations preferred in a deferred mode of Request/Response Messaging; and FIG. 24 illustrates the operations preferred in a synchronous mode of Request/Response Messaging. Referring next to FIG. 19 illustrating the operations preferred in the sending of a request message, a user first creates a request message, <new RequestMessage()>(process block 1910). The user sets the receiver of the message, <Message.setReceiver()>(process block 1920); the sender of the message, <Message. setsender()>(process block 1930); and other attributes of the message as needed, <e.g., RequestMessage.setOperation(oper)>(process block 1940). Thereafter, the user sends the message, <RequestMessage.send()>(process block 1950) which invokes process block 1650 of FIG. 16 and processing continues by the Message Facility Layer 220. Referring next to FIG. 20 illustrating the operations preferred in the receiving of a request message, the system (e.g., an agent manager) first creates a virtual mailbox specifying the virtual mailbox name that represents the virtual mailbox, <new Mailbox(mbName)>(process block 2010). The system then gets the mail from the virtual mailbox, <Mail.getMail()>(process block 2020), using the virtual mailbox processing 1300 of FIG. 13, and the content of the mail, which is a clone of the request message, <Mail.getContent(>(process block 2030). Thereafter, the system sets the status of the request message to indicate that it is a clone, <RequestMessage.setClone()>(process block 2040). The system then creates a request message handler, <new RequestMessageHandler()>(process block 2050), and the system asks the request message handler to handle the (cloned) request message, <RequestMessageHandler.handleMessage(reqc)>(process block 2060). Referring next to FIG. 21 illustrating the operations preferred in the carrying out of the Request Message Handler, the handler handles the message and generates a result (process block 2110). Thereafter, the Request Message Handler determines if a one-way attribute is set (<RequestMessage.isOneway()>) (decision block 2120), and if the one-way attribute is set, then process block 2125 discards the result. Returning now to decision block 2120, if the one-way attribute is not set, then the Request Message Handler creates a response message, <new ResponseMessage(result)>(process block 2130). Thereafter, the Request Message Handler sets a correlation identifier or correlation id of the response message to be the message identifier or message id of the request message, <ResponseMessage.setCorrelationId(corrId)>(process block 2140). The Request Message Handler also sets the receiver of the response message to be the sender of the request message, <Message.setReceiver(receiver)>(process block 2150), and sets the sender of the response message to be the receiver of the request message, <Message.setSender(sender)>(process block 2160). Thereafter, the Request Message Handler sends the response message, <Message.send()>(process block 2170), invoking process block 1650 of the sending message portion 1600 of the Message Facility Layer 220. Referring next to FIG. 22, FIG. 23, and FIG. 24, three modes of sending the request message and getting the result are illustrated: one-way in FIG. 22, deferred in FIG. 23, or synchronous in FIG. 24. Referring first to FIG. 22 illustrating the operations preferred in a one-way mode of Request/Response Messaging, if the request message mode is set to one-way before sending (<RequestMessage.setOneway()>), then the request message is sent as a one-way request message, and the result is discarded (process block 2210). Referring next to FIG. 23 illustrating the operations preferred in a deferred mode of Request/Response Messaging, the user first checks if the result has arrived, <RequestMessage.checkResult()>(process block 2310). Thereafter, the user determines if a the result has arrived (decision block 2320), and if the result has arrived, then the user gets the result (process block 2330). Returning now to decision block 2320, if the result has not arrived, then the user can repeat process block 2310 and decision block 2320 at a later time. Referring next to FIG. 24 illustrating the operations preferred in a synchronous mode of Request/Response Messaging, the user waits for the result until the result arrives, and gets it, <RequestMessage.getResult(-1)>(process block 2410). Agent Communication Facility Layer Preferred Embodiment Referring next to FIG. 25 through FIG. 28, the operations preferred in carrying out the Agent Communication Facility Layer 230 of the present invention are illustrated. FIG. 25 illustrates the operations preferred in carrying out the agent communication portion of the present invention when a user sends an agent a message; FIG. 26 illustrates the operations preferred in carrying out the agent communication portion of the present invention when a local agent manager facilitates an agent message; FIG. 27 illustrates the operations preferred in carrying out the agent communication portion of the present invention when an owning agent manager facilitates an agent message; and FIG. 28 illustrates the operations preferred in carrying out the agent communication portion of the present invention when a destination agent manager facilitates an agent message. Referring next to FIG. 25 illustrating the operations preferred in carrying out the agent communication facility layer portion of the present invention when a user sends an agent a message, a user first gets the local main agent manager 705, <AgentManager.getLocalAgentManager()>(process block 2510), wherein the local main agent manager is the default agent manager for managing agents located at the local main agent manager's location or system. Thereafter, the user creates a message 745 of a particular type (e.g., KQMLMessage) (process block 2520), and sets the attributes of the message as needed, <e.g., KQMLMessage.setPerformative(perf)>(process block 2530). The user then sends the message through the local main agent manager 705, <AgentManager.sendMessage(aid, msg)>(process block 2540). Referring next to FIG. 26 illustrating the operations preferred in carrying out the agent communication facility layer portion of the present invention when a local agent manager facilitates an agent message, the local main agent manager 705 first sets the receiver of the message to the owning agent manager 710 URL (Uniform Resource Locator) in string form concatenated with the agent id in string form, <Message.setReceiver(receiver)>(process block 2610). The owning agent manager is aware of an agent's whereabouts at all times and can cause appropriate message forwarding to the current location of an agent. The local main agent manager 705 also sets the sender of the message to the its URL (string form), <Message. setSender(sender)>(process block 2620), and then sends the message, <Message.send()>(process block 2630), invoking process block 1650 of the sending message portion 1600 of the Message Facility Layer 220. Referring next to FIG. 27 illustrating the operations preferred in carrying out the agent communication facility layer portion of the present invention when an owning agent manager facilitates an agent message, the owning agent manager 710 first creates a virtual mailbox 735 specifying the virtual mailbox name 775 that represents it's virtual mailbox wherein the virtual mailbox name is a string form of its URL, <new Mailbox(mbName)>(process block 2710). Thereafter, the owning agent manager 710 gets the mail 765 from the virtual mailbox 735, <Mailbox.getMail(>(process block 2720), and gets the content of the mail 765, which is the message 750, <Mail.getContent()>(process block 2730). The owning agent manager 710 also gets the receiver 720 of the message wherein the receiver is the agent id in string form, <Message.getReceiver)>(process block 2740), and gets the managed and owned agent 720, <AgentManager.getAgent(aid)>(process block 2750). Thereafter, the owning agent manager 710 determines if an agent 720 exists locally (decision block 2760), and if the agent 720 exists locally, then the owning agent manager 710 asks the managed agent 720 (managed agent if local) to handle the message 750, <Agent.handleMessage()>(process block 2770). Returning now to decision block 2760, if the agent does not exist locally (if the agent has moved to a location managed by a different agent manager 715), then the owning agent manager 710 gets the destination 715 of the owned agent 725 wherein the destination is the URL in string form of the destination agent manager 715 (process block 2775). This is the situation where the agent 725 has moved away from it's owning agent manager 710. Whenever it does so, the owning agent manager 710 is informed of it's new destination and the destination agent manager 715. Thereafter, the owning agent manager 710 sets the receiver of the message wherein the receiver is set to the destination agent manager 715 URL in string form concatenated with the agent id in string form, <Message.setReceiver(receiver>(process block 2780). The owning agent manager 710 then sends the message 755, <Message.send()>(process block 2790). Referring next to FIG. 28 illustrating the operations preferred in carrying out the agent communication portion of the present invention when a destination agent manager facilitates an agent message, the destination agent manager creates a virtual mailbox specifying the virtual mailbox name that represents it's virtual mailbox wherein the virtual mailbox name is a string form of it's URL, <new Mailbox(mbName)>(process block 2810). The destination agent manager is the managing agent manager at the current location of the agent if the agent moves to a location other than that of its owning agent manager. Thereafter, the destination agent manager gets the mail from the virtual mailbox, <Mailbox.getMail()>(process block 2820); gets the content of the mail which is the message, <Mail.getContent()>(process block 2830); and gets the receiver of the message wherein the receiver is the agent id in string form, <Message.getReceiver()>(process block 2840). The destination agent manager then gets the managed and owned agent, <AgentManager.getAgent(aid)>(process block 2850), and asks the managed agent to handle the message, <Agent.handleMessage()>(process block 2860). Although the present invention has been particularly shown and described with reference to a preferred embodiment, it will be understood by those skilled in the art that various changes in form and detail may be made without departing from the spirit and the scope of the invention. TABLE 2 API User's Guide Class Hierarchy Index Package Index Other Packages package com.ibm.jma.agent package com.ibm.jma.mail package com.ibm.jma.mail.input package com.ibm.jma.message package com.ibm.jma.message.handler TABLE 3 All Packages Class Hierarchy Index package com.ibm.jma.agent Class Index Agent AgentID AgentManager Exception Index AgentException All Packages Class Hierarchy This Package Previous Next Index Class com.ibm.jma.agent.Agent java.lang.Object . . . com.ibm.jma.agent.Agent public abstract class Agent extends Object implements Cloneable, MessageHandler This is the abstract, Toot class of all agents, stationary or mobile. Each agent has a globally unique identifier and is managed by an agent manager. An agent can communicate with other agents using messages. See Also: AgentManager, AgentID, Message Constructor Index Agent() Method Index getID() Gets the identifier of this agent. GetManager() Gets the (current) agent manager of this agent. getMessageTypes() Gets the message types which can be handled by this agent. handleMessage(Message) Handles the specified message. init(AgentManager, AgentID, Object) Constructors Agent protected Agent() Methods init protected void init(AgentManager am, AgentID aid, Object init) getID public final AgentID getID() Gets the identifier of this agent getManager public final AgentManager getManager() Gets the (current) agent manager of this agent. handleMessage public boolean handleMessage(Message msg) Handles the specified message. getMessageTypes public String getMessagetypes() Gets the message types which can be handled by this agent Returns: message types concatenated in a string and separated by spaces. All Packages Class Hierarchy This Package Previous Next Index All Package Class Hierarchy This Package Previous Next Index Class com.ibm.jma.agent.AgentID java.lang.object . . . com.ibm.jma.agent.AgentID public final class AgentID extends Object implements Serializable An AgentID object encapsulates an agent's identifier. Constructor Index AgentID(byte[]) Constructs an agent identifier from the specified byte array representation. AgentID(String) Constructs an agent identifier from the specified string representation. Method Index equals(Object) Test if the specified object is an agent identifier and is equal to this agent identifier. getID() Gets the byte array representation of this agent identifier. hashCode() Returns the hash code for this agent identifier. toString() Gets the string representation of this agent identifier. Constructors AgentID public AgentID(byte bid[]) Constructs an agent identifier from the specified byte array representation. AgentID public AgentID(String sid) Constructs an agent identifier from the specified string representation. Methods getID public byte[] get() Gets the byte array representation of this agent identifier. toString public String toString() Gets the string representation of this agent identifier. Overrides: toString in class Object equals public boolean equals(Object obj) Test if the specified object is an agent identifier and is equal to this agent identifier. Overrides: equals in class Object hashCode public int hashcode() Returns the hash code for this agent identifier. Overrides: hashCode in class Object All Packages Class Hierarchy This Package Previous Next Index All Packages Class Hierarchy This Package Previous Next Index Class com.ibm.jma.agent.AgentManager java.lang.Object . . . com.ibm.jma.agent.AgentManager public final class AgentManager extends Object implements MessageHandler An agent manager manages agents, stationary or mobile, including their communication, mobility, etc. Each agent manager may collaborate with other agent managers to accomplish its tasks. See Also: Agent, AgentID, Message Field Index DEFAULT_AM_NAME DEFAULT_PORT_NUMBER DEFAULT_PROTOCOL Method Index createAgent(URL, String, Object) Creates an agent with the specified codebase, class name, and initialization. dispatchAgent(agent, String) Dispatches an agent to the specified destination. getAgent(AgentID) Gets the agent managed by this agent manager with the specified agent identifier. getAgents() Gets all agents managed by this agent manager. getDestination(Agent ID) Gets the destination of the agent owned by this agent manager. getLocalAgentManager() Gets the local agent manager. getMessageTypes() Gets the message types which can be handled by this agent manager. getName() Gets the name of this agent manager. getURL() Gets the url of this agent manager. handleMessage(Message) Handles the specified message. retrieveAgent(AgentID) Retrieves the agent with the specified agent identifier. sendMessage(AgentID, Message) Sends the specified message to the agent with the specified identifier. Fields DEFAULT_AM_NAME public static final String DEFAULT_AM_NAME DEFAULT_PROTOCOL protected static final String DEFAULT_PROTOCOL DEFAULT_PORT_NUMBER protected static final int DEFAULT_PORT_NUMBER Methods getLocalAgentManager public static AgentManager getLocalAgentManager() Gets the local agent manager getURL public URL getURL() Gets the url of this agent manager. getName public String getName() Gets the name of this agent manager. handleMessage public boolean handleMessage(Message msg) Handles the specified message. Returns: true if the specified message can be handled. getMessageTypes public String getMessageTypes() Gets the message types which can be handled by this agent manager. Returns: message types concatenated in a string and separated by spaces createAgent public Agent createAgent(URL codebase, String classname, Object init) throws agentException Creates an agent with the specified codebase, class name, and initialization. The newly created agent is owned by this agent manage. send Message public void sendMessage(AgentID aid, Message; msg) Sends the specified message to the agent with the specified identifier. dispatchAgent public void dispatchAgent(Agent a, String dest) Dispatches an agent to the specified destination. retrieveAgent public Agent retrieveAgent(AgentID aid) Retrieves the agent with the specified agent identifier. getAgent public Agent getAgent(AgentID aid) Gets the agent managed by this agent manager with the specified agent identifier. getAgents public Enumeration getAgents() Gets all agents managed by this agent manager. getDestination public String getDestination(AgentID aid) Gets the destination of the agent owned by this agent manager. All Packages Class Hierarchy This Package Previous Next Index All Packages Class Hierarchy This Package Precarious Next Index Class com.ibm.jma.agent.AgentException java.lang.Object . . . java.lang.Throwable . . . java.lang.Exception . . . com.ibm.jma.agent.AgentException public class AgentException extends Exception Constructor Index AgentException() public AgentException(String) Constructors AgentException public AgentException() AgentException public AgentException(String s) All Packages Class Hierarchy This Package Previous Next Index TABLE 4 All Packages Class Hierarchy Index package com.ibm.jma.mail Interface Index MailQueue PostOffice Class Index Mailbox URL All Packages Class Hierarchy This Package Previous Index Interface com.ibm.jma.mail.MailQueue public interface MailQueue This interface is implemented by all mail queues. See Also: Method Index close() Closes this mail queue to disallow processing of mail. dequeue() Removes a mail from this mail queue. dequeue(byte[]) Removes a mail with the specified correlation id from this mail queue. dequeue(String) Removes a mail with the specified content type from this mail queue. enqueue(Mail) Adds a mail to this mail queue. getName() Returns the name of this mail queue. isEmpty() Tests if this mail queue has no mail. open() Opens this mail queue for processing of mail. size() Returns the number of mail in this mail queue. Methods getName public abstract string getName() Returns the name of this mail queue. enqueue public abstract void enqueue(Mail mail) Adds a mail to this mail queue. Parameters: mail--the mail to be added dequeue public abstract Mail dequeue() Removes a mail from this mail queue. Returns: a mail dequeue public abstract Mail dequeue(String type) Removes a mail with the specified content type from this mail queue. Returns: a mail with the specified content type dequeue public abstract Mail dequeue(byte corrId[]) Removes a mail with the specified correlation id from this mail queue. Returns: a mail with the specified correlation id isEmpty public abstract boolean isEmpty() Tests if this mail queue has no mail. size public abstract int size() Returns the number of mail in this mail queue. open public abstract void open() Opens this mail queue for processing of mail. close public abstract void close() Closes this mail queue to disallow processing of mail. All Packages Class Hierarchy This Package Previous Next Index All Packages Class Hierarchy This Package Previous Next Index Interface com.ibm.jma.mail.PostOffice public interface PostOffice The PostOffice interface is used to represent post office facility in Jamaica. It provides APIs for sending and receiving mails between post offices and mail boxes. See Also: PostOfficeRMI Method Index receiveMail(String) This method receives mail from a mailbox with name "mbName" receiveMail(String, byte[]) This method receives mail that has a correlation id "corrId" from the mail box of name "mbName" receiveMail(String, byte[], long) This method receives mail with correlation id "corrId" with timed wait of "waitTime" milliseconds from mailbox "mbName" when it times out a null mail object is returned receiveMail(String, long) This method receives mail with timed wait of "waitTime" milliseconds from a mailbox "mbName". receiveMail(String, String) This method receives mail of "type" type from a mailbox with name "mbName" receiveMail(String, String, long) This method receives mail of type "type" with timed wait of "waitTime" milliseconds from mailbox "mbName" when it times out a null mail object is returned sendMail(String, Mail) This method sends a mail "mail" to a mailbox with name "mbName" Methods sendMail public abstract byte[] sendMail(String mbName, Mail mail) This method sends a mail "mail" to a mailbox with name "mbName" Parameters: mbName--Name of the mailbox to which the mail has to be sent mail--The mail object that has to be sent Returns: A byte array that identifies the mail receiveMail public abstract Mail receiveMail(String mbName) This method receives mail from a mailbox with name "mbName" Parameters: mbName--Name of the mailbox from which to receive mail Returns: The received mail object receiveMail public abstract Mail receiveMail(String mbName, String type) This method receives mail of type "type" from a mailbox with name "mbName" Parameters: mbName--Name of the mailbox from which to receive mail type--Type of the mail that is to be received Returns: The received mail object receiveMail public abstract Mail receiveMail(String mbName, byte corrId[]) This method receives mail that has a correlation id "corrId" from the mail box of name "mbName" Parameters: mbName--Name of the mailbox from which to receive mail corrId--Correlation id of the mail that is to be received Returns: The received mail object receiveMail public abstract Mail receiveMail(String mbName, long waitTime) This method receives mail with timed wait of "waitTime," milliseconds from a mailbox "mbName". Parameters: mbName--Name of the mailbox from which to receive waitTime--The number of milliseconds to wait receiveMail public abstract Mail receiveMail(String mbName, String type, long waitTime) This method receives mail of type "type" with tie wait of "waitTime" milliseconds from mailbox "mbName" when it times out a null mail object is returned Parameters: mbName--Name of the mail box from which to receive type--Type of the mail to be received waitTime--Number of milliseconds to wait Returns: The received mail object receiveMail public abstract Mail receiveMail(String mbName, byte corrId[], long waitTime) This method receives mail with correlation id "corrId" with timed wait of "waitTime" milliseconds from mailbox "mbName" when it times out a null mail object is returned Parameters: mbName--Name of the mail box from which to receive corrId--Correlation Id of the mail to be received waitTime--Number of milliseconds to wait All Packages Class Hierarchy This Package Previous Next Index All Packages Class Hierarchy This Package Previous Next Index Class com.ibm.jma.mail.Mail java.lang.object . . . com.ibm.jma.mail.Mail public class Mail extends Object implements Serializable A Mail object is used to transport typed content. Each mail has a type and a content. The format and semantics of the content depends on the content type. constructor Index Mail() Mail(Mail) Mail(String, Object) Constructs a mail with the specified content type and content. Methods Index getContent() Returns the content of this mail. getCorrelationID() Returns the correlation id. getDestination() Returns the destination of this mail. getMailID() Returns the mail id of this mail. getPriority() Returns the priority of this mail getResponseDestination() Returns the response destination of this mail. getType() Returns the content type of this mail. setCorrelationId(byte[]) Sets the correlation id for the mail that this mail corresponds to. setDestination(String) Sets the destination of this mail setMailId(byte[]) Sets the mail id of this mail. setPriority(int) Sets the priority of this mail. setResponseDestination(String) Sets the response destination of this mail. toString() Returns a string representing this mail. Constructors public Mail(String type, Object content) Contructs a mail with the specified content type and content. Parameters: type--the content type of this mail content--the content of this mail protected Mail() protected Mail(Mail m) Methods toString public String toString() Returns a string representing this mail. Overrides: toString in class Object getType public String getType() Returns the content type of this mail. getContent public Object getContent() Returns the content of this mail. setMailId public void setMailId(byte id[]) Sets the mail id of this mail. getMailId public byte[] getMailId() Returns the mail id of this mail. setCorrelationId public void setCorrelationId(byte id[]) Sets the correlation id for the mail that this mail corresponds to. Required for a response mail. getcorrelationId public byte[] getCorrelationId() Returns the correlation id. setPriority public void setPriority(int priority) Sets the priority of this rail. The priority ranges from 1 to 10. The default is 5. getPriority public int getPriority() Returns the priority of this mail setDestination public void setDestination(String dest) Sets the destination of this mail getDestination public String getDestination() Returns the destination of this mail. setResponseDestination public void setResponseDestination(String respDest) Sets the response destination of this mail. getResponseDestination public String getResponseDestination() Returns the response destination of this mail All Packages Class Hierarchy This Package Previous Next Index All Packages Class Hierarchy This Package Previous Next Index Class com.ibm.jma.mail.Mailbox java.lang.object . . . com.ibm.jma.mail.Mailbox public class Mailbox extends Object A Mailbox object is used to send (put) and receive (get) mail. A mailbox is virtual. To send a mail, one simply opens a mailbox with the name that represents the destination for the mail and puts the mail in the mailbox. To receive a mail, one again simply opens a mailbox with the name that represents the location for the mail and gets the mail from the mailbox. See Also: Constructor Index Mailbox(String) Constructs (opens) a mailbox with the specified name. Method Index getMail() Gets (receives) a mail from this mailbox. getMail(byte[]) Gets (receives) a mail with the specified correlation id from this mailbox. (byteMail[], long) Gets (receives) a mail with the specified correlation id from this mailbox , waiting if the mail arrives within the specified wait time. getMail(long) Gets (receives) a mail from this mailbox, waiting if the mail arrives with the specified wait time. getMail(String) Gets (receives) a mail with the specified content type from this mailbox. getMail(String, long) Gets (receives) a mail with the specified content type from this mailbox, waiting if the mail arrives within the specified wait time. getName() Returns the name of this mailbox. getMail(Mail) Puts a mail in this mailbox (i.e., sends a mail to this mailbox). Constructors Mailbox public Mailbox(String name) Constructs (opens) a mailbox with the specified name. Methods getName public String getName() Returns the name of this mailbox. putMail public byte[] putMail(Mail mail) Puts a mail in this mailbox (i.e., sends a mail to this mailbox). Parameters: mail--the mail to be sent Returns: the mail id of the mail sent getMail public Mail getMail() Gets (receives) a mail from this mailbox. If there is no mail, it returns null. Returns: a mail getMail public Mail getMail(long waitTime) Gets (receives) a mail from this mailbox, waiting if the mail arrives within the specified wait time. If the wait time is set to -1, it waits forever until the mail arrives. Returns: a mail getMail public Mail getMail(String type) Gets (receives) a mail with the specified content type from this mailbox. If there is no such mail, it returns null. Returns: a mail with the specified content type getMail public Mail getMail(String type, long waitTime) Gets (receives) a mail with the specified content type from this mailbox, waiting if the mail arrives within the specified wait time. If the wait time is set to -1, it waits forever until the mail arrives. Parameters: type--the content type of the mail to be received waitTime--the time (in msecs) to wait for the mail to arrive Returns: a mail with the specified content type getMail public Mail getMail(byte corrId[]) Gets (receives) a mail with the specified correlation id from this mailbox. If there is no such mail, it returns null. Returns: a mail with the specified correlation id getMail public Mail getMail(byte corrId[], long waitTime) Gets (receives) a mail with the specified correlation id from this mailbox waiting if the mail arrives within the specified wait time. If the wait time is set to -1, it waits forever until the mail arrives. Parameters: corrId--the correlation id of the mail to be received waitTime--the time (in msecs) to wait for the mail to arrive Returns: a mail with the specified correlation id All Packages Class Hierarchy This Package Previous Next Index All Packages class Hierarchy This Package Previous Next Index Class com.ibm.jma.mail.URL java.lang.Object . . . com.ibm.ima.mail.URL public final class URL extends Object implements Serializable Constructor Index URL(String) URL(String, String, int, String) Methods Index equals(URL) getFile() getHost() getName() getPort() getProtocol() getRef() setRef(String) toString() Constructurs URL public URL(String spec) throws MalformedURLException URL public URL(String protocol, String hostName, int portNumber, String filename) throws MalformedURLException Methods getProtocol public String getProtocol() getHost public String getHost() getPort public int getPort() getFile public String getFile() setRef public void setRef(String ref) getRef public String getRef() equals public boolean equals(TR obj) toString public String toString() Overrides: toString in class Object getName public String getName() All Packages Class Hierarchy This Package Previous Next Index TABLE 5 All Packages Class Hierarchy Index package com.ibm.jma.mail.impl Interface Index PostOfficeRemoteRMI Class Index MemMailQueue POServre PostOfficeRMI SQL MailQueue Exception Index NoSuchMailException NotImplementedException All Packages Class Hierarchy This Package Previous Next Index Interface com.ibm.jma.mail.impl.PostOfficeRemoteRMI public interface PostOfficeRemoteRMI extends Remote Methods Index deliverMail(String, Mail) a deliverMail(String, Mail[]) retrieveMail(String, byte[], long) retrieveMail(String, long) retrieveMail(String, String, long) Methods getName public abstract String getName() throws RemoteException deliverMail public abstract void deliverMail(String mbId, Mail mail) throws RemoteException deliverMail public abstract void deliverMail(String mbId, Mail mails[]) throws RemoteException retrieveMail public abstract Mail retrieveMail(string mbId, long waitTime) throws RemoteException retrieveMail public abstract Mail retrieveMail(String mbId, String type, long waitTime) throws RemoteException retrieveMail public abstract Mail retrieveMail(String mbId, byte corrId[], long waitTime) throws RemoteException All Packages Class Hierarchy This Package Previous Next Index All Packages Class Hierarchy This Package Previous Next Index Class com.ibm.jma.mail.impl.MemMailQueue java.lang.object . . . com.ibm.jma.mail.impl.MemMailQueue public class MemMailQueue extends Object implements Mail Queue Constructor Index MemMailQueue() Method Index close() dequeue() dequeue(byte[]) dequeue(String) enqueue(Mail) getName() isEmpty() open() size() Constructors MemMailQueue public MemMailQueue() Methods getName public String getName() isEmpty public synchronized boolean isEmpty() size public int size() enqueue public synchronized void enqueue(Mail mail) dequeue public synchronized Mail dequeue() dequeue public synchronized Mail dequeue(byte corrId[]) dequeue public synchronized Mail dequeue(string mailtype) open public void open() close public void close() All Packages Class Hierarchy This Package Previous Next Index All Packages Class Hierarchy This Package Previous Next Index Class com.ibmjma.mail.impl.POServer java.lang.object . . . java.awt.Component . . . java.awt.Container . . . java.awt.Window . . . java.awt.Frame . . . com.ibm.jma.mail.impl.POServer public class POServer extends Frame implements ItemListener Constructor Index POServer(String) Method Index action(Event, Object) ItemStateChanged(ItemEvent) main(String[]) minimumSize() preferredSize() Constructors POServer public POServer(String n) Methods preferredSize public Dimension preferredSize() Overrides: preferredSize in class Container minimumSize public Dimension minimumsize() Overrides: minimumSize in class Container itemStateChanged public void itemStateChanged(ItemEvent evt) action public boolean action(Event evt, Object arg) Overrides: action in class Component main public static void main(String args[]) All Packages Class Hierarchy This Package Previous Next Index All Packages Class Hierarchy This Package Previous Next Index Class com.ibm.jma.mail.impl.PostOfficeRMI java.lang-Object . . . java.rmi.server.RemoteObject . . . java.rmi.server.RemoteServer . . . java.rmi.server.UnicastRemoteObject . . . com.ibm.jma.mail.impl.PostofficeRMI public class PostOfficeRMI extends UnicastRemoteObject implements PostOfficeRemoteRM, PostOffice Method Index deliverMail(String, Mail) deliverMail(String, Mail[]) getLocalPostOffice() getName() receiveMail(String) receiveMail(String, byte[]) receiveMail(String, byte[], long) receive Mail(String, long) receiveMail(String, String) receiveMail(String, String, long) retrieveMail(String, byte[], long) retrieveMail(String, long) retrieveMail(String, String, long) sendMail(String, Mail) Methods getLocalPostOffice public static synchronized PostOfficeRMI getLocalPostOffice() throws Rer getName public String getName() throws RemoteException deliverMail public void deliverMail(String mbId, Mail mail) throws RemoteException deliverMail public void deliverMail(String mbId, Mail maillist[]) throws RemoteException retrieveMail public Mail retrieveMail(String mbId, long waitTime) throws RemoteException, Illegal retrieveMail public Mail retrieveMail(String mbId, String type, long waitTime) throws RemoteException, Illegal retrieveMail public Mail retrieveMail(String mbId, byte corrId[], long waitTime) throws RemoteException, Illegal sendMail public byte[] sendMail(String mbName, Mail mail) receiveMail public Mail receiveMail(String mbName) receiveMail public Mail receiveMail(String mbName, long waitTime) receiveMail public Mail receiveMail(String mbName, String type) receiveMail public Mail receiveMail(String mbName, String type, long waitTime) receiveMail public Mail receiveMail(String mbName, byte corrId[]) receiveMail public Mail receiveMail(String mbName, byte corrId[], long waitTime) All Packages Class Hierarchy This Package Previous Next Index All Packages Class Hierarchy This Package Previous Next Index Class com.ibm.jma.mail.impl.SQLMailQueue java.lang.object . . . com.ibm.jma.mail.impl.SQLMailQueue public class SQLMailQueue Constructor Index SQL MailQueue(String) Method Index close() dequeue() dequeue(byte[]) dequeue(String) enqueue(Mail) getName() isEmpty() open() size() Constructors SQL MailQueue public SQLMailQueue(String name) Methods getName public String getName() enqueue public synchronized void enqueue(Mail mail) dequeue public synchronized Mail dequeue() dequeue public synchronized Mail dequeue(byte corrId[]) dequeue public synchronized Mail dequeue(String mailtype) isEmpty public synchronized boolean isEmpty() size public int size() open public void open() close public void close() All Packages Class Hierarchy This Package Previous Next Index All Packages Class Hierarchy This Package Previous Next Index Class com.ibm.jma.mail.impl.NoSuchMailException java.lang.Object java.lang.Throwable java.lang.Exception com.ibm.jma.mail.impl.NoSuchMailException public final class NoSuchMailException extends Exception Constructor Index NoSuchMailException() NOSuchMailException(byte[]) Constructors NoSuchMailException public NoSuchMailException() NoSuchMailException public NoSuchMailException (byte corrId[]) All Packages Class Hierarchy This Package Previous Next Index All Packages Class Hierarchy This Package Previous Next Index Class com.ibm.jma.mail.impl.NotImplementedException java.lang.Object . . . java.lang.Throwable . . . java.lang.Exception . . . com.ibm.jma.mail.impl.NotImplementedException public final class NotImplementedException extends Exception constructor Index NotImplementedException() public Not ImplementedException(Object) Constructors NotImplementedException public NotImplementedException() NotImplementedException public NotImplementedException(Object obj) All Packages Class Hierarchy This Package Previous Next Index TABLE 6 All Packages Class Hierarchy Index package com.ibm.jma.message Class Index ATRequestMessage ATResponseMessage KOMLMessage Message RequestMessage ResponseMessage All Packages Class Hierarchy This Package Previous Next Index Class com.ibm.jma.message.ATRequestMessage java.lang.Object . . . com.ibm.jma.message.Message . . . com.ibm.jma.message.RequestMessage . . . com.ibm.jma.message.ATRequestMessage public class ATRequestMessage extends RequestMessage An ATRequestMessage object is used to send agent transfer requests. See Also: RequestMessage Constructor Index ATRequestMessage Constructors ATRequestMessage public ATRequestMessage() All Packages Class Hierarchy This Package Previous Next Index All Packages Class Hierarchy This Package Previous Next Index Class com.ibm.jma.message.ATResponseMessage java.lang.object . . . com.ibm.jma.message.Message . . . com.ibm.jma.message.ResponseMessage . . . com.ibm.jma.message.ATResponseMessage public class ATResponseMessage extends ResponseMessage A ATResponseMessage object is used to send back the result of an agent request message. See Also: RequestMessage Constructor Index ATResponseMessage(Object) Constructs an agent transfer response message with the specified result. Method Index getParameters() Gets the parameters of the result. setParameters(Hashtable) Sets the parameters of the result Constructors ATResponseMessage public ATResponseMessage(Object result) Constructs an agent transfer response message with the specified result. Methods setParameters public void setparameters(Hashtable params) Sets the parameters of the result getParameters public Hashtable getparameters() Gets the parameters of the result. All Packages Class Hierarchy This Package Previous Next Index All Packages Class Hierarchy This Package Previous Next Index Class com.ibm.jma.message.KQMLMessage Java.lang.object . . . com.ibm.jma.message.Message . . . com.ibm.jma.message.KQMLMessage public class KQMLMessage extends Message A KQMLMessage object is used to send messages following the KQML format and protocol. Constructor Index KQMLMessage() Constructs a KQML message. Method Index getContent() Gets the content getInReplyTo() Gets the identifier that this message is replying to. GetInReplyWith() Gets the identifier that this message is to be relied with. getLanguage() Gets the content language. getOntology() Gets the content ontology. getPerformative() Gets the performative. setContent(Object) Sets the content. setInReplyTo(String) Sets the identifier that this message is replying to. setLanguage(String) Sets the content language. setOntology(String) Sets the content ontology. setPerformative(String) Sets the performative. setReplyWith(String) Sets the identifier that this message is to be relied with. Constructors KQMLMessage public KQMLMessage() Constructs a KQML message. Methods setperformative public void setPerformative(String perf) Sets the performative. getPerformative public String getperformative() Gets the performative. setInReplyTo public void setInReplyTo(String int) Sets the identifier that this message is replying to. getInReplyTo public String getInReplyTo() Gets the identifier that this message is replying to. setReplyWith public void setReplyWith(String rw) Sets the identifier that this message is to be relied with. getInReplyWith public String getInReplyWith() Gets the identifier that this message is to be relied with. setLanguage public void setLanguage(String lang) Sets the content language. getLanguage public String getLanguage() Gets the content language. setOntology public void setOntology(String onto) Sets the content ontology. getOntology public String getOntology() Gets the content ontology. setContent public void setContent(Object content) Sets the content. getContent public Object getContent() Gets the content. All Packages Class Hierarchy This Package Previous Next Index All Packages Class Hierarchy This Package Previous Next Index Class com.ibm.jma.message.Message java.lang.object . . . com.ibm.jma.message.Message public abstract class Message extends Object implements Serializable This is the abstract, root class of all types of messages. A Message object is used to encapsulate the information which is to be sent from a sender to a receiver. Its class name represents its type, which determines its format and semantics. Each type of messages may be associated with a corresponding type of message handlers which are designed to handle the messages. See Also: MessageHandler Field Index mailID Constructor Index Message() Method Index getReceiver() Gets the receiver mailbox of this message. getReceiverMB() Gets the sender of this message. getSender() Gets the sender mailbox of this message. getSenderMB() Gets the sender mailbox of this message send() Sends this message to the receiver. setReceiver(String) Sets the receiver of this message. setSender(String) Sets the sender of this message. Fields mailId protected byte mailId[] Constructors Message public Message() setsender public void setSender(String sender) Sets the sender of this message. getSender public String getSender() Gets the sender of this message. getSenderMB public String getSenderMB() Gets the sender mailbox of this message. setReceiver public void setReceiver(String receiver) Sets the receiver of this message. getReceiver public String getReceiver() Gets the receiver of this message. getReceiverMB public String getReceiverMB() Gets the receiver mailbox of this message. send public void send() Sends this message to the receiver. This operation uses the Jamaica Mail Facility (com.ibm.jma.mail) to accomplish its task. All Packages Class Hierarchy This Package Previous Next Index All Packages Class Hierarchy This Package Previous Next Index Class com.ibm.jma.message.RequestMessage java.lang.Object com.ibm.jma.message.Message . . . com.ibm.jma.message.RequestMessage public class RequestMessage extends Message A RequestMessage object is used to send messages which return a result. A request message can be sent in three different modes: one-way (asynchronous, discarding the result), synchronous (blocking until the result arrives), or deferred (obtaining the result at a later time). The result of a request message is contained in a response message. See Also: Constructs a request message. Constructor Index RequestMessage() Constructs a request message Method Index checkResult() Tests if the result has arrived. getMessageID() Gets the message id. getOperation() Gets the operation to be performed by the receiver of this message. getParameters() Gets the parameters of the operation. getResult() Gets the result. getResult() Gets the result if it arrives within the specified wait time. isClone() Tests if this message is a clone. isOneway() Tests if the messaging mode is one-way. isRead() Tests if the result has been read. isSend() Tests if this message has been sent send() Sends this message. setClone() Indicates that this message is a clone. setMessageID(byte[]) Sets the message id. setOneway() Sets the messaging mode to one-way. setOperation(String) Sets the operation to be performed by the receiver of this message. setParameters(Hashtable) Sets the parameters of the operation. Constructors RequestMessage public RequestMessage() Constructs a request message. Methods setMessageId protected void setMessageID(byte msgId[]) Sets the message id. getMessageId public byte[] getMessageId() Gets the message id. setOneway public void setoneway() Sets the messaging mode to one-way. The result, if any, will be discarded. isOneway public boolean isoneway() Tests if the messaging mode is one-way. setOperation public void setoperation(String oper) Sets the operation to be performed by the receiver of this message. getOperation public String getoperation() Gets the operation to be performed by the receiver of this message. setparameters public void setParameters(Hashtable params) Sets the parameters of the operation. getParameters public Hashtable getparameters() Gets the parameters of the operation. send public void send() Sends this message. Overrides: send in class Message isSent public boolean isSent() Tests if this message has been sent setClone public void setclone() Indicates that this message is a clone. isClone public boolean isclone() Tests if this message is a clone. checkResult public boolean checkResult() Tests if the result has arrived. getResult public Object getResult() Gets the result. If the result has not arrived, returns null. getResult public Object getResult(long waitTime) Gets the result if it arrives within the specified wait time. If the wait time is set to -1, waits forever until the result arrives. Returns: the result isRead public boolean isread() Tests if the result has been read. All Packages Class Hierarchy This Package Previous Next Index All Packages Class Hierarchy This Package Previous Next Index Class com.ibm.jma.message.ResponseMessage java.lang.Object com.ibm.jma.message.Message com.ibm.jma.message.ResponseMessage public class ResponseMessage extends Message A ResponseMessage object is used to send back the result of a request message. See Also: RequestMessage Constructor Index ResponseMessage(Object) Constructs a response message with the specified result. Method Index getCorrelationId() Gets the correlation id. getResult() Gets the result that this message contains. setCorrelationId(byte[]) Sets the correlation id for the corresponding request message. Constructors ResponseMessage public ResponseMessage(Object result) Constructs a response message with the specified result. Methods setCorrelationId public void setCorrelationId(byte corrId[]) Sets the correlation id for the corresponding request message. getCorrelationId public byte[] getCorrelationId() Gets the correlation id. getResult public Object getResult() Gets the result that this message contains. All Packages Class Hierarchy This Package Previous Next Index TABLE 7 All Packages Class Hierarchy Index package com.ibm.jma.message.handler Interface Index MessageHandler Class Index ATRequestMessageHandler ATResponseMessageHandler KQMLMessageHandler KSQLMessageHandler RequestMessageHandler ResponseMessagHandler All Package Class Hierarchy This Package Previous Next Index Interface com.ibm.jma.message.handler.MessageHandler public interface MessageHandler This interface is implemented by all message handlers. Each type of message handlers is designed to handle an associated type(s) of messages. See Also: Message Method Index getMessageTypes() Gets the message types which can be handled by this message handler. handleMessage(Message) Handles the specified message. Methods handleMessage public abstract boolean handleMessage(Message msg) Handles the specified message. Returns: true if the specified message can be handled. getMessageType public abstract String getMessageTypes() Gets the message types which can be handled by this message handler. Returns: message types concatenated in a string and separated by spaces All Packages Class Hierarchy This Package Previous Next Index All Packages Class Hierarchy This Package Previous Next Index Class com.ibm.jma.message.handler.ATRequestMessageHandler java.lang.object . . . com.ibm.jma.message.handler.ATRequestMessageHandler public class ATRequestMessageHandler extends RequestMessageHandler The handler for handling agent transfer request messages. See Also: Message Constructor Index ATRequestMessageHandler() Method Index getMessageTypes() Gets the message types which can be handled by this message handler. handleMessage(Message) Handles the specified message. Constructors ATRequestMessageHandler public ATRequestMessageHandler() handleMessage public boolean handleMessage(Message msg) Handles the specified message. Returns: true if the specified message can be handled. Overrides: handleMessage in class RequestMessageHandler getMessageTypes public String getMessageTypes() Gets the message types which can be handled by this message handler. Returns: message types concatenated in a string and separated by spaces Overrides: getMessageTypes in class RequestMessageHandler All Package Class Hierarchy This Package Previous Next Index All Packages Class Hierarchy This Package Previous Next Index Class com.ibm.j ma. message.handler.ATResponseMessageHandler java.lang.object . . . com.ibm.jma.message.handler.ResponseMessageHandler . . . com.ibm.jma.message.handler.ATResponseMessageHandler public class ATResponseMessageHandler extends ResponseMessagHandler The handler for handling agent transfer response messages. See Also: Message Constructor Index ATResponseMessageHandler() Method Index getMessageTypes() Gets the message can be handled by this message handler. handleMessage(Message) Handles the specified message. Constructors ATResponseMessageHandler public ATResponseMessageHandler() Methods handleMessage public boolean handleMessage(Message msg) Handles the specified message. Returns: true if the specified message can be handled. Overrides: handleMessage in class ResponseMessageHandler getMessageTypes public String getMessageTypes() Gets the message types which can be handled by this message handler. Returns: message types concatenated in a string and separated by spaces Overrides: getMessageTypes in class ResponseMessageHandler All Packages Class Hierarchy This Package Previous Next Index All Packages Class Hierarchy This Package Previous Next Index Class com.ibm.jma.message.handler.KQMLMessageHandler java.lang.object . . . com.ibm.jma.message.handler.KQMLMessageHandler public class KQMLMessageHandler extends Object implements MessageHandler The handler for handling KQML messages. See Also: KQMLMessage, KSQLMessageHandler Constructor Index KQMLMessageHandler() Method Index getMessageTypes() Gets the message types which can be handled by this message handler. handleMessage(Message) Handles the specified message. Constructors KQMLMessageHandler public KQMLMessageHandler() Methods handleMessage public boolean handleMessage(Message msg) Handles the specified message. Returns: true if the specified message can be handled. getMessageTypes public String getMessageTypes() Gets the message types which can be handled by this message handler. Returns: message types concatenated in a string and separated by spaces All Packages Class Hierarchy This Package Previous Next Index All Packages Class Hierarchy This Package Previous Next Index Class com.ibm.jma.message.handler.KSQLMessageHandler java.lang.Object . . . com.ibm.jma.message.handler.RSQLMessageHandler public class KSQLMessageHandler extends KQMLMessageHandler The handler for handling KQML messages whose content language is SQL. See Also: KQMLMessage, KQMLMessageHandler Constructor Index KSQLMessageHandler() Method Index handleMessage(Message) Handles the specified message. Constructors KSQLMessageHandler public KSQLMessageHandler() Methods handleMessage public boolean handleMessage(Message msg) Handles the specified message. Returns: true if the specified message can be handled. Overrides: handleMessage in class KQMLMessageHandler All Packages Class Hierarchy This Package Previous Next Index All Packages Class Hierarchy This Package Previous Next Index Class com.ibm.jma.message.handler.RequestMessageHandler java.lang.Object . . . com.ibm.jma.message.handler.RequestMessageHandler public class RequestMessageHandler extends Object implements MessageHandler The handler for handling request messages. See Also: RequestMessage Constructor Index RequestMessageHandler() Method Index getMessageTypes() Gets the message types which can be handled by this message handler. handleMessage(Message) Handles the specified message. Constructors RequestMessageHandler public RequestMessageHandler() Methods handleMessage public boolean handleMessage(Message reqc)) Handles the specified message. Returns: true if the specified message can be handled. getMessageTypes public String getMessageTypes() Gets the message types which can be handled by this message handler. Returns: message types concatenated in a string and separated by spaces All Packages Class Hierarchy This Package Previous Next Index All Packages Class Hierarchy This Package Previous Next Index Class com.ibm.jma.message.handler.ResponseMessageHandler java.lang.object . . . com.ibm.jma.message.handler.ResponseMessageHandler public class ResponseMessageHandler extends Object implements MessageHandler The handler for handling response messages. See Also: Message Constructor Index ResponseMessagHandler() Method Index getMessageTypes() Gets the message types which can be handled by this message handler. Handles the specified message. ResponseMessageHandler public ResponseMessageHandler() handleMessage public boolean handleMessage(Message msg) Handles the specified message. Returns: true if the specified message can be handled. getMessageTypes public String getMessageTypes() Gets the message types which can be handled by this message handler. Returns: message types concatenated in a string and separated by spaces All Packages Class Hierarchy This Package Previous Next Index TABLE 8 All Packages Index Class Hierarchy class java.lang.Object class com.ibm.jma.agent.Agent (implements java.lang.Cloneable, com.ibm.jma.message.handler.MessageHandler) class com.ibm.jma.agent.AgentManager (implements java.io.Serializable) class com.ibm.jma.agent.AgentManager (implements com.ibm.jma.message.handler.MessageHandler) class java.awt.Component (implements java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable) class java.awt.Container class java.awt.Window class java.awt.Frame (implements java.awt.MenuContainer) class com.ibm.jma.mail.impl.POServer (implements java.awt.event.ItemListener) class com.ibm.jma.message.handler.KQMLMessageHandler (implements com.ibm.jma.message.handler.MessageHandler) class com.ibm.jma.message.handler.KSQLMessageHandler class com.ibm.jma.mail.Mail (implements java.io.Serializable) interface com.ibm.jma.mail.MailQueue class com.ibm.jma.mail.Mailbox class com.ibm.jma.mail.impl.MemMailQueue (implements com.ibm.jma.mail.MailQueue) class com.ibm.jma.message.Message (implements java.io.Serializable) class com.ibm.jma.message.KQMLMessage class com.ibm.jma.message.RequestMessage class com.ibm.jma.message.ATRequestMessage class com.ibm.jma.message.ResponseMessage class com.ibm.jma.message.ATResponseMessage interface com.ibm.jma.message.handler.MessageHandler interface com.ibm.jma.mail.PostOffice interface com.ibm.jma.mail.impl.PostOfficeRemoteRMI (extends java.rmi.Remote) class java.rmi.server.RemoteObject (implements java.rmi.Remote, java.io.Serializable) class java.rmi.server.RemoteServer class javaimi.server.UnicastRemoteObject class com.ibm.jma.mail.impl.PostOfficeRMI (implements com.ibm.jma.mail.impl.PostOfficeRemoteRMI, com.ibm.jma.mail.PostOffice) class com.ibm.jma.message.handler.RequestMessageHandler (implements com.ibm.jma.message.handler.MessageHandler) class com.ibm.jma.message.handler.ATRequestMessageHandler class com.ibm.jma.message.handler.ResponseMessageHandler (implements com.ibm.jma.message.handier.MessageHandler) class com.ibm.jma.message.handler.ATResponseMessageHandler class com.ibm.jma.mail.impl.SOLMailQueue (implements com.ibm.jma.mail.MailQueue) class java.lang.Throwable (implements java.io.Serializable) class java.lang.Exception class com.ibm.jma.agent.AgentException class com.ibm.jma.mail.impl.NoSuchMailException class com.ibm.jma.mail.impl.NoImplemented Exception class com.ibm.jma.mail.URL (implements java.io.Serializable) TABLE 9 All Packages Class Hierarchy A B C D E F G H I J K L M N O P Q R S T U V W X Y Z Index of all Fields and Methods A action(Event, Object). Method in class com.ibm.jma.mail.impl.POServer Agent(). Constructor for class com.ibm.jma.agent.Agent AgentException(). Constructor for class com.ibm.jma.agent.AgentException AgentException(String). Constructor for class com.ibm.jma.agent.AgentException AgentID(byte[]). Constructor for class com.ibm.j | ||||||
