org.objectweb.jonas.common.JProp Class Reference

Collaboration diagram for org.objectweb.jonas.common.JProp:

Collaboration graph
[legend]
List of all members.

Public Member Functions

String getPropFile ()
Properties getEnv ()
Properties getConfigFileEnv ()
String getConfigFileXml ()
String getValue (String key, String defaultVal)
String getValue (String key)
boolean getValueAsBoolean (String key, boolean def)
String[] getValueAsArray (String key)
String toString ()
void env2Ctx (Context ctx) throws Exception

Static Public Member Functions

JProp getInstance () throws Exception
JProp getInstance (String fileName) throws Exception
JProp getInstance (String fileName, Properties props) throws Exception
String getInstallRoot ()
String getJonasBase ()
String getWorkDir ()
void main (String args[])

Static Public Attributes

final String JONASPREFIX = "jonas"
final String DOMAIN_NAME = "domain.name"
final String JONAS_NAME = "jonas.name"
final String JONAS_DEF_NAME = "jonas"

Detailed Description

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
Author:
jonas-team

Adriana Danes

Florent Benoit

05/2003 Florent Benoit. Add support of xml files and checkstyle

Definition at line 69 of file JProp.java.


Member Function Documentation

void org.objectweb.jonas.common.JProp.env2Ctx Context  ctx  )  throws Exception
 

Bind all the properties found in file properties in a naming context the naming context must be allocated by the caller

Parameters:
ctx given context for bindings properties
Exceptions:
Exception if it fails

Definition at line 544 of file JProp.java.

Properties org.objectweb.jonas.common.JProp.getConfigFileEnv  ) 
 

Returns JOnAS environment as configured with files properties only.

Returns:
JOnAS properties

Definition at line 445 of file JProp.java.

Referenced by org.objectweb.jonas.mail.MailServiceImpl.doStart(), org.objectweb.jonas.jaxr.JAXRServiceImpl.doStart(), org.objectweb.jonas.dbm.DataBaseServiceImpl.doStart(), and org.objectweb.jonas.server.Server.start().

String org.objectweb.jonas.common.JProp.getConfigFileXml  ) 
 

Returns xml content of the resource file

Returns:
xml content of the resource file

Definition at line 454 of file JProp.java.

Properties org.objectweb.jonas.common.JProp.getEnv  ) 
 

Returns JOnAS environment as configured with configuration file properties content and system properties.

Returns:
JOnAS properties

Definition at line 435 of file JProp.java.

Referenced by org.objectweb.jonas.service.ServiceManager.createServiceContextFor().

String org.objectweb.jonas.common.JProp.getInstallRoot  )  [static]
 

Static method which return the JOnAS install root value.

Returns:
the JOnAS install root value.

Definition at line 397 of file JProp.java.

JProp org.objectweb.jonas.common.JProp.getInstance String  fileName,
Properties  props
throws Exception [static]
 

Get one of the multiple instances corresponding to a given resource. Create it at first call with a given configuration file name

Parameters:
fileName the name of the configuration file
props the content of the configuration file to be written in fileName
Returns:
one of the multiple instances corresponding to a given resource.
Exceptions:
Exception if no JProp can be built

Definition at line 229 of file JProp.java.

JProp org.objectweb.jonas.common.JProp.getInstance String  fileName  )  throws Exception [static]
 

Get one of the multiple instances corresponding to a given resource. Create it at first call with a given configuration file name

Parameters:
fileName the name of the configuration file which is given by the resource name
Returns:
one of the multiple instances corresponding to a given resource.
Exceptions:
Exception if no JProp can be built

Definition at line 214 of file JProp.java.

JProp org.objectweb.jonas.common.JProp.getInstance  )  throws Exception [static]
 

Get the unique instance corresponding to the JOnAS server. Create it at first call.

Returns:
unique instance corresponding to the JOnAS server.
Exceptions:
Exception if no JProp can be built

Definition at line 200 of file JProp.java.

Referenced by org.objectweb.jonas.ws.AbsWebServicesServiceImpl.doInit(), org.objectweb.jonas.web.AbsJWebContainerServiceImpl.doInit(), org.objectweb.jonas.ws.JServiceFactoryFinder.getJOnASServiceFactory(), and org.objectweb.jonas.common.JProp.main().

String org.objectweb.jonas.common.JProp.getJonasBase  )  [static]
 

