2 Replies Latest reply on Sep 22, 2006 6:20 AM by Stefan Norberg

    @Local AND @Remote?

    Stefan Norberg Newbie

      If we declare a Bean class to use both @Remote and @Local the intra-JVM calss server calls are made using the remote interface if using @EJB in another SLSB. Why?

      public interface FooApi {
      String hello(String name);
      }

      @Remote(FooApi .class)
      @Local(FooApi .class)
      @Stateless
      public class FooApiBean implements FooApi {

      public String hello(String name) {
      return "hello " + name;
      }
      }

      public interface BarApi {
      String hello(String name);
      }

      @Remote(BarApi .class)
      @Stateless
      public class BarApiBean implements BarApi {

      @EJB FooApi foo; <--------- remote proxy is used here, why???

      public String hello(String name) {
      return foo.hello(name);
      }
      }