final Object reference;
if (URL.class.equals(type)) {
reference = new URLReference(referenceInfo.resourceID);
} else if (type.isAnnotationPresent(ManagedBean.class)) {
final ManagedBean managed = type.getAnnotation(ManagedBean.class);
final String name = managed.value().length() == 0 ? type.getSimpleName() : managed.value();
reference = new LinkRef("module/" + name);
} else if (referenceInfo.resourceID != null) {
final String jndiName = "openejb/Resource/" + referenceInfo.resourceID;
reference = new IntraVmJndiReference(jndiName);
} else {