/** * Set the type information for the EJB starting with the EJB business * interface, but only if it hasn't already been set. */ private void setEjbIntfType(EjbReferenceDescriptor ejbRef, Class beanInterface) { if (ejbRef.getEjbInterface() != null) return; // only set it if not already set by DD ejbRef.setEjbInterface(beanInterface.getName()); if (beanInterface.getAnnotation(Local.class) != null) { ejbRef.setLocal(true); } else if (beanInterface.getAnnotation(Remote.class) != null) { ejbRef.setLocal(false); } else { // Assume remote for now. We can't know for sure until the // post-validation stage. Even though local business will // probably be more common than remote business, defaulting // to remote business simplifies the post-application // validation logic considerably. See // EjbBundleValidator.accept(EjbReferenceDescriptor) // for more details. ejbRef.setLocal(false); } ejbRef.setType(EjbSessionDescriptor.TYPE); }
/** * Set the type information for the EJB starting with the EJB business * interface, but only if it hasn't already been set. */ private void setEjbIntfType(EjbReferenceDescriptor ejbRef, Class beanInterface) { if (ejbRef.getEjbInterface() != null) return; // only set it if not already set by DD ejbRef.setEjbInterface(beanInterface.getName()); if (beanInterface.getAnnotation(Local.class) != null) { ejbRef.setLocal(true); } else { // If beanInterface has @Remote annotation, setLocal(false); // If beanInterface has neither @Local nor @Remote, // assume remote for now. We can't know for sure until the // post-validation stage. Even though local business will // probably be more common than remote business, defaulting // to remote business simplifies the post-application // validation logic considerably. See // EjbBundleValidator.accept(EjbReferenceDescriptor) // for more details. ejbRef.setLocal(false); } ejbRef.setType(EjbSessionDescriptor.TYPE); }
ejbRef.setLocal(EJBLocalHome.class.isAssignableFrom(beanInterface)); ejbRef.setType(targetBeanType);
ejbRef.setLocal(EJBLocalHome.class.isAssignableFrom(beanInterface)); ejbRef.setType(targetBeanType);