MessageDestinationRefType[] messageDestinationRefs,
ServiceRefType[] serviceRefs,
GerServiceRefType[] gerServiceRefs,
GerGbeanRefType[] gerGbeanRefs,
ClassLoader cl) throws DeploymentException {
ComponentContextBuilder builder = new ComponentContextBuilder();
RefContext refContext = earContext.getRefContext();
Configuration earConfiguration = earContext.getConfiguration();
if (userTransaction != null) {
builder.addUserTransaction(userTransaction);
}
AbstractNameQuery corbaGBean = earContext.getCORBAGBeanObjectName();
if (corbaGBean != null) {
builder.addORB(earConfiguration.getId(), corbaGBean);
builder.addHandleDelegateReference(earConfiguration.getId(), corbaGBean);
}
URI moduleURI = module.getModuleURI();
addEnvEntries(envEntries, builder, cl);
if (ejbContext == null) {
ejbContext = earConfiguration;
}
// ejb-ref
addEJBRefs(earConfiguration, ejbContext, refContext, moduleURI, ejbRefs, mapEjbRefs(gerEjbRefs), cl, builder);
// ejb-local-ref
addEJBLocalRefs(ejbContext, refContext, moduleURI, ejbLocalRefs, mapEjbLocalRefs(gerEjbLocalRef), cl, builder);
// resource-ref
addResourceRefs(earConfiguration, refContext, resourceRefs, mapResourceRefs(gerResourceRef), cl, builder);
// resource-env-ref
addResourceEnvRefs(earConfiguration, refContext, resourceEnvRefs, mapResourceEnvRefs(gerResourceEnvRef), cl, builder);
addMessageDestinationRefs(earConfiguration, refContext, messageDestinationRefs, cl, builder);
// Map serviceRefMap = new HashMap();
// Map serviceRefCredentialsNameMap = new HashMap();
// mapServiceRefs(gerServiceRefs, serviceRefMap, serviceRefCredentialsNameMap);
Map serviceRefMap = mapServiceRefs(gerServiceRefs);
addServiceRefs(earContext, module, serviceRefs, serviceRefMap, cl, builder);
addGBeanRefs(earContext, builder, refContext, gerGbeanRefs, cl);
return builder.getContext();
}