} else if (ORB.class.isAssignableFrom(iface)) {
CorbaGBeanNameSource corbaGBeanNameSource = (CorbaGBeanNameSource) corbaGBeanNameSourceCollection.getElement();
if (corbaGBeanNameSource == null) {
throw new DeploymentException("No orb setup but there is a orb reference");
}
AbstractNameQuery corbaName = corbaGBeanNameSource.getCorbaGBeanName();
if (corbaName != null) {
Artifact[] moduleId = module.getConfigId();
Map context = getJndiContextMap(componentContext);
context.put(ENV + name, new ORBReference(moduleId, corbaName));
EnvironmentBuilder.mergeEnvironments(module.getEnvironment(), corbaEnvironment);
}
} else {
//determine jsr-77 type from interface
String j2eeType;
if (JAVAX_MAIL_SESSION_CLASS.equals(type)) {
j2eeType = NameFactory.JAVA_MAIL_RESOURCE;
} else if (JAXR_CONNECTION_FACTORY_CLASS.equals(type)) {
j2eeType = NameFactory.JAXR_CONNECTION_FACTORY;
} else {
j2eeType = NameFactory.JCA_MANAGED_CONNECTION_FACTORY;
}
try {
AbstractNameQuery containerId = getResourceContainerId(name, j2eeType, null, gerResourceRef);
module.getEarContext().findGBean(containerId);
Object ref = new ResourceReferenceFactory<ResourceException>(module.getConfigId(), containerId, iface);
getJndiContextMap(componentContext).put(ENV + name, ref);