5 Replies Latest reply on Jun 22, 2016 9:53 AM by mkouba

    access modifier of InternalEjbDescriptor is removed?

    mulderbaba

      is there any specific reason about removing the public access modifier on class InternalEjbDescriptor while moving it to the EJB module? This class is being accessed via glassfish code base so removing the modifier makes it inaccessible with weld 3.x.

        • 1. Re: access modifier of InternalEjbDescriptor is removed?
          mkouba

          Hi Mert,

          InternalEjbDescriptor is not (and never was) a part of the Weld API/SPI - it's an internal Weld construct. So an integrator should not use it at all. Is there a reason why GlassFish does not provide its own implementation of org.jboss.weld.ejb.spi.EjbDescriptor?

          • 2. Re: access modifier of InternalEjbDescriptor is removed?
            mulderbaba

            InternalEjbDescriptor is being used by registerInterceptors method of EjbServicesImpl class. Actually its not like providing its own implementation but it does an instanceof check on EjbDescriptor as:

            if (ejbDesc instanceof org.jboss.weld.ejb.InternalEjbDescriptor) {

              ejbDesc = ((org.jboss.weld.ejb.InternalEjbDescriptor<?>) ejbDesc).delegate();

            }

            • 3. Re: access modifier of InternalEjbDescriptor is removed?
              mkouba

              InternalEjbDescriptor extends ForwardingEjbDescriptor so all the EjbDescriptor methods are delegated to the underlying EjbDescriptor instance. Is there a reason to unwrap the descriptor? I believe it should be safe to use the EjbDescriptor contract - no need to unwrap the instance.

              • 4. Re: access modifier of InternalEjbDescriptor is removed?
                mulderbaba

                Martin,

                The statement from the code is:

                // Work around bug that ejbDesc might be internal 299 descriptor.

                which is available within glassfish source. I am looking into the real reason. If I cannot find a solid reason, I'll get rid of the unwrapping.

                • 5. Re: access modifier of InternalEjbDescriptor is removed?
                  mkouba

                  I see. So the problem is the EjbServicesImpl needs to access the underlying org.glassfish.weld.ejb.EjbDescriptorImpl instance. There is no guarantee the EjbDescriptor instance passed to org.jboss.weld.ejb.spi.EjbServices.registerInterceptors(EjbDescriptor<?>, InterceptorBindings) will be of any specific implementation. In other words, integrators should not count on it. On the other hand, it's not explicitly defined and integrators may be expecting this.

                   

                  Also it seems it's safe to expect the type provided by org.jboss.weld.bootstrap.spi.BeanDeploymentArchive.getEjbs() for resolveEjb() method but NOT for registerInterceptors() method. Which is a bit odd.

                   

                  I've created WELD-2184 to track this issue.