|
Novell exteNd Director 5.2 API |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interface for managing configuration properties. Its methods let you get and set properties in the Director configuration files. The files for the Director subsystems, all called config.xml, are in the subsystem-name-conf subdirectory of the corresponding subsystem-nameService.jar. The boot servlet of the Director EAR loads all subsystem configuration files into memory. It also loads config.xml from any portal WARs in the EAR. You can use an EbiConfig object to access all the configuration properties in your application.
You get the EbiConfig object from fw.factory.EboFactory:
EbiConfig config = com.sssw.fw.factory.EboFactory.getConfig();
You can reload configuration files by setting up an InputStream for the file and calling the load() method. The configuration file you load must be valid; it must be an XML file that uses the following elements:
<properties> <property> <key>keyname</key> <value>data</value> </property> <property>...</property> </properties>
Changes you make to property values are in memory only. They are in effect until the server is rebooted or the config.xml file is reloaded. To make permanent changes, you need to edit the config.xml file and redeploy the EAR.
Although a config.xml file is text, property values can have a data type based on their actual value. If the value element has the values of true or false, the property's data type is boolean. If the value element consists of digits, it is considered numeric. Although you can get any of these values as a String, using the typed methods does the data type conversion for you.
Field Summary | |
static String |
EL_FW_Config
Director element type for an EbiConfig object. |
Method Summary | |
boolean |
getBooleanProperty(String property,
boolean defaultvalue)
Gets a property that has a boolean value. |
Map |
getContains(String contains)
Returns a Map of property key/value pairs whose keys contain the specified value. |
Map |
getEndsWith(String endsWith)
Returns a Map of property key/value pairs whose keys end with the specified value. |
long |
getLongProperty(String propertyname,
long defaultvalue)
Gets a property that has a numeric value. |
String |
getProperty(String propertyname)
Gets the value of a property as a String value. |
String |
getProperty(String propertyname,
String defaultvalue)
Gets the value of a property as a String value or substitutes a default value. |
String[] |
getPropertyNames(String value,
boolean caseSensitive)
Returns the list of names of properties whose value is equal to the passed in value. |
Map |
getStartsWith(String startsWith)
Returns a Map of property key/value pairs whose keys start with the specified value. |
boolean |
isDefined(String propertyname)
Checks whether a property exists in the configuration file. |
Set |
keySet()
Gets a Set of all the keys in all the currently loaded configuration files. |
void |
load(InputStream in)
Loads a configuration file into the EbiConfig object. |
void |
setBooleanProperty(String property,
boolean value)
Sets a property that has a boolean value. |
void |
setLongProperty(String property,
long value)
Sets a property that has a numeric value. |
void |
setProperty(String property,
String value)
Sets a property that has a String value. |
void |
systemOut(Map map)
Prints the contents of a Map to System.out. |
Field Detail |
public static final String EL_FW_Config
Method Detail |
public void systemOut(Map map)
map
- The Map object to print.public void load(InputStream in) throws EboUnrecoverableSystemException
EbiConfig
.
Reloading a configuration file for a subsystem or portal WAR
replaces any property values that you have set.in
- An input stream to a valid config.xml document.public String getProperty(String propertyname)
property
- The name of a property.public String getProperty(String propertyname, String defaultvalue)
property
- The name of a property.defaultvalue
- The value to return if the property is not defined.public boolean getBooleanProperty(String property, boolean defaultvalue)
property
- The name of a property.public long getLongProperty(String propertyname, long defaultvalue)
property
- The name of a property.public void setProperty(String property, String value) throws EboDataException
property
- The name of a property.value
- The String value you want to assign to the property.public void setLongProperty(String property, long value) throws EboDataException
property
- The name of a property.value
- The long value you want to assign to the property.public void setBooleanProperty(String property, boolean value) throws EboDataException
property
- The name of a property.value
- The boolean value you want to assign to the property.public boolean isDefined(String propertyname)
property
- The name of a property.public Map getStartsWith(String startsWith)
startsWith
- String specifying the starting text of the keys you are searching for.public Map getEndsWith(String endsWith)
endsWith
- String specifying the ending text of the keys you are searching for.public Map getContains(String contains)
startsWith
- String specifying text that appears in the keys you are searching for.public Set keySet()
public String[] getPropertyNames(String value, boolean caseSensitive)
value
- The value for which to find property names.caseSensitive
- If true, make the search case-sensitive.
|
Novell exteNd Director 5.2 API |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |