|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dist1.acb.common.ConfigManager
Config Manager See documentation of java.util.Properties
Method Summary | |
java.lang.String |
constructFullPath(java.lang.String relativePath)
Getter for property appWorkPath. |
protected void |
finalize()
|
static ConfigManager |
getInstance()
Get instance of the manager |
int |
getIntProperty(java.lang.String key)
Get value of a integer property |
int |
getIntProperty(java.lang.String key,
int defaultValue)
Get value of a integer property. |
java.lang.String |
getLogProperty(java.lang.String key)
Get value of a property of the Log System |
java.lang.String |
getLogProperty(java.lang.String key,
java.lang.String defaultValue)
Get value of a property of the Log System. |
java.lang.String |
getProperty(java.lang.String key)
Get value of a property |
java.lang.String |
getProperty(java.lang.String key,
java.lang.String defaultValue)
Get value of a property. |
java.io.InputStream |
getResource(java.lang.String resourceName)
Returns input stream to a resource |
java.net.URL |
getResourceURL(java.lang.String resourceName)
Returns input stream to a resource |
void |
init(java.lang.String sysPath,
java.lang.String appPath,
java.lang.String resourcesPath)
Initialize the Config Manager. |
void |
load()
Binds working directory fo the application to the directory and load configuration |
void |
loadDefaults(java.io.InputStream mainConfigStream,
java.io.InputStream logConfigStream)
Used for loading default configuration. |
java.util.Enumeration |
logPropertyNames()
Returns an enumeration of all the keys in the property list of log system, including distinct keys in the default property list if a key of the same name has not already been found from the main properties list. |
java.util.Enumeration |
propertyNames()
Returns an enumeration of all the keys in the property list of main configuration, including distinct keys in the default property list if a key of the same name has not already been found from the main properties list. |
void |
setAppWorkPath(java.lang.String appWorkPath)
Setter for property appWorkPath. |
void |
setIntProperty(java.lang.String key,
int property)
Set value of a integer property |
void |
setLogProperty(java.lang.String key,
java.lang.String property)
Set value of a property of the Log System |
void |
setProperty(java.lang.String key,
java.lang.String property)
Set value of a property |
void |
store()
Store the configuration |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static ConfigManager getInstance()
public void setAppWorkPath(java.lang.String appWorkPath)
appWorkPath
- New value of property appWorkPath.public void setIntProperty(java.lang.String key, int property)
key
- key of the propertyproperty
- Valuepublic int getIntProperty(java.lang.String key, int defaultValue)
key
- key of the propertydefaultValue
- a default value.
java.lang.NumberFormatException
- internal exceptionpublic int getIntProperty(java.lang.String key) throws java.util.NoSuchElementException, java.lang.NumberFormatException
key
- key of the property
java.util.NoSuchElementException
- if the property with key was not found
java.lang.NumberFormatException
- if the value can't be casted to a integerpublic void setLogProperty(java.lang.String key, java.lang.String property)
key
- key of the propertyproperty
- Valuepublic java.lang.String getLogProperty(java.lang.String key, java.lang.String defaultValue)
key
- key of the propertydefaultValue
- a default value.
public java.lang.String getLogProperty(java.lang.String key) throws java.util.NoSuchElementException
key
- key of the property
java.util.NoSuchElementException
- if the property with key was not foundpublic void setProperty(java.lang.String key, java.lang.String property)
key
- key of the propertyproperty
- Valuepublic java.lang.String getProperty(java.lang.String key, java.lang.String defaultValue)
key
- key of the propertydefaultValue
- a default value.
public java.lang.String getProperty(java.lang.String key) throws java.util.NoSuchElementException
key
- key of the property
java.util.NoSuchElementException
- - if the property with key was not foundpublic java.io.InputStream getResource(java.lang.String resourceName) throws java.lang.RuntimeException
resourceName
- name of file with resource
java.lang.RuntimeException
- if resource was not foundpublic java.net.URL getResourceURL(java.lang.String resourceName) throws java.lang.RuntimeException
resourceName
- name of file with resource
java.lang.RuntimeException
- if resource was not foundpublic java.lang.String constructFullPath(java.lang.String relativePath)
relativePath
- A relative path (from application directory)
public void init(java.lang.String sysPath, java.lang.String appPath, java.lang.String resourcesPath) throws java.lang.SecurityException, java.io.IOException
1. Call to setAppWorkPath(System.getProperty("user.home") + '/' +
sysPath + '/' + appPath);
2. Call to load();
sysPath
- The system dir (for example 'acb')appPath
- The application dir (for example 'cbl')resourcesPath
- path to application resources (may be applied to a
jar or to a file system)
java.io.IOException
- if there are problems reading from the stream
java.lang.SecurityException
- inner exceptionpublic void load() throws java.lang.SecurityException, java.io.IOException
java.lang.SecurityException
- if a security manager exists and if the
caller does not have LoggingPermission("control")
java.io.IOException
- if there are problems reading from the streampublic void loadDefaults(java.io.InputStream mainConfigStream, java.io.InputStream logConfigStream) throws java.lang.SecurityException, java.io.IOException
mainConfigStream
- Stream of main configurationlogConfigStream
- Stream of configuration of logger
java.lang.SecurityException
- if a security manager exists and if the
caller does not have LoggingPermission("control")
java.io.IOException
- if there are problems reading from the streampublic java.util.Enumeration logPropertyNames()
public java.util.Enumeration propertyNames()
public void store() throws java.lang.SecurityException, java.io.IOException
java.lang.SecurityException
- if a security manager exists and if the
caller does not have LoggingPermission("control")
java.io.IOException
- if there are problems reading from the streamprotected void finalize() throws java.lang.Throwable
java.lang.Throwable
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |