{
FactoryConfig factoryConfig = new FactoryConfig();
factoryConfig.setClasspathId(classpathId);
SessionConfig sessionConfig = new SessionConfig();
ConnectionConfig connectConfig = new ConnectionConfig();
ProviderConfig providerConfig = new ProviderConfig();
sessionConfig.setId(sessionId);
sessionConfig.setTransacted(true);
sessionConfig.setReconnects(BigInteger.ZERO);
connectConfig.getSession().add(sessionConfig);
factoryConfig.getConnection().add(connectConfig);
factoryConfig.setExtension(createDefaultProviderExtConfig(NullConnectionFactory.class.getName()));
PropertySetConfig propertySet = factory.createPropertySetConfig();
// Copy over the other ones...
for (Iterator<PropertyConfig> iter = properties.getProperty().iterator(); iter.hasNext();)
{
PropertyConfig pConfig = iter.next();
if (!pConfig.getName().equals("binding"))
{
propertySet.getProperty().add(pConfig);
}
}
PropertyConfig bProperty = factory.createPropertyConfig();
// Update with the binding.
bProperty.setName("binding");
bProperty.setValue(binding);
propertySet.getProperty().add(bProperty);
providerConfig.setProperties(propertySet);
providerConfig.setClassName(className);
factoryConfig.setProvider(providerConfig);
return factoryConfig;
}