edu.cmu.cs.able.gauges.Siena
Class SienaTimeGaugeMgr

java.lang.Object
  |
  +--edu.cmu.cs.able.gaugeInfrastructure.Siena.SienaGaugeMgr
        |
        +--edu.cmu.cs.able.gauges.Siena.SienaTimeGaugeMgr
All Implemented Interfaces:
edu.cmu.cs.able.gaugeInfrastructure.GaugeMgr, java.lang.Runnable

public class SienaTimeGaugeMgr
extends edu.cmu.cs.able.gaugeInfrastructure.Siena.SienaGaugeMgr
implements java.lang.Runnable

This is the implementation of a gauge manager for the SienaTimeGauge. It starts a separate process for the gauge using the Java Runtime exec method, and then optionally tracks and prints the output from the stdout and stderr of the gauge.


Field Summary
 java.lang.String senp
           
 
Fields inherited from class edu.cmu.cs.able.gaugeInfrastructure.Siena.SienaGaugeMgr
gauges
 
Constructor Summary
SienaTimeGaugeMgr(java.lang.String senp, boolean register)
          Creates new SienaTimeGaugeMgr
 
Method Summary
 edu.cmu.cs.able.gaugeInfrastructure.GaugeControl createGauge(edu.cmu.cs.able.gaugeInfrastructure.util.GaugeID gauge, edu.cmu.cs.able.gaugeInfrastructure.util.StringPairVector setupParams, edu.cmu.cs.able.gaugeInfrastructure.util.StringPairVector mappings)
          Creates a new gauge as a separate process.
 boolean deleteGauge(edu.cmu.cs.able.gaugeInfrastructure.GaugeControl gauge)
          Deletes the gauge process associated with the gauge ID.
static void main(java.lang.String[] args)
          A way to start the gauge manager from the command line.
 boolean managesType(java.lang.String gaugeType)
          Returns true if the gauge type is edu.cmu.cs.able.gauges.Siena.SienaTimeGauge
static void printUsageMessage()
          Prints the usage message.
 boolean queryMetaInfo(java.lang.String gaugeType, edu.cmu.cs.able.gaugeInfrastructure.util.StringPairVector configParamsMeta, edu.cmu.cs.able.gaugeInfrastructure.util.StringPairVector valuesMeta)
          Returns the parameters that can be used to configure the gauge, as well as the values reported by the gauge, for a particular gauge type.
 void run()
          Implements the run method for threads.
 
Methods inherited from class edu.cmu.cs.able.gaugeInfrastructure.Siena.SienaGaugeMgr
getGaugeMgrID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

senp

public java.lang.String senp
Constructor Detail

SienaTimeGaugeMgr

public SienaTimeGaugeMgr(java.lang.String senp,
                         boolean register)
Creates new SienaTimeGaugeMgr
Parameters:
senp - The Siena port to connect to to receive information from gauge consumers and gauges.
register - Indicates whether the gauge manager should be registed with the bus.
Method Detail

createGauge

public edu.cmu.cs.able.gaugeInfrastructure.GaugeControl createGauge(edu.cmu.cs.able.gaugeInfrastructure.util.GaugeID gauge,
                                                                    edu.cmu.cs.able.gaugeInfrastructure.util.StringPairVector setupParams,
                                                                    edu.cmu.cs.able.gaugeInfrastructure.util.StringPairVector mappings)
Creates a new gauge as a separate process.
Overrides:
createGauge in class edu.cmu.cs.able.gaugeInfrastructure.Siena.SienaGaugeMgr
Parameters:
gauge - The ID of the gauge to create.
setupParams - The setup parameters to pass to the new gauge.
mappings - The mappings to pass to the new gauge.
Returns:
A "dummy" gauge control that has the new ID.

deleteGauge

public boolean deleteGauge(edu.cmu.cs.able.gaugeInfrastructure.GaugeControl gauge)
Deletes the gauge process associated with the gauge ID.
Overrides:
deleteGauge in class edu.cmu.cs.able.gaugeInfrastructure.Siena.SienaGaugeMgr
Parameters:
gauge - The gauge to be deleted.
Returns:
Whether the process was destroyed successfully.

managesType

public boolean managesType(java.lang.String gaugeType)
Returns true if the gauge type is edu.cmu.cs.able.gauges.Siena.SienaTimeGauge
Overrides:
managesType in class edu.cmu.cs.able.gaugeInfrastructure.Siena.SienaGaugeMgr
Parameters:
gaugeType -  
Returns:
 

queryMetaInfo

public boolean queryMetaInfo(java.lang.String gaugeType,
                             edu.cmu.cs.able.gaugeInfrastructure.util.StringPairVector configParamsMeta,
                             edu.cmu.cs.able.gaugeInfrastructure.util.StringPairVector valuesMeta)
Returns the parameters that can be used to configure the gauge, as well as the values reported by the gauge, for a particular gauge type.
Overrides:
queryMetaInfo in class edu.cmu.cs.able.gaugeInfrastructure.Siena.SienaGaugeMgr
Parameters:
gaugeType - The type of the gauge about which to get information.
configParamsMeta - Will fill this vector with [("frequency", "int"), ("report", "boolean")]
valuesMeta - Will fill this vector with [("date", "string")]
Returns:
 

run

public void run()
Implements the run method for threads. This method (if gauge stderr and stdin are being tracked) will periodically output the values to stdout of the gauge manager.
Specified by:
run in interface java.lang.Runnable

main

public static void main(java.lang.String[] args)
A way to start the gauge manager from the command line.
Parameters:
args - -senp siena port
[-debug] [-silent]
-debug indicates whether debugging information should be displayed
-silent indicates whether the gauge outputs should be tracked.

printUsageMessage

public static void printUsageMessage()
Prints the usage message.