org.cougaar.core.relay
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.relay.PingSender
All Implemented Interfaces:
BlackboardClient, org.cougaar.core.component.Component, PluginBase, org.cougaar.util.GenericStateModel

public class PingSender
extends ComponentPlugin

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.core.relay.PingSender=FATAL
         log4j.category.org.cougaar.core.relay.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.core.relay.ping.delayMillis=5000PingSender delay between ping iterations, if not set as a plugin parameter.
org.cougaar.core.relay.ping.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
BlackboardClient.Local
 
Field Summary
 
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
protected  void execute()
          This method is called whenever a subscription changes.
 void load()
          This method is called when the agent is created
protected  void setupSubscriptions()
          This method is called when the agent starts.
 
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, 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, resume, start, stop, suspend, unload
 

Constructor Detail

PingSender

public PingSender()
Method Detail

load

public void load()
This method is called when the agent is created

Specified by:
load in interface org.cougaar.util.GenericStateModel
Overrides:
load in class BlackboardClientComponent

setupSubscriptions

protected void setupSubscriptions()
This method is called when the agent starts.

Specified by:
setupSubscriptions in class ComponentPlugin

execute

protected void execute()
This method is called whenever a subscription changes.

Specified by:
execute in class ComponentPlugin