}
private ConnectionDefDescriptor getConnectionDefinition(ConnectorDescriptor desc, String connectionDefName)
throws ConnectorRuntimeException {
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) {
if (_logger.isLoggable(Level.FINE)) {
_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