demo
Class PrintEnvComponent

java.lang.Object
  |
  +--demo.PrintEnvComponent
All Implemented Interfaces:
xcat.framework.ccacore.Component

public class PrintEnvComponent
extends java.lang.Object
implements xcat.framework.ccacore.Component

Corresponds to the functionality of printenv.c. Can be initialized with the names of System properties, then called to write them out with their current values to a file. Implements the CCA Component interface. Uses event channel to send messages concerning state.


Constructor Summary
PrintEnvComponent()
          Empty constructor, as required by CCA specification.
 
Method Summary
 void init(java.lang.String[] _args)
          Sets the internal args field to the array reference.
 void setServices(xcat.framework.ccacore.Services core)
          Method defined by the Component interface.
 void write()
          Writes the current set of System properties names and their corresponding values to the file "env-vars".
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrintEnvComponent

public PrintEnvComponent()
Empty constructor, as required by CCA specification.
Method Detail

setServices

public void setServices(xcat.framework.ccacore.Services core)
Method defined by the Component interface. Registers and adds ports (in this case, a parameterized control provides port and a PrintEnv provides port).
Specified by:
setServices in interface xcat.framework.ccacore.Component
Parameters:
core - reference to XCAT framework Services.

init

public void init(java.lang.String[] _args)
          throws java.lang.Exception
Sets the internal args field to the array reference. Constructs a print writer to write to a file called "env-vars" placed in the current working directory.
Parameters:
_args - array of Strings, the names of the System properties to be written to file.

write

public void write()
Writes the current set of System properties names and their corresponding values to the file "env-vars". If the PrintWriter was not constructed, returns.