public String getLocal() { return decoree.getEjbInterface(); }
public String getLocal() { return decoree.getEjbInterface(); }
@Override public String getInjectResourceType() { return isEJB30ClientView() ? getEjbInterface() : getEjbHomeInterface(); }
public String getInjectResourceType() { return isEJB30ClientView() ? getEjbInterface() : getEjbHomeInterface(); }
/** returns a formatted string representing me. */ public void print(StringBuffer toStringBuffer) { String localVsRemote = isLocal() ? "Local" : "Remote"; toStringBuffer.append(localVsRemote + " ejb-ref "); toStringBuffer.append("name="+getName()); if( isEJB30ClientView() ) { toStringBuffer.append("," + localVsRemote + " 3.x interface ="+getEjbInterface()); } else { toStringBuffer.append("," + localVsRemote + " 2.x home ="+getEjbHomeInterface()); toStringBuffer.append("," + localVsRemote + " 2.x component interface="+getEjbInterface()); } if( ejbDescriptor != null ) { toStringBuffer.append(" resolved to intra-app EJB "+ejbDescriptor.getName() + " in module " + ejbDescriptor.getEjbBundleDescriptor().getModuleName()); } toStringBuffer.append(",ejb-link="+getLinkName()); toStringBuffer.append(",lookup="+getLookupName()); toStringBuffer.append(",mappedName="+getMappedName()); toStringBuffer.append(",jndi-name=" + getValue()); toStringBuffer.append(",refType="+getType()); }
/** returns a formatted string representing me. */ @Override public void print(StringBuffer toStringBuffer) { String localVsRemote = isLocal() ? "Local" : "Remote"; toStringBuffer.append(localVsRemote + " ejb-ref "); toStringBuffer.append("name="+getName()); if( isEJB30ClientView() ) { toStringBuffer.append("," + localVsRemote + " 3.x interface ="+getEjbInterface()); } else { toStringBuffer.append("," + localVsRemote + " 2.x home ="+getEjbHomeInterface()); toStringBuffer.append("," + localVsRemote + " 2.x component interface="+getEjbInterface()); } if( ejbDescriptor != null ) { toStringBuffer.append(" resolved to intra-app EJB "+ejbDescriptor.getName() + " in module " + ejbDescriptor.getEjbBundleDescriptor().getModuleName()); } toStringBuffer.append(",ejb-link="+getLinkName()); toStringBuffer.append(",lookup="+getLookupName()); toStringBuffer.append(",mappedName="+getMappedName()); toStringBuffer.append(",jndi-name=" + getValue()); toStringBuffer.append(",refType="+getType()); }
/** * 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); }
/** * 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); }
private String getRemoteEjbJndiName(EjbReferenceDescriptor refDesc) { String intf = refDesc.isEJB30ClientView() ? refDesc.getEjbInterface() : refDesc.getHomeClassName(); return getRemoteEjbJndiName(refDesc.isEJB30ClientView(), intf, refDesc.getJndiName()); }
public boolean isConflict(EjbReferenceDescriptor other) { return (getName().equals(other.getName())) && (!( DOLUtils.equals(getType(), other.getType()) && DOLUtils.equals(getEjbHomeInterface(), other.getEjbHomeInterface()) && DOLUtils.equals(getEjbInterface(), other.getEjbInterface()) && DOLUtils.equals(getLinkName(), other.getLinkName()) ) || isConflictResourceGroup(other)); } }
boolean isConflict(EjbReferenceDescriptor other) { return (getName().equals(other.getName())) && (!( DOLUtils.equals(getType(), other.getType()) && DOLUtils.equals(getEjbHomeInterface(), other.getEjbHomeInterface()) && DOLUtils.equals(getEjbInterface(), other.getEjbInterface()) && DOLUtils.equals(getLinkName(), other.getLinkName()) ) || isConflictResourceGroup(other)); } }
public static Object resolveEjbRefObject(EjbReferenceDescriptor refDesc, Object jndiObj) throws NamingException { Object returnObject = jndiObj; if( refDesc.isLocal() ) { EjbDescriptor target = refDesc.getEjbDescriptor(); BaseContainer container = EjbContainerUtilImpl.getInstance().getContainer(target.getUniqueId()); if( refDesc.isEJB30ClientView() ) { GenericEJBLocalHome genericLocalHome = container.getEJBLocalBusinessHome(refDesc.getEjbInterface()); returnObject = genericLocalHome.create(refDesc.getEjbInterface()); } else { returnObject = container.getEJBLocalHome(); } } else { // For the Remote case, the only time we have to do // something extra with the given jndiObj is if the lookup // is for a Remote 3.0 object and it was made through a // corba interoperable name. In that case, // the jndiObj refers to the internal Remote 3.0 Home so we // still need to create a remote 30 client wrapper object. if ( refDesc.isEJB30ClientView() && !(jndiObj instanceof RemoteBusinessWrapperBase) ) { returnObject = EJBUtils.lookupRemote30BusinessObject (jndiObj, refDesc.getEjbInterface()); } } return returnObject; }
public static Object resolveEjbRefObject(EjbReferenceDescriptor refDesc, Object jndiObj) throws NamingException { Object returnObject = jndiObj; if( refDesc.isLocal() ) { EjbDescriptor target = refDesc.getEjbDescriptor(); BaseContainer container = EjbContainerUtilImpl.getInstance().getContainer(target.getUniqueId()); if( refDesc.isEJB30ClientView() ) { GenericEJBLocalHome genericLocalHome = container.getEJBLocalBusinessHome(refDesc.getEjbInterface()); returnObject = genericLocalHome.create(refDesc.getEjbInterface()); } else { returnObject = container.getEJBLocalHome(); } } else { // For the Remote case, the only time we have to do // something extra with the given jndiObj is if the lookup // is for a Remote 3.0 object and it was made through a // corba interoperable name. In that case, // the jndiObj refers to the internal Remote 3.0 Home so we // still need to create a remote 30 client wrapper object. if ( refDesc.isEJB30ClientView() && !(jndiObj instanceof RemoteBusinessWrapperBase) ) { returnObject = EJBUtils.lookupRemote30BusinessObject (jndiObj, refDesc.getEjbInterface()); } } return returnObject; }
/** * Actual jndi-name under which Remote ejb factory lives depends on * whether it's a Remote Home view or Remote Business view. This is * necessary since a single session bean can expose both views and * the resulting factory objects are different. These semantics are * not exposed to the developer-view to keep things simpler. The * developer can simply deal with a single physical jndi-name. If the * target bean exposes both a Remote Home view and a Remote Business * view, the developer can still use the single physical jndi-name * to resolve remote ejb-refs, and we will handle the distinction * internally. Of course, this is based on the assumption that the * internal name is generated in a way that will not clash with a * separate top-level physical jndi-name chosen by the developer. * * Note that it's better to delay this final jndi name translation as * much as possible and do it right before the NamingManager lookup, * as opposed to changing the jndi-name within the descriptor objects * themselves. This way, the extra indirection will not be exposed * if the descriptors are written out and they won't complicate any * jndi-name equality logic. * */ public static String getRemoteEjbJndiName(EjbReferenceDescriptor refDesc) { String intf = refDesc.isEJB30ClientView() ? refDesc.getEjbInterface() : refDesc.getHomeClassName(); return getRemoteEjbJndiName(refDesc.isEJB30ClientView(), intf, refDesc.getJndiName()); }
/** * Actual jndi-name under which Remote ejb factory lives depends on * whether it's a Remote Home view or Remote Business view. This is * necessary since a single session bean can expose both views and * the resulting factory objects are different. These semantics are * not exposed to the developer-view to keep things simpler. The * developer can simply deal with a single physical jndi-name. If the * target bean exposes both a Remote Home view and a Remote Business * view, the developer can still use the single physical jndi-name * to resolve remote ejb-refs, and we will handle the distinction * internally. Of course, this is based on the assumption that the * internal name is generated in a way that will not clash with a * separate top-level physical jndi-name chosen by the developer. * * Note that it's better to delay this final jndi name translation as * much as possible and do it right before the NamingManager lookup, * as opposed to changing the jndi-name within the descriptor objects * themselves. This way, the extra indirection will not be exposed * if the descriptors are written out and they won't complicate any * jndi-name equality logic. * */ public static String getRemoteEjbJndiName(EjbReferenceDescriptor refDesc) { String intf = refDesc.isEJB30ClientView() ? refDesc.getEjbInterface() : refDesc.getHomeClassName(); return getRemoteEjbJndiName(refDesc.isEJB30ClientView(), intf, refDesc.getJndiName()); }
ejbRefDesc.getEjbInterface() : ejbRefDesc.getHomeClassName(); origClassLoader.loadClass(refInterface);
ejbRefDesc.getEjbInterface() : ejbRefDesc.getHomeClassName(); origClassLoader.loadClass(refInterface);