Console / ConsoleImpl

The Console implements the "model" and "control" of the Model/View/Controller pattern. In order to keep the data in the model consistant, all actions that potentially modify the data should go through the Console.

The ConsoleImpl is a concrete class that implements the Console interface.

Future iterations of the ConsoleImpl will perform more complex tasks - keeping track of the "state" of the system, handling all logging (from the java.util.logging package) - and so forth. It helps, but is not required, to start the Console up first, and then use it to start up the rest of the services.

Start Configuration

It is often convenient to start up the same configuration of HSPs, TaskServers, and Hosts. To support this, the ConsoleImpl can be invoked with -start config.xml. Please note that it is necessary for a Chameleon to be running on every host in the configuration. Additional documentation on this feature is located below.

Available Methods

command

public Object command( Object command ) throws RemoteException

From the TuiConsole, commands are usually an array of Strings. Currently, the supported commands are start service [host [options]], stop service [host], and chameleon command [arg ...].

getHsps

public AdministrableHsp[] getHsps() throws RemoteException

Get a reference to all the HSP's that have registered with the console.

shutdown

public void shutdown() throws RemoteException

Stop the Console (inherited from Adminstrable).

register

public boolean register( Service service, Service parent ) throws RemoteException

Register a service and who is the parent of the service (if possible - for example, the HSP has no parent).

getServices

public List getServices() throws RemoteException

Get a list of the remote references for all registered services.

getServiceTaskStats

public List getServiceTaskStats() throws RemoteException

Get the ServiceTaskStats for all registered services. (future work)

startup.xml

The configuration file is specified in XML, which nicely fits the heirarchical structure of a Jicos system: several Hosts associated with a TaskServer, one or more TaskServers associated with an HSP. See Figure 1 for an example configuration file, and Figure 2 for the DTD and a description of the elements and attributes.

  Figure 1: An example configuration file.
<?xml version="1.0"?>
<!-- Demo configuration. -->
<Jicos>
  <Desc>Test configuration</Desc>
  <JvmOptions>-Djicos.log.level=info</JvmOptions>
  <Defaults>
    <StartStyle>ssh</StartStyle>
  </Defaults>
  <Machines>
    <Machine name="csil"      addr="csil.cs.ucsb.edu"/>
    <Group name="gsl">
      <Machine name="dorsey"  addr="dorsey.cs.ucsb.edu"/>
      <Machine name="blind"   addr="blind.cs.ucsb.edu"/>
      <Machine name="duke"    addr="duke.cs.ucsb.edu"/>
      <Machine name="muddy"   addr="muddy.cs.ucsb.edu"/>
    </Group>
    <Group name="csil">
      <Machine name="yogi"    addr="yogi.cs.ucsb.edu"/>
      <Machine name="popeye"  addr="popeye.cs.ucsb.edu"/>
      <Machine name="bugs"    addr="bugs.cs.ucsb.edu"/>
      <Machine name="wacko"   addr="wacko.cs.ucsb.edu"/>
      <Machine name="dilbert" addr="dilbert.cs.ucsb.edu"/>
      <Machine name="cartman" addr="cartman.cs.ucsb.edu"/>
      <Machine name="stan"    addr="stan.cs.ucsb.edu"/>
      <Machine name="kenny"   addr="kenny.cs.ucsb.edu"/>
      <Machine name="kyle"    addr="kyle.cs.ucsb.edu"/>
      <Machine name="chef"    addr="chef.cs.ucsb.edu"/>
    </Group>
    <Group name="private">
      <Defaults>
        <StartStyle>chameleon</StartStyle>
      </Defaults>
      <Machine name="pc32"    addr="10.1.1.32"/>
      <Machine name="pc33"    addr="10.1.1.33"/>
      <Machine name="pc34"    addr="10.1.1.34"/>
      <Machine name="mac35"   addr="10.1.1.35"
                    startstyle="ssh"/>
    </Group>
  </Machines>
  <Hsp machine="csil" name="Instructional Labs" hosts="0">
    <Host group="csil"/>
    <Host group="csil"/>
    <TaskServer  group="gsl" name="TS-GSL" hosts="1">
      <Host group="gsl"/>
      <Host group="gsl"/>
      <Host group="gsl"/>
    </TaskServer>
    <TaskServer  group="csil" name="TS-CSIL" hosts="1">
      <Host group="csil"/>
      <Host group="csil"/>
      <Host group="csil"/>
      <Host group="csil"/>
      <Host group="csil"/>
      <Host group="csil"/>
    </TaskServer>
    <TaskServer  group="private" name="private" hosts="1">
      <Host group="private"/>
      <Host group="private"/>
      <Host group="private"/>
    </TaskServer>
  </Hsp>
