/** * return the jndi name of the bean to which I refer. */ public String getJndiName() { String jndiName = this.getValue(); if( isLocal() ) { // mapped-name has no meaning for the local ejb view. ejb-link // should be used to resolve any ambiguities about the target // local ejb. return jndiName; } else { return (jndiName != null && ! jndiName.equals("")) ? jndiName : getMappedName(); } }
/** * return the jndi name of the bean to which I refer. */ @Override public String getJndiName() { String jndiName = this.getValue(); if( isLocal() ) { // mapped-name has no meaning for the local ejb view. ejb-link // should be used to resolve any ambiguities about the target // local ejb. return jndiName; } else { return (jndiName != null && ! jndiName.equals("")) ? jndiName : getMappedName(); } }
/** * Return the jndi name of the bean to which I refer. */ public String getValue() { if (ejbDescriptor == null) { return super.getValue(); } else { if (isLocal()) { return super.getValue(); } else { return ejbDescriptor.getJndiName(); } } }
/** * Return the jndi name of the bean to which I refer. */ @Override public String getValue() { if (ejbDescriptor == null) { return super.getValue(); } else { if (isLocal()) { return super.getValue(); } else { return ejbDescriptor.getJndiName(); } } }
/** 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()); }
/** * Sets the ejb descriptor to which I refer. * @param ejbDescriptor the ejb descriptor referenced, null if it is unknow at this time */ public void setEjbDescriptor(EjbDescriptor ejbDescriptor) { if (this.ejbDescriptor != null) { this.ejbDescriptor.removeEjbReferencer(this); // remove previous referencer } this.ejbDescriptor=ejbDescriptor; if (ejbDescriptor!=null) { ejbDescriptor.addEjbReferencer(this); if (isLocal()) { if (!ejbDescriptor.isLocalInterfacesSupported() && !ejbDescriptor.isLocalBusinessInterfacesSupported() && !ejbDescriptor.isLocalBean()) { throw new RuntimeException(localStrings.getLocalString( "entreprise.deployment.invalidLocalInterfaceReference", "Trying to set an ejb-local-ref on an EJB while the EJB does not define local interfaces")); } } else { if (!ejbDescriptor.isRemoteInterfacesSupported() && !ejbDescriptor.isRemoteBusinessInterfacesSupported()) { throw new RuntimeException(localStrings.getLocalString( "entreprise.deployment.invalidRemoteInterfaceReference", "Trying to set an ejb-ref on an EJB, while the EJB does not define remote interfaces")); } } } }
if( ejbRefDesc.isLocal() ) {
if( ejbRefDesc.isLocal() ) {
/** * Sets the ejb descriptor to which I refer. * @param ejbDescriptor the ejb descriptor referenced, null if it is unknown at this time */ @Override public void setEjbDescriptor(EjbDescriptor ejbDescriptor) { if (this.ejbDescriptor != null) { this.ejbDescriptor.removeEjbReferencer(this); // remove previous referencer } this.ejbDescriptor=ejbDescriptor; if (ejbDescriptor!=null) { ejbDescriptor.addEjbReferencer(this); if (isLocal()) { if (!ejbDescriptor.isLocalInterfacesSupported() && !ejbDescriptor.isLocalBusinessInterfacesSupported() && !ejbDescriptor.isLocalBean()) { throw new RuntimeException(localStrings.getLocalString( "entreprise.deployment.invalidLocalInterfaceReference", "Trying to set an ejb-local-ref on an EJB while the EJB [{0}] does not define local interfaces", new Object[] {ejbDescriptor.getName()})); } } else { if (!ejbDescriptor.isRemoteInterfacesSupported() && !ejbDescriptor.isRemoteBusinessInterfacesSupported()) { throw new RuntimeException(localStrings.getLocalString( "entreprise.deployment.invalidRemoteInterfaceReference", "Trying to set an ejb-ref on an EJB, while the EJB [{0}] does not define remote interfaces", new Object[] {ejbDescriptor.getName()})); } } } }
if (ejbRef.isLocal()) {
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; }