jgroup.relacs.config
Class DistributedSystemConfig

java.lang.Object
  extended by jgroup.relacs.config.DistributedSystemConfig
All Implemented Interfaces:
ConfigurationObject

public final class DistributedSystemConfig
extends java.lang.Object
implements ConfigurationObject

The DistributedSystemConfig object contains a description of the distributed system on which distributed computations can be executed. Currently, a distributed system is described as a collection of domains and hosts, and is read into this object from an XML configuration file. See the Jgroup programmers manual for details about the format of this configuration file.

Since:
Jgroup 1.2
Author:
Alberto Montresor, Hein Meling

Constructor Summary
DistributedSystemConfig()
          Constructs an empty distributed system.
 
Method Summary
 boolean containsLocalHost()
          Returns true if the local host is specified in the distributed system configuration; false is returned otherwise.
 HostSet getAllHosts()
          Returns a set of all hosts parsed; independent of domain.
 DomainSet getDomainSet()
          Returns the parsed set of domains.
static Host getHost(java.net.InetAddress inetAdr)
          Returns the host object associated with the given internet address.
static Host getHost(MemberId member)
          Returns the host object associated with the given member.
static Domain getLocalDomain()
          Returns the domain endpoint that is considered local to this domain.
static Host getLocalHost()
          Returns the endpoint that is considered local to this host.
 int hashCode()
           
 int numOfDomains()
          Returns the number of domains parsed.
 void parse(org.w3c.dom.Element elm)
          Parses the specified element.
static void setLocalHost()
          Set the local host and add it to the set of available hosts.
 int size()
          Returns the size of all hosts parsed; independent of domain.
 java.lang.String toString()
          Returns a string representation of this object
 java.lang.String toString(boolean full)
          Returns a string representation of this object;
static boolean updateAll()
          Ping all hosts in the current configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DistributedSystemConfig

public DistributedSystemConfig()
Constructs an empty distributed system.

Method Detail

parse

public void parse(org.w3c.dom.Element elm)
           throws ConfigurationException
Parses the specified element.

Specified by:
parse in interface ConfigurationObject
Throws:
ConfigurationException

getDomainSet

public DomainSet getDomainSet()
Returns the parsed set of domains.


getAllHosts

public HostSet getAllHosts()
Returns a set of all hosts parsed; independent of domain.


size

public int size()
Returns the size of all hosts parsed; independent of domain.


numOfDomains

public int numOfDomains()
Returns the number of domains parsed.


getHost

public static Host getHost(MemberId member)
Returns the host object associated with the given member.


getHost

public static Host getHost(java.net.InetAddress inetAdr)
Returns the host object associated with the given internet address.


getLocalHost

public static Host getLocalHost()
Returns the endpoint that is considered local to this host.


getLocalDomain

public static Domain getLocalDomain()
Returns the domain endpoint that is considered local to this domain.


containsLocalHost

public boolean containsLocalHost()
Returns true if the local host is specified in the distributed system configuration; false is returned otherwise.


setLocalHost

public static void setLocalHost()
                         throws java.net.UnknownHostException
Set the local host and add it to the set of available hosts. This should be used with care, and only for bootstrap purposes since other servers will not find the local host unless it is specified in the config.xml file. Local host is not set if already defined in the configuration.

Throws:
java.net.UnknownHostException

updateAll

public static boolean updateAll()
Ping all hosts in the current configuration. Returns true if at least one host does not respond; i.e., the ExecService is not running on one or more hosts in the system. False indicates that all is well.


hashCode

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

toString

public java.lang.String toString()
Returns a string representation of this object

Overrides:
toString in class java.lang.Object

toString

public java.lang.String toString(boolean full)
Returns a string representation of this object;

Parameters:
full - If true, prints also the complete host set for each domain.


Copyright © 1998-2006 The Jgroup/ARM development team. All Rights Reserved.