4 Replies Latest reply on Jul 10, 2002 10:46 AM by marc.fleury

    Jboss 2.4.4 & Local Interfaces

    cybertimo

      Hi
      I'm currently using Jboss 2.4.4
      I use a session bean to provide clients access to my entity beans. (The session facade as mentioned in the execellent book "EJB design patterns by Floyd Marinescu").
      Everything work well when i access my session bean accesses my entity beans through their remote interfaces. But that isn't the case when i try to access them through their local interfaces.
      The question i'm asking is there a special configuartion i should make with Joss2.4.4 or the container itself doesn't support local interfaces ??
      Your help will be greatly appreciated
      Cheers
      Timo

        • 1. Re: Jboss 2.4.4 & Local Interfaces

          There are 2 solutions to the problem:

          1. If you only want to avoid the performance impact of remote method calls, use the 'optimize' option of JBoss jboss.xml.

          2. If you want to use local interfaces because you want to use the application with other application servers, then you can try the following. It worked for me.
          Use only <ejb-local-ref> tag to refer to other EJBs behind the session facade. With this you can use local interfaces and it also makes your code more portable.

          Niranjan

          • 2. Re: Jboss 2.4.4 & Local Interfaces

            There are 2 solutions to the problem:

            1. If you only want to avoid the performance impact of remote method calls, use the 'optimize' option of JBoss jboss.xml.

            2. If you want to use local interfaces because you want to use the application with other application servers, then you can try the following. It worked for me.
            Use only <ejb-local-ref> tag to refer to other EJBs behind the session facade. With this you can use local interfaces and it also makes your code more portable.

            Niranjan

            • 3. Re: Jboss 2.4.4 & Local Interfaces

              There are 2 solutions to the problem:

              1. If you only want to avoid the performance impact of remote method calls, use the 'optimize' option of JBoss jboss.xml.

              2. If you want to use local interfaces because you want to use the application with other application servers, then you can try the following. It worked for me.
              Use only <ejb-local-ref> tag to refer to other EJBs behind the session facade. With this you can use local interfaces and it also makes your code more portable.

              Niranjan

              • 4. Re: Jboss 2.4.4 & Local Interfaces
                marc.fleury

                There is no need to use local interfaces in the session facade case. The reason is that the 2.x and 3.x series optimize the communication away. What this means is that they both behave the same. Don't bother then.

                A better venue to learn all of this is one of our trainings (in this case the advanced training) where we cover all of those little tricks. Patterns are a piece of bullcrap, getting the stuff to run well is an art. Sorry for the shameless plug but really we spend 4 days talking about that.