public EjbLocalRef injectionTarget(final String className, final String property) { getInjectionTarget().add(new InjectionTarget(className, property)); if (this.ejbRefName == null) { this.ejbRefName = "java:comp/env/" + className + "/" + property; } return this; }
public String getName() { return getEjbRefName(); }
public String getInterface() { return getLocal(); }
EjbLocalRef ejbLocalRef = new EjbLocalRef(ejbRef); EjbLocalRef ref = localRefs.get(ejbLocalRef.getName()); if (ref.getLocal() == null) ref.setLocal(ejbLocalRef.getLocal()); if (ref.getLocalHome() == null) ref.setLocalHome(ejbLocalRef.getLocalHome()); if (ref.getMappedName() == null) ref.setMappedName(ejbLocalRef.getMappedName()); ref.getInjectionTarget().addAll(ejbLocalRef.getInjectionTarget()); return; break; case LOCAL: consumer.getEjbLocalRef().add(new EjbLocalRef(ejbRef)); break;
ejbLocalRef = new EjbLocalRef(); ejbLocalRef.setEjbRefName(localRefName); String localAnnotation = interfce.getName(); if (!localAnnotation.isEmpty()) { ejbLocalRef.setLocal(localAnnotation); ejbLocalRef.setEjbLink(beanName); ejbLocalRef.setMappedName(mappdedNameAnnotation); ejbLocalRef.setLookupName(lookupName); ejbLocalRef.setDescriptions(new Text[] {new Text(null, descriptionAnnotation)}); ejbLocalRef.setRefType(EjbReference.Type.LOCAL); annotatedApp.getEjbLocalRef().add(ejbLocalRef); Set<InjectionTarget> targets = ejbLocalRef.getInjectionTarget(); if (!hasTarget(method, field, targets)) { ejbLocalRef.getInjectionTarget().add(configureInjectionTarget(method, field));
@Override public void preProcessWebXmlElement(WebApp webApp, MergeContext mergeContext) throws DeploymentException { for (EjbLocalRef ejbLocalRef : webApp.getEjbLocalRef()) { String ejbLocalRefName = ejbLocalRef.getEjbRefName(); mergeContext.setAttribute(createEjbLocalRefKey(ejbLocalRefName), new MergeItem(ejbLocalRef, null, ElementSource.WEB_XML)); //Create an attribute tag to indicate whether injectTarget is configured in web.xml file if (ejbLocalRef.getInjectionTarget().size() > 0) { mergeContext.setAttribute(createEjbLocalRefInjectTargetConfiguredInWebXMLKey(ejbLocalRefName), Boolean.TRUE); } for (InjectionTarget injectionTarget : ejbLocalRef.getInjectionTarget()) { mergeContext.setAttribute(createEjbLocalRefInjectTargetKey(ejbLocalRefName, injectionTarget.getInjectionTargetClass(), injectionTarget.getInjectionTargetName() ), Boolean.TRUE); } } }
final EjbLink ejbLink = ejbDeployment.getEjbLink(ref.getName()); if (ejbLink != null && ejbLink.getDeployentId() != null /* don't overwrite with null */) { ref.setMappedName(ejbLink.getDeployentId());
String refName = localRefFromSpecDD.getEjbRefName(); localRefFromSpecDD.setMappedName(deploymentId.trim()); localRefFromSpecDD.setEjbLink(getStringValue(ejbLocalRefType.getEjbLink()));
public String getKey() { return getName(); }
public String getHome() { return getLocalHome(); }
public void setName(final String name) { setEjbRefName(name); }
ref.setRefType(EjbReference.Type.LOCAL); jndiConsumer.getEjbRef().remove(ref); jndiConsumer.getEjbLocalRef().add(new EjbLocalRef(ref)); } else { ref.setRefType(EjbReference.Type.REMOTE);
public String getType() { return getEjbRefType().name(); }
final EjbLocalRef ejbLocalRef = new EjbLocalRef(ejbRef); final EjbLocalRef ref = localRefs.get(ejbLocalRef.getName()); if (ref.getLocal() == null) { ref.setLocal(ejbLocalRef.getLocal()); if (ref.getLocalHome() == null) { ref.setLocalHome(ejbLocalRef.getLocalHome()); if (ref.getMappedName() == null) { ref.setMappedName(ejbLocalRef.getMappedName()); if(ref.getEjbLink() == null){ ref.setEjbLink(ejbLocalRef.getEjbLink()); ref.getInjectionTarget().addAll(ejbLocalRef.getInjectionTarget()); return; break; case LOCAL: consumer.getEjbLocalRef().add(new EjbLocalRef(ejbRef)); break;
public void merge(WebFragment webFragment, WebApp webApp, MergeContext mergeContext) throws DeploymentException { for (EjbLocalRef srcEjbLocalRef : webFragment.getEjbLocalRef()) { String ejbLocalRefName = srcEjbLocalRef.getEjbRefName(); String ejbLocalRefKey = createEjbLocalRefKey(ejbLocalRefName); MergeItem mergeItem = (MergeItem) mergeContext.getAttribute(ejbLocalRefKey); for (InjectionTarget injectTarget : srcEjbLocalRef.getInjectionTarget()) { String ejbLocalRefInjectTargetKey = createEjbLocalRefInjectTargetKey(ejbLocalRefName, injectTarget.getInjectionTargetClass(), injectTarget .getInjectionTargetName()); if (!mergeContext.containsAttribute(ejbLocalRefInjectTargetKey)) { ejbLocalRef.getInjectionTarget().add(injectTarget); mergeContext.setAttribute(ejbLocalRefInjectTargetKey, Boolean.TRUE); webApp.getEjbLocalRef().add(srcEjbLocalRef); mergeContext.setAttribute(ejbLocalRefKey, new MergeItem(srcEjbLocalRef, mergeContext.getCurrentJarUrl(), ElementSource.WEB_FRAGMENT)); for (InjectionTarget injectionTarget : srcEjbLocalRef.getInjectionTarget()) { mergeContext.setAttribute(createEjbLocalRefInjectTargetKey(ejbLocalRefName, injectionTarget.getInjectionTargetClass(), injectionTarget.getInjectionTargetName() ), Boolean.TRUE);
final EjbLink ejbLink = ejbDeployment.getEjbLink(ref.getName()); if (ejbLink != null && ejbLink.getDeployentId() != null /* don't overwrite with null */) { ref.setMappedName(ejbLink.getDeployentId());
public String getKey() { final String name = getName(); if (name == null || name.startsWith("java:")) return name; return "java:comp/env/" + name; }
public String getHome() { return getLocalHome(); }
public void setName(final String name) { setEjbRefName(name); }
ref.setRefType(EjbReference.Type.LOCAL); ejbRefs.remove(ref); ejbLocalRefs.add(new EjbLocalRef(ref)); } else { ref.setRefType(EjbReference.Type.REMOTE);