4 Replies Latest reply on Sep 6, 2001 5:03 AM by fmarchioni

    Local Interfaces: EJB2.0 - CMP Entity and SLSB

    hunterhillegas

      Anyone have an example of calling a CMP Entity Bean (2.0) from a SLSB using the new local interfaces?

        • 1. Re: Local Interfaces: EJB2.0 - CMP Entity and SLSB

          You need a ejb-local-ref in the slsb section of your ejb-jar.xml
          i.e.:
          <ejb-local-ref>
          <ejb-ref-name>SelectionEntity</ejb-ref-name>
          <ejb-ref-type>Entity</ejb-ref-type>
          <ejb-link>SelectionEJB</ejb-link>
          <local-home>eacm.ejb.SelectionHome</local-home>
          eacm.ejb.Selection
          </ejb-local-ref>

          than you can lookup the local home interface in slsb implementation:

          Context initial = new InitialContext();
          (SelectionHome)initial.lookup "java:comp/env/SelectionEntity");

          • 2. Re: Local Interfaces: EJB2.0 - CMP Entity and SLSB

            Hi all,
            I'd like to get involved in the topic as I have a doubt about local interfaces: How do I tell a SLSB to call an Entity Bean via Local interface ? it's completely automatic ? just mention that the Entity Bean has got a local interface and the SLSB -IF- living in the same container will direct to it transparentely ?

            Thanks a lot
            Francesco

            • 3. Re: Local Interfaces: EJB2.0 - CMP Entity and SLSB

              If You make a lookup with a name specified in a ejb-local-ref section You'll get a local interface.
              (if you lookup with the ejb-name you get the remote interface)
              In jBoss 3.0 it will be posible to define a ejb-local-name in the entity section of ejb-jar.xml. Then you can use lookup "java:/<local-nam>");
              (whithout comp/env)

              • 4. Re: Local Interfaces: EJB2.0 - CMP Entity and SLSB

                Hi. Thanks for replying. I have a last issue if you don't mind. What is the difference between "standard" EJB-EJB calls (from withing the same container) and EJB-Local Interface approach ? In both case the network is cut out, so the main benefit could be that with local interface you can achieve pass by reference semantics, while with standard EJB-EJB intra-container calls you have to use pass by value. Do you agree with me ?

                Thanks & Regards
                Francesco