FileDocCategorySizeDatePackage
ResourceAdapterConfigParserImpl.javaAPI DocGlassfish v2 API4963Fri May 04 22:34:26 BST 2007com.sun.enterprise.connectors.util

ResourceAdapterConfigParserImpl

public class ResourceAdapterConfigParserImpl extends Object implements ConnectorConfigParser
This is Resource Adapter configuration parser. It parses the ra.xml file for the Resources adapter javabean properties
author
Srikanth P

Fields Summary
static Logger
_logger
Constructors Summary
public ResourceAdapterConfigParserImpl()
Default constructor.

    
            

      

    
Methods Summary
public java.util.PropertiesgetJavaBeanProps(ConnectorDescriptor desc, java.lang.String connectionDefName, java.lang.String rarName)
Parses the ra.xml for the Resource Adapter javabean properties. Here the second parameter connectionDefName is not used and can be null or any value. It throws ConnectorRuntimeException if module dir is null or corresponing rar is not deployed i.e invalid moduleDir parameter.

param
desc ConnectorDescriptor pertaining to rar.
param
Not used. Can be null or any value,
return
Javabean properties with the propety names and values of propeties. The property values will be the values mentioned in ra.xml if present. Otherwise it will be the default values obtained by introspecting the javabean. In both the case if no value is present, empty String is returned as the value.
throws
ConnectorRuntimeException if moduleDir is null . If corresponding rar is not deployed i.e moduleDir is invalid.


        if(desc == null) {
            throw new ConnectorRuntimeException("Invalid arguments");
        }

        /* ddVals           -> Properties present in ra.xml
        *  introspectedVals -> All properties with values
        *                                 obtained by introspection of resource
        *                                  adapter javabean
        *  mergedVals       -> merged props of raConfigPros and
        *                                 allraConfigPropsWithDefVals
        */

        Set ddVals = desc.getConfigProperties();
        Properties mergedVals = null;
        String className = desc.getResourceAdapterClass();
        Properties introspectedVals = null;
        if(className != null && className.length() != 0) {
            introspectedVals=configParserUtil.introspectJavaBean(
                                       className,ddVals);
            mergedVals = configParserUtil.mergeProps(ddVals,introspectedVals);
        }
        return mergedVals;