Package com.gigaspaces.start

Provides bootstrapping support for the GigaSpaces Service Grid.

See:
          Description

Class Summary
Locator The Locator class derives the location of GigaSpaces Technologies system directories and provides various utilities for finding files and directories
SystemBoot Provides bootstrapping support for the GigaSpaces Service Grid.
SystemConfig Provides system configuration support.
SystemConfig.JMXServiceDescriptor Initialize RMI Registry and JMX Platform MBeanServer
 

Package com.gigaspaces.start Description

Provides bootstrapping support for the GigaSpaces Service Grid. The GigaSpaces Service Grid uses the JiniTM Technology Configuration approach augmented by using XML-based Configuration declarations as configuration overrides. This means that the default configuration attributes are loaded unless specific configuration file is provided, or specific XML-based configuration overrides are used. The GigaSpaces Service Grid startup loads all configuration entries with the component name of com.gigaspaces.start

Directory Structure Derivation

As previously explained, the Service Grid derives the runtime product directory structure at system initialization time. This approach is based on simple well-known and expected patterns. The intent is to remove additional configuration burdens made visible by environment setup constructs, and provide a simplified and effective product experience.

The Locator class will derive the location of the following values and return a Properties object to the calling class containing the following name/value pairs:

Key
Description
com.gs.home Root directory of the EE, the canonical path of the parent directory of the sub-directory where JSpaces.jar is located
com.gigaspaces.lib Directory where JSpaces.jar is located
com.gigaspaces.grid.home Root directory of the Service Grid, the canonical path of the parent directory of the sub-directory where gs-service.jar is located
com.gigaspaces.grid.lib The directory where gs-service.jar is located in the product distribution
com.gigaspaces.grid.boot.lib The directory where gs-boot.jar is located in the product distribution
com.gigaspaces.jini.lib
The directory where jsk-platform.jar is located in the product distribution


System Properties
Based on the derived directory structure, and minimal system information, the following system properties are set the SystemBoot class, as determined by invoking the SystemConfig.getSystemProperties() method:

Name
Value
Description
java.protocol.handler.pkgs net.jini.url
Provides support for HTTPMD based URLs
com.gs.home Derived from the Locator class

com.gs.localhost.name InetAddress.getHostAddress()
com.gs.container.name InetAddress.getHostName()
com.gs.jini_lus.groups “gigaspaces-“+ PlatformVersion.V_NUM The group name is the concatenation of the text “gigaspaces-“ with the version number of the current release.

Note: this property will only be populated if the com.j_spaces.kernel.PlatformVersion can be loaded
com.gigaspaces.grid.groups gs-grid Can be overridden by setting the com.gigaspaces.grid.groups property
com.gigaspaces.grid.home Derived from the Locator class
com.gigaspaces.lib Derived from the Locator class
com.gigaspaces.grid.lib Derived from the Locator class

Once the system initializes, the following properties are additionally added to the system :

Name
Description
com.gigaspaces.system.codeserver Indicates the address and port of the Webster instance created by this utility, in the form of : http://address:port
com.gigaspaces.system.registryPort
System property set when this utility starts an RMI Registry. Refer to the registryPort and registryRetries properties for additional infomration on configuring RMI Registry
com.gigaspaces.system.jmxServiceURL
System property set when this utility binds the JMX PlatformMBeanServer to the RMI Registry



Classpath
When the Service Grid starts, the classpath is set the to the following: gs-boot.jar (which has a Class-Path manifest entry to start.jar) and start.jar (which has a Class-Path manifest entry to jsk-platform.jar). The remaining jars are dynamically loaded by the CommonClassLoader based on the configuration property com.gigaspaces.start.platformJARs. The default JARs are as follows:

JARs
Location Loaded From
Description
JSpaces.jar
${com.gigaspaces.lib}
GigaSpaces Technology  platform
gs-space-framework.jar ${com.gigaspaces.grid.lib} Service Grid platform support for GigaSpaces framework
gsc-capabilities.jar
${com.gigaspaces.grid.lib}
Service Grid platform policies
gs-lib.jar ${com.gigaspaces.grid.boot.lib} Service Grid boot core
backport-util-concurrent.jar
${com.gigaspaces.lib}/common
This package is the backport of java.util.concurrent API, introduced in Java 5.0, to Java 1.4.
xalan.jar
xerxesImpl.jar
xml-apis.jar
${com.gigaspaces.lib}/xml
XML parsing and API support. All jars that are in this directory are loaded
jsk-lib.jar
${com.gigaspaces.jini.lib}
The Jini 2.1 technology required platform classes. More information on Jini technology can be found here
ant.jar
ant-launcher.jar
ant-commons-net.jar
commons-net-1.4.0.jar   jakarta-oro-2.0.8.jar
${com.gigaspaces.lib}/ant
Ant support. All jars that are in this directory are loaded. For more information on Ant go here.