Static method which return the jonas.base property

Returns:
the jonas.base property

Definition at line 409 of file JProp.java.

String org.objectweb.jonas.common.JProp.getPropFile  ) 
 

Returns properties filename

Returns:
JOnAS properties filename

Definition at line 426 of file JProp.java.

String org.objectweb.jonas.common.JProp.getValue String  key  ) 
 

Returns the value of the related property. The method returns null if the property is not found.

Parameters:
key the wanted key
Returns:
property value, null if not exist

Definition at line 475 of file JProp.java.

String org.objectweb.jonas.common.JProp.getValue String  key,
String  defaultVal
 

Returns the value of the related property. With default values.

Parameters:
key the search key
defaultVal if the key is not found return this default value
Returns:
property value

Definition at line 464 of file JProp.java.

Referenced by org.objectweb.jonas_ejb.container.JContainer.addBean(), org.objectweb.jonas.service.ServiceManager.createServiceContextFor(), org.objectweb.jonas.service.ServiceManager.createServiceFrom(), org.objectweb.jonas.web.AbsJWebContainerServiceImpl.doInit(), org.objectweb.jonas.ws.JServiceFactoryFinder.getJOnASServiceFactory(), org.objectweb.jonas.common.JProp.getValueAsArray(), org.objectweb.jonas.common.JProp.getValueAsBoolean(), org.objectweb.jonas.service.AbsServiceImpl.init(), org.objectweb.jonas.server.Server.initCarol(), org.objectweb.jonas.server.JavaVm.JavaVm(), org.objectweb.jonas.webapp.jonasadmin.WhereAreYou.refreshJonas(), and org.objectweb.jonas.server.Server.start().

String [] org.objectweb.jonas.common.JProp.getValueAsArray String  key  ) 
 

Returns the value of the related property as String []. The method returns null if the property is not found.

Parameters:
key the wanted key
Returns:
property value, null if not exist

Definition at line 505 of file JProp.java.

References org.objectweb.jonas.common.JProp.getValue().

Referenced by org.objectweb.jonas.ws.AbsWebServicesServiceImpl.doInit(), and org.objectweb.jonas.service.ServiceManager.getServiceNames().

Here is the call graph for this function:

boolean org.objectweb.jonas.common.JProp.getValueAsBoolean String  key,
boolean  def
 

Returns the value of the related property as boolean.

Parameters:
key the wanted key
def default run if not found
Returns:
property value, true or false.

Definition at line 490 of file JProp.java.

References org.objectweb.jonas.common.JProp.getValue().

Here is the call graph for this function:

String org.objectweb.jonas.common.JProp.getWorkDir  )  [static]
 

Static method which return the working directory in jonas.base

Returns:
the jonas.base property

Definition at line 417 of file JProp.java.

void org.objectweb.jonas.common.JProp.main String  args[]  )  [static]
 

Displays the JOnAS properties values, as they are set by the different property files.

Parameters:
args the arguments for launching this program

Definition at line 558 of file JProp.java.

References org.objectweb.jonas.common.JProp.configFileEnv, and org.objectweb.jonas.common.JProp.getInstance().

Here is the call graph for this function:

String org.objectweb.jonas.common.JProp.toString  ) 
 

String representation of the object for trace purpose

Returns:
String representation of this object

Definition at line 524 of file JProp.java.

References org.objectweb.jonas.common.JProp.configFileEnv.

Referenced by org.objectweb.jonas.webapp.jonasadmin.WhereAreYou.toString().


Member Data Documentation

final String org.objectweb.jonas.common.JProp.DOMAIN_NAME = "domain.name" [static]
 

Domain name

Definition at line 79 of file JProp.java.

final String org.objectweb.jonas.common.JProp.JONAS_DEF_NAME = "jonas" [static]
 

Default server name

Definition at line 89 of file JProp.java.

Referenced by org.objectweb.jonas.service.AbsServiceImpl.init().

final String org.objectweb.jonas.common.JProp.JONAS_NAME = "jonas.name" [static]
 

JOnAS server name

Definition at line 84 of file JProp.java.

final String org.objectweb.jonas.common.JProp.JONASPREFIX = "jonas" [static]
 

Prefix for jonas.properties file

Definition at line 74 of file JProp.java.


The documentation for this class was generated from the following file:
Generated on Tue Feb 15 15:06:26 2005 for JOnAS by  doxygen 1.3.9.1