public void initContext(EARContext earContext, Module module, ClassLoader cl) throws DeploymentException {
J2eeContext earJ2eeContext = earContext.getJ2eeContext();
J2eeContext moduleJ2eeContext = new J2eeContextImpl(earJ2eeContext.getJ2eeDomainName(), earJ2eeContext.getJ2eeServerName(), earJ2eeContext.getJ2eeApplicationName(), module.getName(), null, null);
XmlObject specDD = module.getSpecDD();
GerConnectorType geronimoConnector = (GerConnectorType) module.getVendorDD();
GerResourceadapterType[] geronimoResourceAdapters = geronimoConnector.getResourceadapterArray();
for (int k = 0; k < geronimoResourceAdapters.length; k++) {
GerResourceadapterType geronimoResourceAdapter = geronimoResourceAdapters[k];
if (specDD instanceof ConnectorType) {
ResourceadapterType resourceadapter = ((ConnectorType) specDD).getResourceadapter();
if (resourceadapter.isSetResourceadapterClass()) {
// set the resource adapter class and activationSpec info map
try {
if (resourceadapter.isSetInboundResourceadapter() && resourceadapter.getInboundResourceadapter().isSetMessageadapter()) {
String resourceAdapterName = geronimoResourceAdapter.getResourceadapterInstance().getResourceadapterName();
ObjectName resourceAdapterObjectName = NameFactory.getResourceComponentName(null, null, null, null, resourceAdapterName, NameFactory.JCA_RESOURCE_ADAPTER, moduleJ2eeContext);
//get the ActivationSpec metadata as GBeanInfos
Map activationSpecInfoMap = getActivationSpecInfoMap(resourceadapter.getInboundResourceadapter().getMessageadapter().getMessagelistenerArray(), cl);
String containerId = resourceAdapterObjectName.getCanonicalName();
earContext.getRefContext().addResourceAdapterId(module.getModuleURI(), resourceAdapterName, containerId);
earContext.getRefContext().addActivationSpecInfos(resourceAdapterObjectName, activationSpecInfoMap);
}
} catch (Exception e) {
throw new DeploymentException("Could not set ResourceAdapterClass", e);
}
}
}
if (geronimoResourceAdapter.isSetOutboundResourceadapter()) {
GerConnectionDefinitionType[] connectionDefinitions = geronimoResourceAdapter.getOutboundResourceadapter().getConnectionDefinitionArray();
for (int i = 0; i < connectionDefinitions.length; i++) {
GerConnectionDefinitionType connectionDefinition = connectionDefinitions[i];
GerConnectiondefinitionInstanceType[] connectionDefinitionInstances = connectionDefinition.getConnectiondefinitionInstanceArray();
for (int j = 0; j < connectionDefinitionInstances.length; j++) {
GerConnectiondefinitionInstanceType connectionDefinitionInstance = connectionDefinitionInstances[j];
String containerId = null;
try {
containerId = NameFactory.getResourceComponentNameString(null, null, null, null, connectionDefinitionInstance.getName(), NameFactory.JCA_MANAGED_CONNECTION_FACTORY, moduleJ2eeContext);
} catch (MalformedObjectNameException e) {
throw new DeploymentException("Could not construct resource object name", e);
}
earContext.getRefContext().addConnectionFactoryId(module.getModuleURI(), connectionDefinitionInstance.getName(), containerId);
}
}
}
}
for (int i = 0; i < geronimoConnector.getAdminobjectArray().length; i++) {
GerAdminobjectType gerAdminObject = geronimoConnector.getAdminobjectArray()[i];
for (int j = 0; j < gerAdminObject.getAdminobjectInstanceArray().length; j++) {
GerAdminobjectInstanceType gerAdminObjectInstance = gerAdminObject.getAdminobjectInstanceArray()[j];
String adminObjectObjectName = null;
try {