com.bigdata.jini.start.config
Class JavaServiceConfiguration

java.lang.Object
  extended by com.bigdata.jini.start.config.ServiceConfiguration
      extended by com.bigdata.jini.start.config.JavaServiceConfiguration
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ManagedServiceConfiguration, ZookeeperServerConfiguration

public class JavaServiceConfiguration
extends ServiceConfiguration

A service that is implemented in java and started directly using java. The value of the "jvmargs" property in the com.bigdata.jini.start component will be combined with the "args" property for the specific service.

Version:
$Id$
Author:
Bryan Thompson
See Also:
Serialized Form

Nested Class Summary
 class JavaServiceConfiguration.JavaServiceStarter<V extends ProcessHelper>
          Starts a java service.
static interface JavaServiceConfiguration.Options
          Additional options understood by the JavaServiceConfiguration.
 
Nested classes/interfaces inherited from class com.bigdata.jini.start.config.ServiceConfiguration
ServiceConfiguration.AbstractServiceStarter<V extends ProcessHelper>
 
Field Summary
 String[] classpath
          Optional classpath override and otherwise null.
 String[] defaultJavaArgs
          Default JVM command line arguments.
 File javaHome
          The JAVA_HOME directory.
 String log4j
          The log4j URI (if specified and otherwise null).
 
Fields inherited from class com.bigdata.jini.start.config.ServiceConfiguration
args, className, constraints, log, options, replicationCount, serviceCount, serviceDir, timeout
 
Constructor Summary
JavaServiceConfiguration(String component, net.jini.config.Configuration config)
           
 
Method Summary
static String getClassName(String component, net.jini.config.Configuration config)
          Extract the value of the JavaServiceConfiguration.Options.CLASS_NAME from the configuration.
static String[] getClasspath(String className, net.jini.config.Configuration config)
           
static String[] getDefaultJavaArgs(String className, net.jini.config.Configuration config)
           
static File getJavaHome(String component, net.jini.config.Configuration config)
          Return the configured JAVA_HOME property value or the current value as reported by the java.home system property if the value was not explicitly configured.
static String getLog4j(String component, net.jini.config.Configuration config)
          Return the log4j configuration URI for this service type.
 JavaServiceConfiguration.JavaServiceStarter newServiceStarter(IServiceListener listener)
          Factory method returns an object that may be used to start an new instance of the service.
protected  void toString(StringBuilder sb)
          May be extended to add more properties to the ServiceConfiguration.toString() representation.
 
Methods inherited from class com.bigdata.jini.start.config.ServiceConfiguration
canStartService, canStartService, concat, getArgs, getClassPath, getConstraints, getDefaultTimeout, getOptions, getReplicationCount, getServiceCount, getServiceDir, getStringArray, getTimeout, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

javaHome

public final File javaHome
The JAVA_HOME directory.

See Also:
JavaServiceConfiguration.Options.JAVA_HOME

defaultJavaArgs

public final String[] defaultJavaArgs
Default JVM command line arguments.

See Also:
JavaServiceConfiguration.Options.DEFAULT_JAVA_ARGS

log4j

public final String log4j
The log4j URI (if specified and otherwise null).

See Also:
JavaServiceConfiguration.Options.LOG4J

classpath

public final String[] classpath
Optional classpath override and otherwise null.

See Also:
JavaServiceConfiguration.Options.CLASSPATH
Constructor Detail

JavaServiceConfiguration

public JavaServiceConfiguration(String component,
                                net.jini.config.Configuration config)
                         throws net.jini.config.ConfigurationException
Parameters:
component - The component (service configuration).
config - The Configuration.
Throws:
net.jini.config.ConfigurationException
Method Detail

toString

protected void toString(StringBuilder sb)
Description copied from class: ServiceConfiguration
May be extended to add more properties to the ServiceConfiguration.toString() representation.

Overrides:
toString in class ServiceConfiguration

newServiceStarter

public JavaServiceConfiguration.JavaServiceStarter newServiceStarter(IServiceListener listener)
                                                              throws Exception
Description copied from class: ServiceConfiguration
Factory method returns an object that may be used to start an new instance of the service.

Specified by:
newServiceStarter in class ServiceConfiguration
Throws:
Exception - if there is a problem creating the service starter.

getClassName

public static String getClassName(String component,
                                  net.jini.config.Configuration config)
                           throws net.jini.config.ConfigurationException
Extract the value of the JavaServiceConfiguration.Options.CLASS_NAME from the configuration.

Parameters:
component - The name of the component (service configuration).
config - The configuration.
Returns:
The name of the main class.
Throws:
net.jini.config.ConfigurationException
See Also:
Options#CLASS_NAME}

getJavaHome

public static File getJavaHome(String component,
                               net.jini.config.Configuration config)
                        throws net.jini.config.ConfigurationException
Return the configured JAVA_HOME property value or the current value as reported by the java.home system property if the value was not explicitly configured.

Parameters:
component -
config -
Returns:
Throws:
net.jini.config.ConfigurationException

getLog4j

public static String getLog4j(String component,
                              net.jini.config.Configuration config)
                       throws net.jini.config.ConfigurationException
Return the log4j configuration URI for this service type.

Parameters:
component - Identifies the service configuration.
config -
Returns:
The service specific log4j configuration URI or the global log4j configuration URI if none was specified for this service and null if no global entry was specified.
Throws:
net.jini.config.ConfigurationException
See Also:
JavaServiceConfiguration.Options.LOG4J

getDefaultJavaArgs

public static String[] getDefaultJavaArgs(String className,
                                          net.jini.config.Configuration config)
                                   throws net.jini.config.ConfigurationException
Throws:
net.jini.config.ConfigurationException

getClasspath

public static String[] getClasspath(String className,
                                    net.jini.config.Configuration config)
                             throws net.jini.config.ConfigurationException
Throws:
net.jini.config.ConfigurationException


Copyright © 2006-2011 SYSTAP, LLC. All Rights Reserved.