Specifying an Agent Transporter in agent itineraries

Constructing an agent's itinerary that contains an Agent Transporter destination requires a slightly different naming scheme than usual. Typically, a destination specified as "MyHost1" implies that a full Concordia Server is at the receiving end of an agent transmission on MyHost1. In the case where a lightweight Agent Transporter is the receiver, the destination must specify both the hostname and the Agent Transporter name using RMI format. For example: "rmi://MyHost1/DBAccessTransporter". If a reference to the AgentTransporter is available, the full RMI name can be obtained by calling its getName() method.

The method field of the itinerary works as usual. Specifying a method name in the destination will cause the AgentTransporter to invoke that method on the Agent, in the same way as the Concordia Server. Note that this occurs after the AgentTransporter has notified the AgentListeners (if any). Thus, when an agent arrives at the AgentTransporter, the following actions occur, in order:

  1. The AgentTransporter notifies the AgentListeners (if any). These AgentListeners may invoke methods on the agent.
  2. The AgentTransporter invokes the agent method specified in the agent's itinerary.
  3. The AgentTransporter sends the agent to its next destination.

Optionally, the method field in the itinerary destination may be specified as an empty string. This option is only valid if the destination is an AgentTransporter. This indicates that the AgentTransporter should skip action #2, and only notify the Agent Listeners of the agent activity. No agent methods will be invoked by the AgentTransporter, since the method field is blank.

The example code fragment below demonstrates a two-stop itinerary for a Concordia Agent. The agent with this itinerary first travels to a Concordia Server on MyHostOne to query a database, then to an Agent Transporter named DBAccessTransporter on MyHostTwo to report its findings:

Itinerary itin = new Itinerary;

itin.addDestination(new Destination("MyHostOne", "queryDatabase"));

itin.addDestination(new Destination("rmi://MyHostTwo/DBAccessTransporter", "reportResults"));