org.cougaar.core.relay |
This package contains the Cougaar
support for "relays", which are generic blackboard objects that
transfer data between agents.
The {@link org.cougaar.core.relay.RelayLP} is included in the
{@link org.cougaar.core.domain.RootDomain}, which is loaded by
default. The {@link org.cougaar.core.relay.Relay} API is divided
into a sender-side {@link org.cougaar.core.relay.Relay.Source} and
destination-side {@link org.cougaar.core.relay.Relay.Target},
although most relay implementations implement both APIs. A source
specifies one or more target agents, the content, and a {@link
org.cougaar.core.relay.Relay.TargetFactory} factory for creating
the target-side representation of the relay. Each target-side
relay specifies an optional response to send back to the source.
A relay with an {@link org.cougaar.multicast.AttributeBasedAddress}
target will be sent to all members of the community and dynamically
added/removed as community members are added/removed.
The relay API is complex to allow maximal flexability. A simple
example is included: {@link
org.cougaar.core.relay.SimpleRelayExample} is a plugin that
publishes a {@link org.cougaar.core.relay.SimpleRelay} to send
a "ping" object to a target agent, and the target sends back
an "echo-ping" acknowledgement. See the {@link
org.cougaar.core.relay.SimpleRelayExample} javadoc for details.
For more detail, see the
Cougaar Developers' Guide.
|
Java Source File Name | Type | Comment |
Relay.java | Interface | A Relay is a blackboard object that allows a source agent
to stream content changes to multiple target agents, and
for each target to stream back a response.
The Relay API is a intended to be a generic mechanism for
transfering data between agents. |
RelayChangeReport.java | Class | A
ChangeReport to change the targets of a relay. |
RelayDirective.java | Class | A
org.cougaar.core.blackboard.Directive for relay
messages, which can add/change/remove a
Relay.Target and
send responses back to the
Relay.Source . |
RelayLP.java | Class | A
LogicProvider to transmit and update
Relay objects. |
SimpleRelay.java | Interface | A blackboard object API to send a query object to a remote agent,
which can optionally reply back to the sender. |
SimpleRelayBase.java | Class | Abstract base class for
SimpleRelay implementations. |
SimpleRelayExample.java | Class | This component is an example
SimpleRelay client, which
both sends relays and replies to them.
To use, add this component to an agent and specify a target,
for example in "AgentA" with a target of "AgentB":
<component
name='org.cougaar.core.relay.SimpleRelayExample(target=AgentB)'
class='org.cougaar.core.relay.SimpleRelayExample'
priority='COMPONENT'
insertionpoint='Node.AgentManager.Agent.PluginManager.Plugin'>
<argument>target=AgentB>/argument>
</component>
In the target agent add the component without a target argument:
<component
name='org.cougaar.core.relay.SimpleRelayExample(target=AgentB)'
class='org.cougaar.core.relay.SimpleRelayExample'
priority='COMPONENT'
insertionpoint='Node.AgentManager.Agent.PluginManager.Plugin'/>
You should see output similar to the following, which excludes
logging timestamps and other details:
.. |
SimpleRelaySource.java | Class | Source-side implementation of
SimpleRelay , which creates
the
SimpleRelayTarget on the target's blackboard.
Note that this class,
SimpleRelaySource , and the
target-side implementation,
SimpleRelayTarget , could be
easily merged into a single "SimpleRelayImpl" class. |
SimpleRelayTarget.java | Class | Target-side implementation of
SimpleRelay , constructed
by the
SimpleRelaySource . |