com.gigaspaces.start
Class SystemConfig

java.lang.Object
  extended by com.gigaspaces.start.SystemConfig

public class SystemConfig
extends java.lang.Object

Provides system configuration support.


Nested Class Summary
static class SystemConfig.JMXServiceDescriptor
          Initialize RMI Registry and JMX Platform MBeanServer
 
Field Summary
static java.lang.String CODESERVER
          System property set indicating the address and port of the Webster instance created by this utility, in the form of : http://address:port
static java.lang.String JMX_SERVICE_URL
          System property set when this utility binds the JMX PlatformMBeanServer to the RMI Registry
static java.lang.String REGISTRY_PORT
          System property set when this utility starts an RMI Registry
static java.lang.String UNKNOWN
          Constant representing an unknown value
 
Method Summary
static java.lang.String[] appendOverrides(java.lang.String configFile)
          If this utility has been started with override arguments, append the override arguments to the configuration file
static java.lang.String getBuildNumber()
          Get the build number from the PlatformVersion.
 net.jini.config.Configuration getConfiguration()
          Get the Configuration created by this utility
 java.lang.String[] getConfigurationArgs()
          Get the configuration arguments used by this utility
 java.lang.String[] getConfigurationParms()
          Get the configuration parameters used to create this utility.
 com.sun.jini.start.ServiceDescriptor getGSCServiceDescriptor()
          Get the ServiceDescriptor for the GSC
 com.sun.jini.start.ServiceDescriptor getGSMServiceDescriptor()
          Get the ServiceDescriptor for the GSM
 com.sun.jini.start.ServiceDescriptor getGSServiceDescriptor()
          Get the ServiceDescriptor for the GigaSpaces service
static SystemConfig getInstance()
          Get an instance of the SystemConfig object that has been previously created with configuration arguments.
static SystemConfig getInstance(java.lang.String[] configArgs)
          Get an instance of the SystemConfig object
 com.sun.jini.start.ServiceDescriptor getJMXServiceDescriptor()
          Get the ServiceDescriptor to start JMX
 com.sun.jini.start.ServiceDescriptor getLookupHandlerServiceDescriptor()
          Get the ServiceDescriptor for LookupHandler.
 com.sun.jini.start.ServiceDescriptor getMahaloServiceDescriptor()
          Get the ServiceDescriptor for Mahalo transaction manager
 java.lang.String[] getOverrides()
          Get the configuration overrides this utility was created with
 java.net.URL[] getPlatformJars()
          Get the platformJars
 java.util.Collection getServiceDescriptors(java.lang.String[] keys)
          Get ServiceDescriptor instances for the following keys
 java.util.Properties getSystemDirectories()
          Get derived directory locations
 java.util.Properties getSystemProperties()
          Get configured system properties
static java.lang.String getVersionNumber()
          Get the version number from the PlatformVersion.
 org.jini.rio.tools.webster.Webster getWebster()
          Create a Webster instance
 int getWebsterPort()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNKNOWN

public static final java.lang.String UNKNOWN
Constant representing an unknown value

See Also:
Constant Field Values

CODESERVER

public static final java.lang.String CODESERVER
System property set indicating the address and port of the Webster instance created by this utility, in the form of :
http://address:port

See Also:
Constant Field Values

REGISTRY_PORT

public static final java.lang.String REGISTRY_PORT
System property set when this utility starts an RMI Registry

See Also:
Constant Field Values

JMX_SERVICE_URL

public static final java.lang.String JMX_SERVICE_URL
System property set when this utility binds the JMX PlatformMBeanServer to the RMI Registry

See Also:
Constant Field Values
Method Detail

getInstance

public static SystemConfig getInstance(java.lang.String[] configArgs)
                                throws net.jini.config.ConfigurationException
Get an instance of the SystemConfig object

Parameters:
configArgs - An array whose first element is the location of the configuration source and remaining elements specify override values for entries that will be used to create the SystemConfig singleton for the system. If the SystemConfig instance has already been created this parameter is optional
Returns:
The SystemConfig instance
Throws:
net.jini.config.ConfigurationException

getInstance

public static SystemConfig getInstance()
Get an instance of the SystemConfig object that has been previously created with configuration arguments. This is a utilty method for clients to obtain the previously created SystemConfig instance

Returns:
The SystemConfig instance. If the SystemConfig instance has not been previously created usng a configurationwhen this method is called, a RuntimeException is thrown

getSystemDirectories

public java.util.Properties getSystemDirectories()
Get derived directory locations

Returns:
Properties contain name/value pairs of derived product locations. A new Properties object is allocated each time this method returns.

getConfigurationArgs

public java.lang.String[] getConfigurationArgs()
Get the configuration arguments used by this utility


getConfigurationParms

public java.lang.String[] getConfigurationParms()
Get the configuration parameters used to create this utility. If this utility was created with no (or null) parameters, a zero-length String array will be returned


getConfiguration

public net.jini.config.Configuration getConfiguration()
Get the Configuration created by this utility


appendOverrides

public static java.lang.String[] appendOverrides(java.lang.String configFile)
If this utility has been started with override arguments, append the override arguments to the configuration file

Parameters:
configFile - The file to append to, this parameter must not be null
Returns:
A String array, with the first element being the configFile parameter, each subsequent element a corresponding override argument this utility was started with. If there are no override arguments, the array will contain only the configFile parameter.

getOverrides

public java.lang.String[] getOverrides()
Get the configuration overrides this utility was created with

Returns:
The configuration overrides this utility was created with. If no configuration overrides were provided, this method returns null

getPlatformJars