It is important to understand the class loader hierarchy . The approach is to enable a platform oriented framework conducive towards creating a layered product. The resulting capabilities allow the declaration of JARs that are added to a CommonClassLoader, making the classes accessible by all ClassLoader instances that delegate to the CommonClassLoader. In this fashion a platform can be declared, initialized and made available.
 
The ClassLoader hierarchy when starting the Service Grid is as follows:

         AppCL
           |
       CommonCL (http:// URLs of common JARs)
           +
           |
   +-------+-------+----...---+
   |               |          |
Service-1CL   Service-2CL  Service-nCL


AppCL - Contains the main() class of the container. Main-Class in manifest points to com.gigaspaces.start.SystemBoot
Classpath:  gs-boot.jar, start.jar, jsk-platform.jar
Codebase: none

CommonClassLoader - Contains the common GigaSpaces (Service Grid) and Jini technology classes (and other declared common platform JARs) to be made available to its children.
Classpath: Common JARs such as gs-lib.jar
Codebase: Context dependent. The codebase returned is the codebase of the specific child CL that is the current context of the request.

Service-nCL - Contains the service specific implementation classes.
Classpath: serviceImpl.jar
Codebase: "serviceX-dl.jar gs-lib-dl-dl.jar jsk-lib-dl.jar"

Configuration
The Service Grid module additionally strives to simplify the configuration file requirements for the product. At this time all Jini technology service configuration files are located in one file called services.config, located in the config/services directory. There are no start-xxx.config files in the Service Grid distribution. All services that need to be created are considered service built-ins, and have their specific service starter com.sun.jini.start.ServiceDescriptor classes loaded from the product based on derived product directory locations.

The approach towards configuration attribute modification being taken is discourage the direct modification of the services.config file. Configuration property changes are accomplished instead by using configuration overrides.

A configuration override is  accomplished either by specifying the property=value on the command line when starting the Service Grid, or by creating an XML document which includes the configuration properties being override, The declared values will be used to override the properties declared in services.config, or used to override default attribute in the specific (sub-)component. All software components which use the Jini technology configuration mechanism can be modified using this technique. A simple example follows:
 
<override>
    <component Name="com.gigaspaces.start">
        <parameter Name="httpPort" Value="9010"/>
        <parameter Name="systemProperties">
            <![CDATA[
            new String[] { "com.gs.protocol", "RMI" }
            ]]>
        </parameter>
    </component>
    <component Name="com.gigaspaces.grid">
        <parameter Name="groups">
            <![CDATA[
            new String[] { "use-custom-group" }
            ]]>
        </parameter>
    </component>
</override>

There are three overrides in this example:
  1. com.gigaspaces.start.httpPort will indicate to SystemConfig to use 9010 as the port number to start the Webster instance
  2. com.gigaspaces.start.systemProperty will be used to add the com.gs.protocol=RMI as a system property
  3. com.gigaspaces.grid.groups declares the group name of "use-custom-group should override the default gs-grid group name

Configuration Properties
The Service Grid supports the following configuration entries; where each configuration entry name is associated with the component names com.gigaspaces.start and com.gigaspaces.grid

Configuration entries specific to com.gigaspaces.start
The Service Grid com.gigaspaces.start package supports the following configuration entries; where each configuration entry name is associated with the component name com.gigaspaces.start. The following configuration entries provide the opportunity to declaratively modify the operational behavior of the Service Grid


Configuration entries specific to com.gigaspaces.grid
The Service Grid com.gigaspaces.grid package supports the following configuration entries; where each configuration entry name is associated with the component name com.gigaspaces.grid. The following configuration entries provide the opportunity to declaratively modify the operational behavior of the Service Grid




Copyright (c) 2007 GigaSpaces Technologies, Inc.
All Rights Reserved.