public String getSchemaNamespace() {
return GERCONNECTOR_NAMESPACE;
}
private void addConnectorGBeans(EARContext earContext, AbstractName jcaResourceName, GBeanData resourceAdapterModuleData, ConnectorType connector, GerConnectorType geronimoConnector, ClassLoader cl) throws DeploymentException {
ResourceadapterType resourceadapter = connector.getResourceadapter();
GerResourceadapterType[] geronimoResourceAdapters = geronimoConnector.getResourceadapterArray();
for (GerResourceadapterType geronimoResourceAdapter : geronimoResourceAdapters) {
// Resource Adapter
AbstractName resourceAdapterAbstractName = null;
if (resourceadapter.isSetResourceadapterClass()) {
GBeanData resourceAdapterGBeanData = locateResourceAdapterGBeanData(resourceAdapterModuleData);
GBeanData resourceAdapterInstanceGBeanData = new GBeanData(resourceAdapterGBeanData);
String resourceAdapterName;
AbstractNameQuery workManagerName;
if (geronimoResourceAdapter.isSetResourceadapterInstance()) {
GerResourceadapterInstanceType resourceAdapterInstance = geronimoResourceAdapter.getResourceadapterInstance();
setDynamicGBeanDataAttributes(resourceAdapterInstanceGBeanData, resourceAdapterInstance.getConfigPropertySettingArray(), cl);
workManagerName = ENCConfigBuilder.getGBeanQuery(NameFactory.JCA_WORK_MANAGER, resourceAdapterInstance.getWorkmanager());
resourceAdapterName = resourceAdapterInstance.getResourceadapterName();
} else {
workManagerName = ENCConfigBuilder.buildAbstractNameQuery(null, null, defaultWorkManagerName, NameFactory.JCA_WORK_MANAGER, null);
resourceAdapterName = "ResourceAdapterInstance-" + System.currentTimeMillis();
log.warn("Resource adapter instance information was not specified in Geronimo plan. Using defaults.");
}
// set the work manager name
resourceAdapterInstanceGBeanData.setReferencePattern("WorkManager", workManagerName);
// set the xa terminator name which is the same as our transaction manager
resourceAdapterInstanceGBeanData.setReferencePattern("XATerminator", earContext.getTransactionManagerName());
resourceAdapterAbstractName = earContext.getNaming().createChildName(jcaResourceName, resourceAdapterName, NameFactory.JCA_RESOURCE_ADAPTER);
resourceAdapterInstanceGBeanData.setAbstractName(resourceAdapterAbstractName);
try {
earContext.addGBean(resourceAdapterInstanceGBeanData);
} catch (GBeanAlreadyExistsException e) {
throw new DeploymentException("Could not add resource adapter instance gbean to context", e);
}
}
// Outbound Managed Connection Factories (think JDBC data source or JMS connection factory)
// ManagedConnectionFactory setup
if (geronimoResourceAdapter.isSetOutboundResourceadapter()) {
if (!resourceadapter.isSetOutboundResourceadapter()) {
throw new DeploymentException("Geronimo plan configures an outbound resource adapter but ra.xml does not describe any");
}
String transactionSupport = resourceadapter.getOutboundResourceadapter().getTransactionSupport().getStringValue().trim();
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().trim();