</Jicos>


The above configuration file will start an Hsp on csil.cs.ucsb.edu, and TaskServers on dorsey.cs.ucsb.edu, bugs.cs.ucsb.edu, and pc32 (10.1.1.32) respectively. Two hosts from the csil group will be served by the internal TaskServer of the Hsp, four Hosts associated with dorsey, seven hosts with bugs, and 4 Hosts with pc32. All but the PC's will use ssh; the PC's will use chameleon.


Hsp (csil.cs.ucsb.edu)
      → Host (yogi.cs.ucsb.edu)
      → Host (popeye.cs.ucsb.edu)
  → Taskserver (dorsey.cs.ucsb.edu with TaskServer)
      → Host (dorsey.cs.ucsb.edu)
      → Host (blind.cs.ucsb.edu)
      → Host (duke.cs.ucsb.edu)
      → Host (muddy.cs.ucsb.edu)
  → Taskserver (bugs.cs.ucsb.edu)
      → Host (bugs.cs.ucsb.edu with TaskServer)
      → Host (wacko.cs.ucsb.edu)
      → Host (dilbert.cs.ucsb.edu)
      → Host (cartman.cs.ucsb.edu)
      → Host (stan.cs.ucsb.edu)
      → Host (kenny.cs.ucsb.edu)
      → Host (kyle.cs.ucsb.edu)
  → Taskserver (10.1.1.32 & using chameleon)
      → Host (10.1.1.32 with TaskServer)
      → Host (10.1.1.33 & using chameleon)
      → Host (10.1.1.34 & using chameleon)
      → Host (10.1.1.35)


  Figure 2: The configuration file DTD
<!DOCTYPE Jicos [


<!ELEMENT Jicos (Desc|JvmOptions|Machines|Hsp)>

<!ELEMENT Desc (#CDATA)>

<!ELEMENT JvmOptions (#CDATA)>

<!ELEMENT Defaults (StartStyle)>
<!ELEMENT StartStyle (ssh|chameleon)>


<!-- Machine list -->
<!>
<!ELEMENT Machines (Defaults?|Machine*|Group*)>

<!ELEMENT Group (Defaults?|Machine*)>
<!ATTLIST Group name CDATA #REQUIRED>

<!ELEMENT Machine EMPTY>
<!ATTLIST Machine name CDATA #REQUIRED>
<!ATTLIST Machine addr CDATA #REQUIRED>
<!ATTLIST Machine startstyle (ssh|chameleon) #IMPLIED>


<!-- Service configuration -->
<!>
<!ELEMENT Hsp (Defaults?|TaskServer*|Host*)>
<!ELEMENT TaskServer (Defaults?|Host+)>
<!ELEMENT Host EMPTY>

<!ATTLIST Hsp machine  CDATA  #IMPLIED>
<!ATTLIST Hsp group    CDATA  #IMPLIED>
<!ATTLIST Hsp hosts    CDATA  #IMPLIED>
<!ATTLIST Hsp name     CDATA  #IMPLIED>

<!ATTLIST TaskServer machine  CDATA     #IMPLIED>
<!ATTLIST TaskServer domain   CDATA     #IMPLIED>
<!ATTLIST TaskServer group    CDATA     #IMPLIED>
<!ATTLIST TaskServer hosts    CDATA     #IMPLIED>
<!ATTLIST TaskServer name     CDATA     #IMPLIED>
<!ATTLIST TaskServer exttype  (matlab)  #IMPLIED>

<!ATTLIST Host machine    CDATA           #IMPLIED>
<!ATTLIST Host domain     CDATA           #IMPLIED>
<!ATTLIST Host group      CDATA           #IMPLIED>
<!ATTLIST Host exttype    (matlab)        #IMPLIED>
<!ATTLIST Host startstyle (ssh|chameleon) #IMPLIED>


]>