public java.net.URL[] getPlatformJars()
                               throws java.net.MalformedURLException,
                                      net.jini.config.ConfigurationException
Get the platformJars

Returns:
URL[] An array of URL resources indicating the jars the common ClassLoader must add.
Throws:
java.net.MalformedURLException - If the URL resources result in an improperly formatted URL
net.jini.config.ConfigurationException - If there are errors accessing the configuration

getSystemProperties

public java.util.Properties getSystemProperties()
                                         throws net.jini.config.ConfigurationException,
                                                java.net.UnknownHostException
Get configured system properties

Throws:
net.jini.config.ConfigurationException
java.net.UnknownHostException

getWebsterPort

public int getWebsterPort()

getWebster

public org.jini.rio.tools.webster.Webster getWebster()
                                              throws java.net.BindException,
                                                     net.jini.config.ConfigurationException,
                                                     java.net.UnknownHostException
Create a Webster instance

Returns:
A Webster instance
Throws:
net.jini.config.ConfigurationException
java.net.BindException
java.net.BindException - If the Webster instance could not be created
net.jini.config.ConfigurationException - If errors occur reading the configuration
java.net.UnknownHostException

getLookupHandlerServiceDescriptor

public com.sun.jini.start.ServiceDescriptor getLookupHandlerServiceDescriptor()
                                                                       throws java.net.BindException,
                                                                              java.net.UnknownHostException,
                                                                              net.jini.config.ConfigurationException
Get the ServiceDescriptor for LookupHandler.

Returns:
A ServiceDescriptor suitable for the creation of the lookup handler
Throws:
java.net.UnknownHostException - If the codebase cannot be constructed
java.net.BindException - If the Webster instance could not be created
net.jini.config.ConfigurationException - If errors occur reading the configuration or the default configuration file cannot be located

getMahaloServiceDescriptor

public com.sun.jini.start.ServiceDescriptor getMahaloServiceDescriptor()
                                                                throws java.net.BindException,
                                                                       java.net.UnknownHostException,
                                                                       net.jini.config.ConfigurationException
Get the ServiceDescriptor for Mahalo transaction manager

Returns:
A ServiceDescriptor suitable for the creation of the Mahalo transaction manager
Throws:
java.net.UnknownHostException - If the codebase cannot be constructed
java.net.BindException - If the Webster instance could not be created
net.jini.config.ConfigurationException - If errors occur reading the configuration or the default configuration file cannot be located

getServiceDescriptors

public java.util.Collection getServiceDescriptors(java.lang.String[] keys)
                                           throws java.net.BindException,
                                                  java.net.UnknownHostException,
                                                  net.jini.config.ConfigurationException
Get ServiceDescriptor instances for the following keys

Parameters:
keys - Array of String values that map to ServiceDescriptor definitions for the Grid Service Container, Grid Service Monitor pr GigaSpaces
Returns:
An Collection of ServiceDescriptor instances that can be used to start services. A new Collection is allocated each time. If no matching services are found, a zero-lengh Collection is returned.
Throws:
net.jini.config.ConfigurationException
java.net.UnknownHostException
java.net.BindException

getGSCServiceDescriptor

public com.sun.jini.start.ServiceDescriptor getGSCServiceDescriptor()
                                                             throws java.net.UnknownHostException,
                                                                    java.net.BindException,
                                                                    net.jini.config.ConfigurationException
Get the ServiceDescriptor for the GSC

Throws:
java.lang.IllegalArgumentException - if the root or gsLib directories do not exist or cannot be read from
java.net.UnknownHostException - If the codebase cannot be constructed
java.net.BindException - If the Webster instance could not be created
net.jini.config.ConfigurationException - If errors occur reading the configuration or the default configuration file cannot be located

getGSMServiceDescriptor

public com.sun.jini.start.ServiceDescriptor getGSMServiceDescriptor()
                                                             throws java.net.UnknownHostException,
                                                                    java.net.BindException,
                                                                    net.jini.config.ConfigurationException
Get the ServiceDescriptor for the GSM

Throws:
java.lang.IllegalArgumentException - if the root or gsLib directories do not exist or cannot be read from
java.net.UnknownHostException - If the codebase cannot be constructed
java.net.BindException - If the Webster instance could not be created
net.jini.config.ConfigurationException - If errors occur reading the configuration or the default configuration file cannot be located

getJMXServiceDescriptor

public com.sun.jini.start.ServiceDescriptor getJMXServiceDescriptor()
                                                             throws net.jini.config.ConfigurationException
Get the ServiceDescriptor to start JMX

Throws:
net.jini.config.ConfigurationException - If errors occur reading the configuration or the default configuration file cannot be located

getGSServiceDescriptor

public com.sun.jini.start.ServiceDescriptor getGSServiceDescriptor()
                                                            throws java.net.UnknownHostException,
                                                                   java.net.BindException,
                                                                   net.jini.config.ConfigurationException
Get the ServiceDescriptor for the GigaSpaces service

Throws:
java.lang.IllegalArgumentException - if the root or gsLib directories do not exist or cannot be read from
java.net.UnknownHostException - If the codebase cannot be constructed
java.net.BindException - If the Webster instance could not be created
net.jini.config.ConfigurationException - If errors occur reading the configuration or the default configuration file cannot be located

getBuildNumber

public static java.lang.String getBuildNumber()
Get the build number from the PlatformVersion. If the PlatformVersion class cannot be loaded, and empty string is returned


getVersionNumber

public static java.lang.String getVersionNumber()
Get the version number from the PlatformVersion. If the PlatformVersion class cannot be loaded, and empty string is returned



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