aleph
Class Host

java.lang.Object
  |
  +--aleph.Host

public class Host
extends java.lang.Object
implements java.io.Serializable

A Host is a machine running the Aleph Server. Multiple PEs coexist on a host.

See Also:
aleph.CommunicationManager, java.io.serializable, Serialized Form

Constructor Summary
Host(java.lang.String hostName)
          Constructor.
 
Method Summary
static java.util.Iterator allHosts()
           
 boolean equals(java.lang.Object anObject)
           
 int hashCode()
           
 boolean ping()
           
static java.util.Iterator roundRobin()
           
static int size()
           
 void startPE(Address parent, Address console, int index, int numPEs, java.lang.Integer id, java.lang.String label, java.lang.String[] args, java.util.Properties properties)
          start a new PE
 boolean stop()
          Shuts down a server.
static Host thisHost()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Host

public Host(java.lang.String hostName)
     throws java.net.UnknownHostException
Constructor.
Parameters:
hostName - string name for host
Throws:
java.net.UnknownHostException - if hostName can't be resolved
Method Detail

startPE

public void startPE(Address parent,
                    Address console,
                    int index,
                    int numPEs,
                    java.lang.Integer id,
                    java.lang.String label,
                    java.lang.String[] args,
                    java.util.Properties properties)
start a new PE
Parameters:
parent - Parent PE's address
console - Console's address
index - index of this PE in group
numPEs - total number in group
id - per/hunique
label - suggestive label
args - user's args
properties - caller's environment

ping

public boolean ping()
Returns:
whether a host seems to be running the server.

stop

public boolean stop()
             throws java.lang.SecurityException
Shuts down a server.
Returns:
whether shutdown is confirmed.
Throws:
java.lang.SecurityException - If caller is not allowed to kill this server.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object anObject)
Overrides:
equals in class java.lang.Object

thisHost

public static Host thisHost()
Returns:
the host on which we are running

allHosts

public static java.util.Iterator allHosts()
Returns:
iterator over currently known hosts

size

public static int size()
Returns:
number of currently known hosts

roundRobin

public static java.util.Iterator roundRobin()
Returns:
Iterate hosts in round-robin order.