private static void addResource(final JndiConsumer consumer, final ResourceRef resourceRef) { final ResourceRef existing = consumer.getResourceRefMap().get(resourceRef.getKey()); if (existing != null) { existing.setMappedName(resourceRef.getMappedName()); } else { consumer.getResourceRef().add(resourceRef); } }
private static void addResource(final JndiConsumer consumer, final ResourceRef resourceRef) { final ResourceRef existing = consumer.getResourceRefMap().get(resourceRef.getKey()); if (existing != null) { existing.setMappedName(resourceRef.getMappedName()); } else { consumer.getResourceRef().add(resourceRef); } }
private List<ResourceReferenceInfo> buildResourceRefInfos(JndiConsumer item) { List<ResourceReferenceInfo> infos = new ArrayList<ResourceReferenceInfo>(); for (ResourceRef res : item.getResourceRef()) { ResourceReferenceInfo info = new ResourceReferenceInfo(); if (res.getResAuth() != null) { info.referenceAuth = res.getResAuth().toString(); } else { info.referenceAuth = ResAuth.CONTAINER.toString(); } info.referenceName = res.getResRefName(); info.referenceType = res.getResType(); info.resourceID = res.getMappedName(); info.location = buildLocationInfo(res); info.targets.addAll(buildInjectionInfos(res)); infos.add(info); } return infos; }
String mappedName = ref.getMappedName(); if (mappedName == null) mappedName = ""; if (mappedName.startsWith("jndi:")){
final String mappedName = ref.getMappedName() == null ? "" : ref.getMappedName(); if (mappedName.startsWith("jndi:")) { return;
final String mappedName = ref.getMappedName() == null ? "" : ref.getMappedName(); if (mappedName.startsWith("jndi:")) { return;
final String mappedName = ref.getMappedName() == null ? "" : ref.getMappedName(); if (mappedName.startsWith("jndi:")) { continue;
private void processResourceRef(ResourceRef ref, EjbDeployment ejbDeployment, AppResources appResources) throws OpenEJBException { // skip destinations with a global jndi name String mappedName = ref.getMappedName(); if (mappedName == null) mappedName = ""; if ((mappedName).startsWith("jndi:")){ return; } String refName = ref.getName(); String refType = ref.getType(); // skip references such as URLs which are automatically handled by the server if (ignoredReferenceTypes.contains(refType)) { return; } ResourceLink link = ejbDeployment.getResourceLink(refName); if (link == null) { String id = (mappedName.length() == 0) ? ref.getName() : mappedName; id = getResourceId(ejbDeployment.getDeploymentId(), id, refType, appResources); logger.info("Auto-linking resource-ref '" + refName + "' in bean " + ejbDeployment.getDeploymentId() + " to Resource(id=" + id + ")"); link = new ResourceLink(); link.setResId(id); link.setResRefName(refName); ejbDeployment.addResourceLink(link); } else { String id = getResourceId(ejbDeployment.getDeploymentId(), link.getResId(), refType, appResources); link.setResId(id); link.setResRefName(refName); } }
final String mappedName = ref.getMappedName() == null ? "" : ref.getMappedName(); if (mappedName.startsWith("jndi:")) { continue;
private void buildResourceRefInfos(final JndiConsumer item, final JndiEncInfo moduleJndiEnc, final JndiEncInfo compJndiEnc) { for (final ResourceRef res : item.getResourceRef()) { final ResourceReferenceInfo info; if (res instanceof ContextRef) { info = new ContextReferenceInfo(); } else { info = new ResourceReferenceInfo(); } if (res.getResAuth() != null) { info.referenceAuth = res.getResAuth().toString(); } else { info.referenceAuth = ResAuth.CONTAINER.toString(); } info.referenceName = res.getResRefName(); info.referenceType = res.getResType(); info.resourceID = res.getMappedName(); info.location = buildLocationInfo(res); info.targets.addAll(buildInjectionInfos(res)); insert( info, appInfo.globalJndiEnc.resourceRefs, appInfo.appJndiEnc.resourceRefs, moduleJndiEnc.resourceRefs, compJndiEnc.resourceRefs ); } }
private void buildResourceRefInfos(final JndiConsumer item, final JndiEncInfo moduleJndiEnc, final JndiEncInfo compJndiEnc) { for (final ResourceRef res : item.getResourceRef()) { final ResourceReferenceInfo info; if (res instanceof ContextRef) { info = new ContextReferenceInfo(); } else { info = new ResourceReferenceInfo(); } if (res.getResAuth() != null) { info.referenceAuth = res.getResAuth().toString(); } else { info.referenceAuth = ResAuth.CONTAINER.toString(); } info.referenceName = res.getResRefName(); info.referenceType = res.getResType(); info.resourceID = res.getMappedName(); info.location = buildLocationInfo(res); info.targets.addAll(buildInjectionInfos(res)); insert( info, appInfo.globalJndiEnc.resourceRefs, appInfo.appJndiEnc.resourceRefs, moduleJndiEnc.resourceRefs, compJndiEnc.resourceRefs ); } }