dep.setVersion(artifact.getVersion().toString());
}
}
// Basic settings on RA plan and RA instance
ResourceAdapter ra;
if(connector.getResourceAdapter().length > 0) {
ra = connector.getResourceAdapter(0);
} else {
ra = new ResourceAdapter();
connector.setResourceAdapter(new ResourceAdapter[]{ra});
}
ResourceAdapterInstance raInstance = new ResourceAdapterInstance();
ra.setResourceAdapterInstance(raInstance);
raInstance.setResourceAdapterName(data.instanceName);
for (Iterator it = data.instanceProps.entrySet().iterator(); it.hasNext();) {
Map.Entry entry = (Map.Entry) it.next();
String name = getPropertyName((String)entry.getKey(), provider.getInstanceConfigProperties());
for(int i=0; i<raInstance.getConfigPropertySetting().length; i++) {
if(raInstance.getConfigPropertySetting(i).getName().equals(name)) {
raInstance.getConfigPropertySetting(i).setValue((String)entry.getValue());
break;
}
}
}
GBeanLocator workManager = new GBeanLocator();
raInstance.setWorkManager(workManager);
workManager.setGBeanLink(data.workManager); //todo
// Connection Factories
if(data.getConnectionFactoryCount() > 0) {
ConnectionDefinition[] defs = new ConnectionDefinition[data.getConnectionFactoryCount()];
for (int i = 0; i < defs.length; i++) {
defs[i] = new ConnectionDefinition();
}
ra.setConnectionDefinition(defs);
for (int i = 0; i < data.getConnectionFactories().size(); i++) {
JMSConnectionFactoryData factoryData = (JMSConnectionFactoryData) data.getConnectionFactories().get(i);
JMSProviderData.ConnectionDefinition providerData = provider.getConnectionDefinitions()[factoryData.getFactoryType()];
ConnectionDefinition def = defs[i];
def.setConnectionFactoryInterface(providerData.getConnectionFactoryInterface());