This section describes in detail the three phases involved in communication between an instrumented application and its manager. The three phases of the AMI conversation are:
Figure 10 illustrates the three phases of an AMI conversation.
At the end of the discovery phase, the manager and the application have established a connection that allows them to communicate through the inbox address. However, the manager is not yet aware of any details of the application’s interface.
After the manager and application have exchanged announcement or discovery messages, the manager then sends a message asking the application to describe its methods. Every instrumented application must implement these methods.
The message sent to the manager in describe method has nested inside it a series of messages that describe each method. These are known as method descriptor messages. Each method descriptor message has messages nested inside it, which describe the types of arguments and types of returns applicable to each method. This is illustrated in
Figure 13. From this description, the manager determines what structure of message to send when invoking the method, as well as how to interpret the message the application sends back.
At the end of the method description phase, the manager is aware of all message exchanges supported by the application and is ready to begin sending messages of the specified types.
After the application has been discovered and the methods have been described, the real work takes place. Acting either on cues from a human user or by processing the rules in a rulebase, the manager sends messages to the application invoking the described methods and awaits its reply. The method invocation messages sent by the manager conform to descriptions given by the application in the describe method as to which arguments are appropriate for each method.
When the manager receives the response to its method call, it presents the returned information to the human user. This scenario repeats itself over and over again until the session is terminated by either the application or the manager.