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());
ConnectionDefinitionInstance instance = new ConnectionDefinitionInstance();
def.setConnectionInstance(new ConnectionDefinitionInstance[]{instance});
if(providerData.getConnectionFactoryInterface().equals("javax.jms.ConnectionFactory")) {
instance.setImplementedInterface(new String[]{"javax.jms.QueueConnectionFactory","javax.jms.TopicConnectionFactory"});
}
instance.setName(factoryData.getInstanceName());
SinglePool pool = new SinglePool();
instance.getConnectionManager().setPoolSingle(pool);
pool.setMatchOne(true);
pool.setMaxSize(factoryData.getPoolMaxSize());
pool.setMinSize(factoryData.getPoolMinSize());
pool.setBlockingTimeoutMillis(factoryData.getPoolBlockingTimeout());
pool.setIdleTimeoutMinutes(factoryData.getPoolIdleTimeout());
if(factoryData.getTransaction().equals("none")) {
instance.getConnectionManager().setTransactionNone(true);
} else if(factoryData.getTransaction().equals("local")) {
instance.getConnectionManager().setTransactionLocal(true);
} else if(factoryData.getTransaction().equals("xa")) {
instance.getConnectionManager().setTransactionXA(true);
instance.getConnectionManager().setTransactionXACachingThread(factoryData.isXaThreadCaching());
instance.getConnectionManager().setTransactionXACachingTransaction(factoryData.isXaTransactionCaching());
}
for (Iterator it = factoryData.instanceProps.entrySet().iterator(); it.hasNext();) {
Map.Entry entry = (Map.Entry) it.next();
String name = getPropertyName((String)entry.getKey(), providerData.getConfigProperties());
for(int j=0; j<instance.getConfigPropertySetting().length; j++) {
if(instance.getConfigPropertySetting(j).getName().equals(name)) {
instance.getConfigPropertySetting(j).setValue((String)entry.getValue());
break;
}
}
}
}
}
// Destinations
DDBean[] ddBeans = connector.getDDBean().getChildBean(connector.getXpaths()[0]);
AdminObjectDCB[] adminDCBs = new AdminObjectDCB[ddBeans.length];
for (int i = 0; i < adminDCBs.length; i++) {
adminDCBs[i] = (AdminObjectDCB) connector.getDConfigBean(ddBeans[i]);
}
for (int i = 0; i < data.getAdminObjects().size(); i++) {
JMSAdminObjectData admin = (JMSAdminObjectData) data.getAdminObjects().get(i);
JMSProviderData.AdminObjectDefinition providerData = provider.getAdminObjectDefinitions()[admin.getDestinationType()];
for (int j = 0; j < adminDCBs.length; j++) {
AdminObjectDCB adminDCB = adminDCBs[j];
if(adminDCB.getAdminObjectInterface().equals(providerData.getAdminObjectInterface())) {
AdminObjectInstance[] before = adminDCB.getAdminObjectInstance();
AdminObjectInstance[] after = new AdminObjectInstance[before.length+1];
System.arraycopy(before, 0, after, 0, before.length);
AdminObjectInstance instance = new AdminObjectInstance();
after[before.length] = instance;
adminDCB.setAdminObjectInstance(after);
instance.setMessageDestinationName(admin.getName());
for (Iterator it = admin.instanceProps.entrySet().iterator(); it.hasNext();) {
Map.Entry entry = (Map.Entry) it.next();
String name = getPropertyName((String)entry.getKey(), providerData.getConfigProperties());
for(int k=0; k<instance.getConfigPropertySetting().length; k++) {
if(instance.getConfigPropertySetting(k).getName().equals(name)) {
instance.getConfigPropertySetting(k).setValue((String)entry.getValue());
break;
}
}
}
break;