4 Replies Latest reply on May 8, 2008 12:07 PM by Andrew Rubinger

    Annotated EJB References in MappedReferenceMetadataDeployer

    Andrew Rubinger Master

      Defining issue:

      http://jira.jboss.com/jira/browse/EJBTHREE-1338

      See latest comment:

      "ALR" wrote:
      AnnotatedEJBReferencesMetaData annotatedRefs = env.getAnnotatedEjbReferences();

      ...from MappedReferenceMetadataDeployer.resolve(ContainerDependencyMetaData cdmd, DeploymentUnit unit,
      Map<String, ContainerDependencyMetaData> endpointMap,
      Environment env,
      DeploymentEndpointResolver resolver,
      List<String> unresolvedRefs)

      ...marks annotatedRefs as null. Would be populated at this stage, I would think?


      S,
      ALR

        • 1. Re: Annotated EJB References in MappedReferenceMetadataDeplo
          Andrew Rubinger Master

          This is leading to wrong resolution of getResolvedJndiName() from AnnotatedEJBReferencesMetaData.

          S,
          ALR

          • 2. Re: Annotated EJB References in MappedReferenceMetadataDeplo
            Scott Stark Master

            Ok, I have taken the EJBTHREE-1338 issue and will look at it tonight.

            • 3. Re: Annotated EJB References in MappedReferenceMetadataDeplo
              Scott Stark Master

              With the current 1.0.0.Beta13 release of metadata and updates to MappedReferenceMetadataDeployer, the @EJB(home) and @EJB(localBusiness) resolve to:

              2008-05-07 22:43:48,807 DEBUG [org.jboss.deployment.MappedReferenceMetaDataResolverDeployer] (RMI TCP Connection(4)-127.0.0.1) Processing unit=ejbthree1154.jar,
               structure:ejbthree1154.jar+EjbEndpoint:ejbName=TestBean,ejbClass=org.jboss.ejb3.test.ejbthree1154.TestBean
              ,home=org.jboss.ejb3.test.ejbthree1154.TestRemoteHome,BusinessLocals: [org.jboss.ejb3.test.ejbthree1154.TestLocalBusiness],BusinessRemotes: [org.jboss.ejb3.test.ejbthree1154.TestRemoteBusiness]
              +EjbEndpoint:ejbName=DelegateBean,ejbClass=org.jboss.ejb3.test.ejbthree1154.Dele
              gateBean,BusinessRemotes: [org.jboss.ejb3.test.ejbthree1154.DelegateRemoteBusiness]
              ++@EJB(home) -> mappedName=null| resolvedJndiName=TestBean/localHome
              ++@EJB(localBusiness) -> mappedName=null| resolvedJndiName=TestBean/org.jboss.ejb3.test.ejbthree1154.TestLocalBusiness
              


              as determined by the new determineResolvedJndiName(iface) method on the JBossEnterpriseBeanMetaData, but the bindings for the interfaces on the bean are:
               +- TestBean (class: org.jnp.interfaces.NamingContext)
               | +- remoteHome (proxy: $Proxy128 implements interface org.jboss.ejb3.test.ejbthree1154.TestRemoteHome)
               | +- local (proxy: $Proxy129 implements interface org.jboss.ejb3.test.ejbthree1154.TestLocalBusiness,interface org.jboss.ejb3.proxy.JBossProxy)
               | +- remote (proxy: $Proxy126 implements interface org.jboss.ejb3.proxy.JBossProxy,interface org.jboss.ejb3.test.ejbthree1154.TestRemoteBusiness)
               | +- localHome (proxy: $Proxy131 implements interface org.jboss.ejb3.test.ejbthree1154.TestLocalHome)
              


              The logic for the BasicJndiBindingPolicy is to use the /local, /localHome, /remote and /remoteHome suffixes for the interfaces matching the metadata getLocal(), getLocalHome(), getRemote() and getHome() values. All others are bound under a suffix equal to the interface name. Here org.jboss.ejb3.test.ejbthree1154.TestLocalBusiness is a BusinessLocal interface rather than the getLocal() value so its expected to be bound under
              TestBean/org.jboss.ejb3.test.ejbthree1154.TestLocalBusiness rather than TestBean/local.

              So what happens when there is a getLocal() and BusinessLocal interfaces? Either the default binding policy needs to be updated or the proxy layer needs to use the new determineResolvedJndiName(iface, summary) method to get the jndi name to use.


              • 4. Re: Annotated EJB References in MappedReferenceMetadataDeplo
                Andrew Rubinger Master

                 

                "scott.stark@jboss.org" wrote:
                So what happens when there is a getLocal() and BusinessLocal interfaces?


                Should be as follows by default:

                * /local > Proxy implementing all Local Business Interfaces
                * /remote > Proxy implementing all Remote Business Interfaces

                The only way to obtain a EJB 2.1 local or remote view is via its corresponding "Home.create()", so we won't bind these in JNDI directly.

                Since /local and /remote above are non-deterministic in terms of "getInvokedBusinessInterface()", we'll provide mechanisms for additional lookup values that will be interface-specific.

                Will make a new topic today to discuss my propositions for what objects (References, Proxies, ObjectFactories) get bound where in order to achieve this.

                S,
                ALR