|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.daemon.support.DaemonConfiguration
public final class DaemonConfiguration
Used by jsvc for Daemon configuration.
Configuration is read from properties file.
If no properties file is given the daemon.properties
is used from the current directory.
The properties file can have property values expanded at runtime
by using System properties or execution environment. The part
of the property value between ${
and }
will be used as System property or environment key. If found then
the entire ${foo}
will be replaced by the value of
either system property or environment variable named foo
.
If no variable is found the ${foo}
will be passed as is.
In case of $${foo}
this will be unescaped and resulting
value will be ${foo}
.
Field Summary | |
---|---|
protected static String |
DEFAULT_CONFIG
Default configuration file name. |
protected static String |
PREFIX
Property prefix |
Constructor Summary | |
---|---|
DaemonConfiguration()
Default constructor |
Method Summary | |
---|---|
String |
getProperty(String name)
Get the configuration property. |
String[] |
getPropertyArray(String name)
Get the configuration property array. |
boolean |
load(String fileName)
Load the configuration properties file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final String DEFAULT_CONFIG
protected static final String PREFIX
Constructor Detail |
---|
public DaemonConfiguration()
Method Detail |
---|
public boolean load(String fileName)
fileName
- The properties file to load.
true
if the file was loaded.public String getProperty(String name) throws ParseException
name
- The name of the property to get.
ParseException
- if the property is wrongly formatted.public String[] getPropertyArray(String name) throws ParseException
Property array is constructed form the lsit of properties
which end with [index]
daemon.arg[0] = argument 1 daemon.arg[1] = argument 2 daemon.arg[2] = argument 3
name
- The name of the property array to get.
ParseException
- if the property is wrongly formatted.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |