org.cougaar.demo.ping
Class PingSender

java.lang.Object
  extended by org.cougaar.util.GenericStateModelAdapter
      extended by org.cougaar.core.blackboard.BlackboardClientComponent
          extended by org.cougaar.core.plugin.ComponentPlugin
              extended by org.cougaar.core.plugin.ParameterizedPlugin
                  extended by org.cougaar.core.plugin.AnnotatedSubscriptionsPlugin
                      extended by org.cougaar.core.plugin.TodoPlugin
                          extended by org.cougaar.demo.ping.PingSender
All Implemented Interfaces:
org.cougaar.core.blackboard.BlackboardClient, org.cougaar.core.component.Component, org.cougaar.core.plugin.PluginBase, org.cougaar.util.GenericStateModel

public class PingSender
extends org.cougaar.core.plugin.TodoPlugin

This plugin is an example ping source that sends relays to a remote agent.

There can be multiple copies of this plugin in a single agent, but every PingSender must have a unique target. The target is specified as a plugin parameter:

target=String
Required remote agent name. If the agent doesn't exist then we wait forever -- there's no alarm-based timeout in this plugin implementation.

delayMillis=long
Delay milliseconds between relay iterations. Set the delay to zero to run the pings as fast as possible.

verbose=boolean
Output SHOUT-level logging messages. This can also be disabled by modifying the Cougaar logging configuration to set:
         log4j.category.org.cougaar.demo.ping.PingSender=FATAL
         log4j.category.org.cougaar.demo.ping.PingReceiver=FATAL
 
For simplicity we support this as a plugin parameter, so new users don't need to configure the logging service. If enabled, also consider turning off "+/-" message send/receive logging by setting:
         -Dorg.cougaar.core.agent.quiet=true
 

See Also:
Required plugin for every agent that will receive ping relays., Optional browser-based GUI.
System Properties:
org.cougaar.demo.ping.PingSender.delayMillis=5000PingSender delay between ping iterations, if not set as a plugin parameter.
org.cougaar.demo.ping.PingSender.verbose=truePingSender should output SHOUT-level logging messages, if not set as a plugin parameter.

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.cougaar.core.blackboard.BlackboardClient
org.cougaar.core.blackboard.BlackboardClient.Local
 
Field Summary
 long delayMillis
           
 org.cougaar.core.mts.MessageAddress target
           
 boolean verbose
           
 
Fields inherited from class org.cougaar.core.plugin.ParameterizedPlugin
args, log, uids
 
Fields inherited from class org.cougaar.core.blackboard.BlackboardClientComponent
agentId, agentIdentificationService, alarmService, blackboard, blackboardClientName
 
Fields inherited from interface org.cougaar.core.plugin.PluginBase
INSERTION_POINT
 
Fields inherited from interface org.cougaar.util.GenericStateModel
ACTIVE, IDLE, LOADED, UNINITIALIZED, UNLOADED
 
Fields inherited from interface org.cougaar.core.blackboard.BlackboardClient
current
 
Constructor Summary
PingSender()
           
 
Method Summary
 void executeRelay(org.cougaar.core.relay.SimpleRelay relay)
          Create our "isMyRelay" subscription and handle CHANGE callbacks
 boolean isRelayForAgent(org.cougaar.core.relay.SimpleRelay relay)
           
 void setArguments(org.cougaar.util.Arguments args)
           
protected  void setupSubscriptions()
           
 
Methods inherited from class org.cougaar.core.plugin.TodoPlugin
execute, executeLater, executeLater, publishAddLater, publishAddLater, publishChangeLater, publishChangeLater, publishChangeLater, publishChangeLater, publishRemoveLater, publishRemoveLater
 
Methods inherited from class org.cougaar.core.plugin.AnnotatedSubscriptionsPlugin
getSubscription
 
Methods inherited from class org.cougaar.core.plugin.ParameterizedPlugin
getParameter, getParameter, getParameter, getParameter, getParameterMap, getParameterValues
 
Methods inherited from class org.cougaar.core.plugin.ComponentPlugin
getConfigFinder
 
Methods inherited from class org.cougaar.core.blackboard.BlackboardClientComponent
currentTimeMillis, cycle, getAgentIdentifier, getAlarmService, getBindingSite, getBlackboardClientName, getBlackboardService, getMessageAddress, getParameter, getParameters, getServiceBroker, halt, load, precycle, requestCycle, resume, setAgentIdentificationService, setAlarmService, setBindingSite, setBlackboardService, setParameter, setSchedulerService, setServiceBroker, setSuicideService, shouldExecute, start, stop, suspend, toString, unload, wasAwakened
 
Methods inherited from class org.cougaar.util.GenericStateModelAdapter
getModelState, initialize, transitState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.cougaar.util.GenericStateModel
getModelState, halt, initialize, load, resume, start, stop, suspend, unload
 

Field Detail

target

public org.cougaar.core.mts.MessageAddress target

delayMillis

public long delayMillis

verbose

public boolean verbose
Constructor Detail

PingSender

public PingSender()
Method Detail

setArguments

public void setArguments(org.cougaar.util.Arguments args)
Overrides:
setArguments in class org.cougaar.core.plugin.ParameterizedPlugin

setupSubscriptions

protected void setupSubscriptions()
Overrides:
setupSubscriptions in class org.cougaar.core.plugin.TodoPlugin

executeRelay

public void executeRelay(org.cougaar.core.relay.SimpleRelay relay)
Create our "isMyRelay" subscription and handle CHANGE callbacks


isRelayForAgent

public boolean isRelayForAgent(org.cougaar.core.relay.SimpleRelay relay)