org.eclipse.jetty.start
Class Config

java.lang.Object
  extended by org.eclipse.jetty.start.Config

public class Config
extends Object

It allows an application to be started with the command "java -jar start.jar".

The behaviour of Main is controlled by the "org/eclipse/start/start.config" file obtained as a resource or file. This can be overridden with the START system property. The format of each line in this file is:

Each line contains entry in the format:

   SUBJECT [ [!] CONDITION [AND|OR] ]*
 

where SUBJECT:

property expansion:

Files starting with "/" are considered absolute, all others are relative to the home directory.

CONDITION is one of:

CONDITIONS can be combined with AND OR or !, with AND being the assume operator for a list of CONDITIONS.

Classpath operations are evaluated on the fly, so once a class or jar is added to the classpath, subsequent available conditions will see that class.

The configuration file may be divided into sections with option names like: [ssl,default]

Clauses after a section header will only be included if they match one of the tags in the options property. By default options are set to "default,*" or the OPTIONS property may be used to pass in a list of tags, eg. :

    java -jar start.jar OPTIONS=jetty,jsp,ssl
 

The tag '*' is always appended to the options, so any section with the * tag is always applied.


Field Summary
static String DEFAULT_SECTION
           
 
Constructor Summary
Config()
           
 
Method Summary
static void debug(String msg)
           
static void debug(Throwable t)
           
 Classpath getClasspath()
          Get the default classpath.
 Classpath getCombinedClasspath(Collection<String> sectionIds)
          Get the combined classpath representing the default classpath plus all named sections.
 String getMainClassname()
           
 Policy getPolicyInstance(ClassLoader cl)
           
 String getProperty(String name)
           
 String getProperty(String name, String dftValue)
           
 Classpath getSectionClasspath(String sectionId)
          Get the classpath for the named section
 Set<String> getSectionIds()
          Get the list of section Ids.
 List<String> getXmlConfigs()
           
static boolean isDebug()
           
 void parse(CharSequence buf)
          Parse the configuration
 void parse(InputStream stream)
          Parse the configuration
 void parse(Reader reader)
           
 void parse(URL url)
           
 void setArgCount(int argCount)
           
 void setProperty(String name, String value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_SECTION

public static final String DEFAULT_SECTION
See Also:
Constant Field Values
Constructor Detail

Config

public Config()
Method Detail

isDebug

public static boolean isDebug()

debug

public static void debug(String msg)

debug

public static void debug(Throwable t)

getClasspath

public Classpath getClasspath()
Get the default classpath.

Returns:
the default classpath

getCombinedClasspath

public Classpath getCombinedClasspath(Collection<String> sectionIds)
Get the combined classpath representing the default classpath plus all named sections. NOTE: the default classpath will be prepended, and the '*' classpath will be appended.

Parameters:
sectionIds - the list of section ids to fetch
Returns:
the Classpath representing combination all of the selected sectionIds, combined with the default section id, and '*' special id.

getMainClassname

public String getMainClassname()

getProperty

public String getProperty(String name)

getProperty

public String getProperty(String name,
                          String dftValue)

getSectionClasspath

public Classpath getSectionClasspath(String sectionId)
Get the classpath for the named section

Parameters:
sectionId -
Returns:

getSectionIds

public Set<String> getSectionIds()
Get the list of section Ids.

Returns:

getXmlConfigs

public List<String> getXmlConfigs()

parse

public void parse(CharSequence buf)
           throws IOException
Parse the configuration

Parameters:
buf -
Throws:
IOException

parse

public void parse(InputStream stream)
           throws IOException
Parse the configuration

Parameters:
buf -
Throws:
IOException

parse

public void parse(Reader reader)
           throws IOException
Throws:
IOException

parse

public void parse(URL url)
           throws IOException
Throws:
IOException

setArgCount

public void setArgCount(int argCount)

setProperty

public void setProperty(String name,
                        String value)

getPolicyInstance

public Policy getPolicyInstance(ClassLoader cl)
                         throws ClassNotFoundException,
                                SecurityException,
                                NoSuchMethodException,
                                IllegalArgumentException,
                                InstantiationException,
                                IllegalAccessException,
                                InvocationTargetException
Throws:
ClassNotFoundException
SecurityException
NoSuchMethodException
IllegalArgumentException
InstantiationException
IllegalAccessException
InvocationTargetException


Copyright © 1995-2009 Mort Bay Consulting. All Rights Reserved.