|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.jonas.common.JProp
public class JProp
This class manages configuration properties for a JOnAS Server. It adopts the singleton design-pattern. Configuration parameters are read from .properties file (jonas.properties or resource.properties). In order to support dynamically created resources, JProp also allows for a .properties file generation using a java.lang.Properties object content
getFilesEnv
to getConfigFileEnv
Field Summary | |
---|---|
static String |
DOMAIN_NAME
Domain name |
static String |
JONAS_BASE
-Djonas.base property |
static String |
JONAS_DEF_NAME
Default server name |
static String |
JONAS_NAME
JOnAS server name |
static String |
JONAS_VERSIONS
File name where JOnAS components versions are stored. |
static String |
JONASPREFIX
Prefix for jonas.properties file |
Method Summary | |
---|---|
static void |
deleteInstance(String fileName)
Remove the JProp instance corresponding to the given file name from the 'multiple' data structure and delete the file |
void |
env2Ctx(Context ctx)
Bind all the properties found in file properties in a naming context the naming context must be allocated by the caller |
static String |
getConfDir()
Static method which return the working directory in jonas.base |
Properties |
getConfigFileEnv()
Returns JOnAS environment as configured with files properties only. |
String |
getConfigFileXml()
Returns xml content of the resource file |
Properties |
getEnv()
Returns JOnAS environment as configured with configuration file properties content and system properties. |
static String |
getInstallRoot()
Static method which return the JOnAS install root value. |
static JProp |
getInstance()
Get the unique instance corresponding to the JOnAS server. |
static JProp |
getInstance(String fileName)
Get one of the multiple instances corresponding to a given resource. |
static JProp |
getInstance(String fileName,
Properties props)
Get one of the multiple instances corresponding to a given resource. |
static String |
getJonasBase()
Static method which return the jonas.base property |
String |
getPropFile()
Returns properties filename |
String |
getValue(String key)
Returns the value of the related property. |
String |
getValue(String key,
String defaultVal)
Returns the value of the related property. |
String[] |
getValueAsArray(String key)
Returns the value of the related property as String []. |
boolean |
getValueAsBoolean(String key,
boolean def)
Returns the value of the related property as boolean. |
String |
getVersionFile()
|
static String |
getWorkDir()
Static method which return the working directory in jonas.base |
static void |
main(String[] args)
Displays the JOnAS properties values, as they are set by the different property files. |
static void |
removeInstance(String fileName)
Remove the JProp instance corresponding to the given file name from the 'multiple' data structure |
String |
toString()
String representation of the object for trace purpose |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String JONAS_VERSIONS
public static final String JONASPREFIX
public static final String DOMAIN_NAME
public static final String JONAS_NAME
public static final String JONAS_DEF_NAME
public static final String JONAS_BASE
Method Detail |
---|
public static JProp getInstance()
public static JProp getInstance(String fileName)
fileName
- the name of the configuration file which is given by the resource name
public static JProp getInstance(String fileName, Properties props)
fileName
- the name of the configuration fileprops
- the content of the configuration file to be written in fileName
public static void removeInstance(String fileName)
fileName
- file name corresponding to the name of the resource to be removedpublic static void deleteInstance(String fileName)
fileName
- file name corresponding to the name of the resource to be removed
and deleted from the file systempublic static String getInstallRoot()
public static String getJonasBase()
public static String getWorkDir()
public static String getConfDir()
public String getPropFile()
public Properties getEnv()
public Properties getConfigFileEnv()
public String getConfigFileXml()
public String getVersionFile()
public String getValue(String key, String defaultVal)
key
- the search keydefaultVal
- if the key is not found return this default value
public String getValue(String key)
key
- the wanted key
public boolean getValueAsBoolean(String key, boolean def)
key
- the wanted keydef
- default run if not found
public String[] getValueAsArray(String key)
key
- the wanted key
public String toString()
toString
in class Object
public void env2Ctx(Context ctx) throws Exception
ctx
- given context for bindings properties
Exception
- if it failspublic static void main(String[] args)
args
- the arguments for launching this program
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |