// first we need a map of the published outbound adaptors by connection factory interface type
Map connectionDefinitions = new HashMap();
if (resourceadapter.isSetOutboundResourceadapter()) {
for (int j = 0; j < resourceadapter.getOutboundResourceadapter().getConnectionDefinitionArray().length; j++) {
ConnectionDefinitionType connectionDefinition = resourceadapter.getOutboundResourceadapter().getConnectionDefinitionArray(j);
connectionDefinitions.put(connectionDefinition.getConnectionfactoryInterface().getStringValue(), connectionDefinition);
}
// ManagedConnectionFactory setup
if (geronimoResourceAdapter.isSetOutboundResourceadapter()) {
for (int i = 0; i < geronimoResourceAdapter.getOutboundResourceadapter().getConnectionDefinitionArray().length; i++) {
GerConnectionDefinitionType geronimoConnectionDefinition = geronimoResourceAdapter.getOutboundResourceadapter().getConnectionDefinitionArray(i);
assert geronimoConnectionDefinition != null: "Null GeronimoConnectionDefinition";
String connectionFactoryInterfaceName = geronimoConnectionDefinition.getConnectionfactoryInterface().getStringValue();
ConnectionDefinitionType connectionDefinition = (ConnectionDefinitionType) connectionDefinitions.get(connectionFactoryInterfaceName);
if (connectionDefinition == null) {
throw new DeploymentException("No connection definition for ConnectionFactory class: " + connectionFactoryInterfaceName);
}
for (int j = 0; j < geronimoConnectionDefinition.getConnectiondefinitionInstanceArray().length; j++) {
GerConnectiondefinitionInstanceType connectionfactoryInstance = geronimoConnectionDefinition.getConnectiondefinitionInstanceArray()[j];
String managedConnectionFactoryClass = connectionDefinition.getManagedconnectionfactoryClass().getStringValue();
String connectionFactoryInterface = connectionDefinition.getConnectionfactoryInterface().getStringValue();
String connectionFactoryImplClass = connectionDefinition.getConnectionfactoryImplClass().getStringValue();
String connectionInterface = connectionDefinition.getConnectionInterface().getStringValue();
String connectionImplClass = connectionDefinition.getConnectionImplClass().getStringValue();
ConfigProperty[] configProperties = getConfigProperties(connectionDefinition.getConfigPropertyArray(), connectionfactoryInstance.getConfigPropertySettingArray());
addOutboundGBeans(earContext, resourceAdapterObjectName, connectionfactoryInstance, configProperties, managedConnectionFactoryClass, connectionFactoryInterface, connectionFactoryImplClass, connectionInterface, connectionImplClass, cl);
}
}
}