Site Navigation


GME Configuration and Application Programming Interfaces (APIs)

GME Configuration File Settings

There is a sample configuration file available in /conf directory The file localhost-gme-minimal-config.xml contains a basic setup for a GME server to run on the local machine.

The localhost config files should never be used for more than single GME testing purposes. When other GMEs connect to it, it will identify itself as localhost, which when the connecting GME attempts to resolve will cause problems.

The GME server contains several resources that provide certain functionality and information to other GME components. These resources are instantiated by the GME server at startup, and are configured by the config file. The four resources for the GME are:

  1. Mobius Configuration <resource name="mobiusConfig"... >
  2. GME Database Manager <resource name="gmeDataBaseManager"... >
  3. GME Configuration <resource name="gmeConfig"... >
  4. Authority Manager <resource name="authorityManager"... >
  5. Subordinate Manager <resource name="subordianteManager"... >

These resources must be specified in order in the config file due to dependencies on the other resources, and all of them must exist.

Mobius Configuration

The Mobius Configuration section is common to all Mobius Network Services. This block defines the Network Service Descriptor the service will use when identifying itself on the Grid, and the handlers for the various protocols in the server. This resource is defined under the element <resource name="mobiusConfig" class="org.projectmobius.services.common.MobiusConfiguration">. All resources are specified in this way; the name attribute is the name the resource will have in the resource manager and the class attribute is the class within Mobius that will be associated with that resource.

The Mobius Configuration has two elements:

<MobiusNetworkServiceDescriptor>
All Mobius services have a Mobius Network Service Descriptor that they use to describe themselves to other services within Mobius. The "serviceType" attribute defines what kind of service this is. For the GME, set this to GME. The hostname attribute defines the name of the host this service is running on. The children of the Mobius Network Service Descriptor describe the service:
<serviceIdentifier>
This element describes the service identification string used to uniquely identify a Mobius Service within the Grid.
<ports>
This element describes the ports the service will use for communication.
<aliases>
This element defines any aliases for the host of the service. Aliases are needed when a host has more than one physical network connection. An <alias> element has attributes id and hostname that define the identification and the hostname that each network interface maps to. This is especially important for authority/subordinate communication, because a GME will not authenticate an authority or subordinate that tries to connect using a hostname that is not a valid alias or true hostname. A host might have multiple hostnames if it is part of a cluster and/or has multiple network interface cards installed. If the host does not have any extra network interfaces, it is safe to leave the <aliases> element empty.
<handlers>
The handlers define what classes the GME should use to handle certain protocol requests and responses. Changing these from the way they are defined in the example localhost-gme-config.xml will likely break some functionality.

GME Database Manager

This resource contains information about the databases the GME will use and enables access and modification of the databases. This resource is defined under the element

<resource name="gmeDatabaseManager" class="org.projectmobius.services.gme.GMEDatabaseManager"gt; The resource element has a child called <gme-configuration ...> that contains the con- figuration information for the resource.

The GME Database Manager has several important elements configurable elements:

<root-database-name>
This element sets the name of the mysql root database. This is generally ROOT.
<registry-database-name>
This element sets the name of the GMERegistry database. This database will store namespace information and connection data.
<schema-store-database-name>
This element sets the name of the database in which schemata are stored.
<root-database>
This element configures the mysql root database information. The GME Database Manager uses this information to determine if the other databases it uses exist and to create them if they do not. The children of this element configure the database:
<name>
This element specifies the name of the database. For mysqls root database, this should be nothing.
<driver>
The driver class for accessing the mysql database.
<urlPrefix>
The url prefix for accessing the database.
<host>
The host the database lives on. Usually, this will be localhost.
<port>
The port via which the database can be accessed.
<username>
The username to log into the database with. This username must have privileges to add and remove databases and tables.
<password>
The password to authenticate the username.
<pool>
This element determines how many connections to the database will be made initially. When the GME needs to communicate with the database, it will get a connection, and when its done, it releases it. Should the Database Manager run out of available connections, it will make a new one, but this causes a slight delay. Set the pool value in anticipation of how many concurrent database operations will be needed.
<databases>
This element has children formatted identically to the <root-database> element. These elements define parameters for accessing the schema store database and the registry database. Set the name values of each to match the values defined by the <schema-store-database-name> and the <registry-database-name> elements.

GME Configuration

The GME Configuration resource keeps track of anything specific to the GME Server, including its network service descriptor, namespaces, handlers for events, and server policies. This resource is defined under the <resource name="gmeConfig" class="org.projectmobius.services.gme.GMEConfiguration"> element. This element has a child called <gme-configuration ...> that specifies the information GME Configuration needs:

<gme-communication-protocol>
This element defines the protocol the GME will use for communication. Set this to TCP.
<factories>
The factories define what class the GME will use to produce handles to other GMEs. If no factories element is present, the GME will use a default factory.
<policies>
The policies define how the GME server should behave with respect to keeping old data laying arround:
<performance-caching>
This element tells the GME how much and how long to keep data about namespaces and schemata.
<namespace-caching>
This element has an attribute called max-records that tells the GME how many namespaces to keep track of, and another one named time-to-live that defines how long a discovered namespace record will remain in the database.
<schema-caching>
The attribute max-schemas tells the GME server the maximum number of schemas it will keep in its database.
<schema-lookup>
The attribute time-to-live defines how long a discovered schema will remain in the database.
<quality-caching>
This element tells the GME what other namespaces to notify of changes.
<notification-policy>
This element specifies a list of other hosts to notify.

Authority Manager

The Authority Manager keeps track of information about authorities for the GME Server. This resource is defined by the element <resource name="authorityManager" class="org.projectmobius.services.gme.AuthorityManager"gt;, which has a child element <gme-configuration>which then has a child element <factories> This element defines the factory that will be used for creating an instance of the Authority Manager Database. If no factories element is present, the GME will use the default factory.

Subordinate Manager

The Subordinate Manager keeps track of information about subordinate GMEs for the GMEServer. This resource is defined by the element <resource name="subordinateManager" class="org.projectmobius.services.gme.SubordinateManager"gt;, which has a child element <gme-configuration>, which has a child of its own called <factories> The factories element defines the factory to be used when creating an instance of the Subordinate Manager Database. If no factories element is present, the GME will use the default factory.

GME Application Programming Interfaces (APIs)

To facilitate use of the GME within the context of another program, there is a client API in the org.projectmobius.client.gme package. The GME is accessed via a handle, and the handle is produced by a factory. The XMLDataModelServiceFactory interface provides the specification for the factory, and its default implementation is DefaultXMLDataModelServiceFactory.

diagram of the api layers of gme

Diagram of GME API layers

The handle that provides access to the functions of the GME is defined in the interface XMLDataModelService and the default implementation of it can be found in XMLDataModelServiceHandle. A handle should not be created directly by a factory, but rather created using the XMLDataModelServiceResolver class. This class provides a mechanism to associate a factory with a service Id, so that correct handles can be produced for GMEs in different situations. The XMLDataModelServiceResolver has a method called associateFactory that enables the user to specify which factory should be used to make a handle to a given service. If the service resolver is asked for a handle to a service Id it has no factory for, the default factory is used.

Here is an example instantiation of a handle to a GME:


XMLDataModelServiceHandle handle =
XMLDataModelServiceResolver.getInstance().getXMLDataModelServiceHandle(<serviceId>);

where <serviceId> is a String representation of the service ID the GME is running on.