/** * Return an enterprise bean referenced by the EjbRef, if one exists. The ejb-link value * of the ref must equate to a named enterprise bean contained in the jar; otherwise return * null */ public EnterpriseBean getEnterpiseBeanFromRef(EjbRef ref) { String link = ref.getLink(); if (link == null) { return null; } return getEnterpriseBeanNamed(link); } public EnterpriseBean getEnterpriseBeanNamed(String ejbName) {
for (int i = 0; i < moduleReferences.size(); i++) { ref = (EjbRef) moduleReferences.get(i); link = ref.getLink(); if ((link != null && link.length() > 0 && !filterLinkedReferences) || ((link == null || link.length() == 0) && !filterNonLinkedReferences)) { if (filteredRefs == null)
/** * Return an enterprise bean referenced by the EjbRef, if one exists. The ejb-link value of the * ref must equate to a named enterprise bean contained in the jar; otherwise return null. * Returns the first hit found; assumption that the ejb names are unique within the scope of the * ear file. This will likely be replaced with a better way for dereferencing ejb refs. * * Can be used with ejb 1.1 references only. * * @deprecated {@link#getEnterpiseBeanFromRef(EjbRef ref, String moduleUri ) * @param EjbRef * ref - An ejb reference * @return EnterpriseBean */ public EnterpriseBean getEnterpiseBeanFromRef(EjbRef ref) { String link = ref.getLink(); if (link == null) { return null; } List jarFiles = getEJBJarFiles(); for (int i = 0; i < jarFiles.size(); i++) { EnterpriseBean bean = ((EJBJarFile) jarFiles.get(i)).getDeploymentDescriptor().getEnterpriseBeanNamed(link); if (bean != null) { return bean; } } return null; }
String link = ref.getLink(); if (link == null) { return null;
}/** * Return an enterprise bean referenced by the EjbRef, if one exists, within the scope of the parameter. * The ejb-link value of the ref must equate to a named enterprise bean contained in the jar; otherwise * return null */ public boolean isEquivalent(EjbRef anEjbRef) { if (anEjbRef == null) return false; boolean equiv = true; equiv = getName() == anEjbRef.getName() || (getName() != null && getName().equals(anEjbRef.getName())); if (equiv) equiv = getHome() == anEjbRef.getHome() || (getHome() != null && getHome().equals(anEjbRef.getHome())); if (equiv) equiv = getRemote() == anEjbRef.getRemote() || (getRemote() != null && getRemote().equals(anEjbRef.getRemote())); if (equiv) equiv = getLink() == anEjbRef.getLink() || (getLink() != null && getLink().equals(anEjbRef.getLink())); return equiv; } public boolean isLinked(EnterpriseBean anEJB) {