org.osesb.configuration
Class JNDIConfiguration

java.lang.Object
  extended by org.osesb.configuration.XMLConfiguration
      extended by org.osesb.configuration.JNDIConfiguration
Direct Known Subclasses:
JDBCConfiguration, JMSClientConfiguration

public class JNDIConfiguration
extends XMLConfiguration

Parses a any configuration content model that includes JNDI properties. For example, JMSClientConfiguration and JDBCConfigurations contain JNDI content models.


Field Summary
protected  java.util.Properties vendorEnvironmentProperties
          In addition to standard JNDI environment properties for the InitialContext, like providerURL, the <vendor-env-properties> configuration element allows the programmer to specify vendor-specific properties, which are passed to the InitialContext constructor.
 
Fields inherited from class org.osesb.configuration.XMLConfiguration
configFilePath, configurationProperties, constructedFromConfigFile, contentModelElement, ftpClientConfiguration, jaxrpcClientConfiguration, jdbcConfiguration, jmsClientConfiguration, log, rootConfigurationAttributes, smtpClientConfiguration, systemProperties, thisClassName
 
Constructor Summary
JNDIConfiguration(org.w3c.dom.Element contentModelElement)
          Creates a new instance of JNDIConfiguration given the content model Element.
JNDIConfiguration(java.util.Properties configurationProperties)
          Creates a new instance of JNDIConfiguration given the configuration Properties.
JNDIConfiguration(java.lang.String configFile)
          Creates a new instance of JNDIConfiguration given a XML configuration file.
JNDIConfiguration(java.lang.String configFile, java.lang.String xpathExpression)
          Creates a new instance of JNDIConfiguration given a XML configuration file and a XPath expression that evaluates to the element that marks the beginning of the configuration.
 
Method Summary
 java.lang.String getContextFactory()
          Returns the ContextFactory className.
 java.lang.String getContextSecurityCredentials()
          Returns the Context Security Credentials.
 java.lang.String getContextSecurityPrincipal()
          Returns the Context Security Principal.
 java.lang.String getProviderURL()
          Returns the JNDI Provider URL.
 java.util.Properties getVendorEnvironmentProperties()
          Returns vendor-specific environment properties.
protected  void loadVendorEnvironmentProperties()
          Loads a <vendor-env-properties> content model enclosed within this configuration.
 void setContextSecurityCredentials(java.lang.String contextSecurityCredentials)
          Sets the Context Security Credentials (password encryption).
 java.lang.String toString()
          Returns the String representation of this JNDIConfiguration.
 
Methods inherited from class org.osesb.configuration.XMLConfiguration
checkXMLConfigurationClass, clear, doEncryptionInstructions, getBooleanConfigurationProperty, getBooleanRootConfigurationAttribute, getConfigFilePath, getConfigurationAttribute, getConfigurationAttributes, getConfigurationElement, getConfigurationElements, getConfigurationProperties, getConfigurationProperty, getConfigurationProperty, getContentModelElement, getDebugFlag, getDocument, getEncryptionInstructions, getFTPClientConfiguration, getIntConfigurationProperty, getIntRootConfigurationAttribute, getJAXRPCClientConfiguration, getJDBCConfiguration, getJMSClientConfiguration, getLongConfigurationProperty, getLongRootConfigurationAttribute, getName, getRootConfigurationAttribute, getRootConfigurationAttributes, getSMTPClientConfiguration, getSystemProperties, getSystemProperty, isConfigurationElementEmpty, loadConfiguration, loadExternalConfiguration, loadFTPClientConfiguration, loadJAXRPCClientConfiguration, loadJDBCConfiguration, loadJMSClientConfiguration, loadPropertiesFromContentModel, loadSMTPClientConfiguration, loadSystemProperties, main, mergeConfigurationProperties, setConfigFilePath, setConfigurationProperty, setDebugFlag, setFTPClientConfiguration, setJAXRPCClientConfiguration, setJDBCConfiguration, setJMSClientConfiguration, setName, setRootConfigurationAttribute, setSMTPClientConfiguration, setSystemProperties, setSystemProperty, writeConfigurationFile, writeConfigurationFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

vendorEnvironmentProperties

protected java.util.Properties vendorEnvironmentProperties
In addition to standard JNDI environment properties for the InitialContext, like providerURL, the <vendor-env-properties> configuration element allows the programmer to specify vendor-specific properties, which are passed to the InitialContext constructor.

See Also:
loadVendorEnvironmentProperties()
Constructor Detail

JNDIConfiguration

