}
}
final ResourceInfo resourceInfo = configFactory.configureService(resource, ResourceInfo.class);
resourceInfo.originAppName = module.getModuleId();
final ResourceRef resourceRef = new ResourceRef();
resourceRef.setResType(chooseType(module.getClassLoader(), resourceInfo.types, resource.getType()));
if (shouldGenerateJdbcUrl) {
properties.remove(ORIGIN_FLAG);
resourceRef.setResRefName(dataSourceLookupName(resource));
} else {
resourceRef.setResRefName(OPENEJB_RESOURCE_JNDI_PREFIX + resourceInfo.id);
}
resourceRef.setMappedName(resourceInfo.id);
final ResourceRef strictRef = new ResourceRef(OPENEJB_RESOURCE_JNDI_PREFIX + originalId,
resourceRef.getResType(),
resourceRef.getResAuth(),
resourceRef.getResSharingScope());
strictRef.setMappedName(resourceInfo.id);
for (final JndiConsumer consumer : jndiConsumers) {
addResource(consumer, resourceRef); // for injections etc...
if (!"/".equals(modulePrefix)) {
addResource(consumer, strictRef); // for lookups (without prefix)