public java.util.Properties | getJavaBeanProps(ConnectorDescriptor desc, java.lang.String connectionDefName, java.lang.String rarName)Parses the ra.xml for the managed connection factory javabean
properties. The managed connection factory to be parsed is
identified by the moduleDir where ra.xml is present and the
connection definition name .
Connection definition name will be unique in a given ra.xml.
It throws ConnectorRuntimeException if either or both the
parameters are null, if corresponding rar is not deployed,
if no connection definition name is found in ra.xml. If rar is deployed
and connection definition name is present but no properties are
present for the corresponding connection definition name,
null is returned.
if(desc == null || connectionDefName == null) {
throw new ConnectorRuntimeException("Invalid arguments");
}
OutboundResourceAdapter ora =
desc.getOutboundResourceAdapter();
if(ora == null || ora.getConnectionDefs().size() == 0) {
return null;
}
Set connectionDefs = ora.getConnectionDefs();
if(connectionDefs== null || connectionDefs.size() == 0) {
return null;
}
Iterator iter = connectionDefs.iterator();
ConnectionDefDescriptor cdd = null;
boolean connectionDefFound=false;
while(iter.hasNext()) {
cdd = (ConnectionDefDescriptor)iter.next();
if(connectionDefName.equals(cdd.getConnectionFactoryIntf())) {
connectionDefFound=true;
break;
}
}
if(connectionDefFound == false) {
_logger.log(Level.FINE,
"No such connectiondefinition found in ra.xml",
connectionDefName);
throw new ConnectorRuntimeException(
"No such connectiondefinition found in ra.xml : " +
connectionDefName);
}
/* 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
*/
Properties mergedVals = null;
Set ddVals = cdd.getConfigProperties();
String className = cdd.getManagedConnectionFactoryImpl();
if(className != null && className.length() != 0) {
Properties introspectedVals = configParserUtil.introspectJavaBean(
className,ddVals, true, rarName);
mergedVals = configParserUtil.mergeProps(ddVals,introspectedVals);
}
return mergedVals;
|