public JNDIConfiguration(java.lang.String configFile)
                  throws java.lang.Exception
Creates a new instance of JNDIConfiguration given a XML configuration file. The root element of the XML configuration file is the starting element for the configuration.

Parameters:
configFile - The path to the XML configuration file, which is specified as a resource path or as a file system path that is relative to the path specified by the ConfigurationConstants.CONFIG_PATH_SYSTEMPROPERTY System Property.
Throws:
java.lang.Exception - if there is a problem reading or parsing the configuration file.

JNDIConfiguration

public JNDIConfiguration(java.lang.String configFile,
                         java.lang.String xpathExpression)
                  throws java.lang.Exception
Creates a new instance of JNDIConfiguration given a XML configuration file and a XPath expression that evaluates to the element that marks the beginning of the configuration.

An empty xpathExpression implies that the root element of the XML configuration file is the starting element for the configuration.

Parameters:
configFile - The path to the XML configuration file, which is specified as a resource path or as a file system path that is relative to the path specified by the ConfigurationConstants.CONFIG_PATH_SYSTEMPROPERTY System Property.
xpathExpression - A XPath expression that evaluates to the element that marks the beginning of the configuration.
Throws:
java.lang.Exception - if there is a problem reading or parsing the configuration file.

JNDIConfiguration

public JNDIConfiguration(org.w3c.dom.Element contentModelElement)
                  throws java.lang.Exception
Creates a new instance of JNDIConfiguration given the content model Element.

Parameters:
contentModelElement - The top level Element for the for the configuration.
Throws:
java.lang.Exception - if there is a fatal error transversing the configuration content model enclosed by contentModelElement.

JNDIConfiguration

public JNDIConfiguration(java.util.Properties configurationProperties)
Creates a new instance of JNDIConfiguration given the configuration Properties.

Parameters:
configurationProperties - Configuration name / value pairs as Properties.
Method Detail

loadVendorEnvironmentProperties

protected final void loadVendorEnvironmentProperties()
                                              throws java.lang.Exception
Loads a <vendor-env-properties> content model enclosed within this configuration. This method is automatically invoked by the Constructor.

In addition to standard JNDI environment properties for the InitialContext, like providerURL, the <vendor-env-properties> configuration element allows the programmer to specify vendor-specific properties, which are passed to the InitialContext constructor.

The <vendor-env-properties> content model Element tag name must be ConfigurationConstants.VENDORSPECIFIC_ENVIRONMENT_PROPERTIES_CONTENTMODEL and must be an immediate child of the root Element of a JNDIConfiguration.

Example <vendor-env-properties>:

<vendor-env-properties>
          <vendor-env-property name="name1" value="value1"/>
          <vendor-env-property name="name2" value="value2"/>
     </vendor-env-properties>
 

The 'name' and 'value' attributes are used to set the Environment Properties.

Environment properties can be loaded from a resource path or a file system path. For example,

<vendor-env-properties propertiesFile="config/was-thinClient.properties"/>
 

Environment defined in a propertiesFile take precedence over properties configured as children of <vendor-env-properties.

Note that this method should not be overridden as it is invoked from this class's constructor.

Throws:
java.lang.Exception - if there is a fatal error transversing the DOM that contains the configuration content model.

getContextFactory

public java.lang.String getContextFactory()
Returns the ContextFactory className.

Returns:
the name of the ContextFactory class.

getContextSecurityPrincipal

public java.lang.String getContextSecurityPrincipal()
Returns the Context Security Principal.

Returns:
the Context Security Principal.

getContextSecurityCredentials

public java.lang.String getContextSecurityCredentials()
Returns the Context Security Credentials.

Returns:
the Context Security Credentials.

setContextSecurityCredentials

public void setContextSecurityCredentials(java.lang.String contextSecurityCredentials)
Sets the Context Security Credentials (password encryption).

Parameters:
contextSecurityCredentials - The Context Security Credentials.

getProviderURL

public java.lang.String getProviderURL()
Returns the JNDI Provider URL.

Returns:
the JNDI Provider URL.

getVendorEnvironmentProperties

public java.util.Properties getVendorEnvironmentProperties()
Returns vendor-specific environment properties.

In addition to standard JNDI environment properties for the InitialContext, like providerURL, the <vendor-env-properties> configuration element allows the programmer to specify vendor-specific properties, which are passed to the InitialContext constructor.

Returns:
vendor-specific environment properties.

toString

public java.lang.String toString()
Returns the String representation of this JNDIConfiguration.

Overrides:
toString in class XMLConfiguration
Returns:
the String representation of this JNDIConfiguration.