|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.jetty.start.Config
public class Config
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:
".class"
is the Main class to run.".xml"
is a configuration file for the command line"/"
is a directory from which to add all jar and zip files."/*"
is a directory from which to add all unconsidered jar and zip files."/**"
is a directory from which to recursively add all unconsidered jar and zip files.=
are used to assign system properties.~=
are used to assign start properties./=
are used to assign a canonical path.property expansion:
${name}
is expanded to a start property$(name)
is expanded to either a start property or a system property.${version}
is defined as the version of the start.jar
Files starting with "/"
are considered absolute, all others are relative to the home directory.
CONDITION is one of:
always
never
available classname
- true if class on classpathproperty name
- true if set as start propertysystem name
- true if set as system propertyexists file
- true if file/dir existsjava OPERATOR version
- java version compared to literalnargs OPERATOR number
- number of command line args compared to literal"<"
,">"
,"<="
,">="
,
"=="
,"!="
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 |
---|
public static final String DEFAULT_SECTION
Constructor Detail |
---|
public Config()
Method Detail |
---|
public static boolean isDebug()
public static void debug(String msg)
public static void debug(Throwable t)
public Classpath getClasspath()
public Classpath getCombinedClasspath(Collection<String> sectionIds)
sectionIds
- the list of section ids to fetch
Classpath
representing combination all of the selected sectionIds, combined with the default
section id, and '*' special id.public String getMainClassname()
public String getProperty(String name)
public String getProperty(String name, String dftValue)
public Classpath getSectionClasspath(String sectionId)
sectionId
-
public Set<String> getSectionIds()
public List<String> getXmlConfigs()
public void parse(CharSequence buf) throws IOException
buf
-
IOException
public void parse(InputStream stream) throws IOException
buf
-
IOException
public void parse(Reader reader) throws IOException
IOException
public void parse(URL url) throws IOException
IOException
public void setArgCount(int argCount)
public void setProperty(String name, String value)
public Policy getPolicyInstance(ClassLoader cl) throws ClassNotFoundException, SecurityException, NoSuchMethodException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException
ClassNotFoundException
SecurityException
NoSuchMethodException
IllegalArgumentException
InstantiationException
IllegalAccessException
InvocationTargetException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |