ObjectName resourceAdapterObjectName,
GBeanData managedConnectionFactoryPrototypeGBeanData,
GerConnectiondefinitionInstanceType connectiondefinitionInstance,
String transactionSupport,
ClassLoader cl) throws DeploymentException {
GBeanData managedConnectionFactoryInstanceGBeanData = new GBeanData(managedConnectionFactoryPrototypeGBeanData);
// ConnectionManager
ObjectName connectionManagerObjectName = configureConnectionManager(earContext, j2eeContext, transactionSupport, connectiondefinitionInstance, cl);
// ManagedConnectionFactory
setDynamicGBeanDataAttributes(managedConnectionFactoryInstanceGBeanData, connectiondefinitionInstance.getConfigPropertySettingArray(), cl);
try {
if (resourceAdapterObjectName != null) {
managedConnectionFactoryInstanceGBeanData.setReferencePattern("ResourceAdapterWrapper", resourceAdapterObjectName);
}
managedConnectionFactoryInstanceGBeanData.setReferencePattern("ConnectionManagerContainer", connectionManagerObjectName);
//additional interfaces implemented by connection factory
String[] implementedInterfaces = connectiondefinitionInstance.getImplementedInterfaceArray();
if (implementedInterfaces != null) {
for (int i = 0; i < implementedInterfaces.length; i++) {
implementedInterfaces[i] = implementedInterfaces[i].trim();
}
} else {
implementedInterfaces = new String[0];
}
managedConnectionFactoryInstanceGBeanData.setAttribute("implementedInterfaces", implementedInterfaces);
} catch (Exception e) {
throw new DeploymentException(e);
}
ObjectName managedConnectionFactoryObjectName = null;
try {
managedConnectionFactoryObjectName = NameFactory.getComponentName(null, null, null, null, null, connectiondefinitionInstance.getName(), NameFactory.JCA_MANAGED_CONNECTION_FACTORY, j2eeContext);
} catch (MalformedObjectNameException e) {
throw new DeploymentException("Could not construct managed connection factory object name", e);
}
managedConnectionFactoryInstanceGBeanData.setName(managedConnectionFactoryObjectName);
earContext.addGBean(managedConnectionFactoryInstanceGBeanData);
// ConnectionFactory
ObjectName connectionFactoryObjectName = null;
try {
connectionFactoryObjectName = NameFactory.getComponentName(null, null, null, null, null, connectiondefinitionInstance.getName(), NameFactory.JCA_CONNECTION_FACTORY, j2eeContext);
} catch (MalformedObjectNameException e) {
throw new DeploymentException("Could not construct connection factory object name", e);
}
GBeanData connectionFactoryGBeanData = new GBeanData(connectionFactoryObjectName, JCAConnectionFactoryImplGBean.GBEAN_INFO);
connectionFactoryGBeanData.setReferencePattern("J2EEServer", earContext.getServerObjectName());
connectionFactoryGBeanData.setAttribute("managedConnectionFactory", managedConnectionFactoryObjectName.getCanonicalName());
earContext.addGBean(connectionFactoryGBeanData);
}