View Javadoc
1   package org.myorg.encconfig.ejb;
2   
3   import javax.ejb.EJB;
4   import javax.ejb.Stateless;
5   
6   //TODO: enc-config 30
7   //@Stateless
8   public class ConfigBeanEJB implements ConfigBeanRemote {
9       //TODO: enc-config 31
10      //@EJB
11      private SampleNoIfaceEJB noIface;
12      
13      //TODO: enc-config 33
14      @EJB//(beanName="Choice1EJB")
15      private SampleLocal localEJB;
16      
17      //TODO: enc-config 35
18      @EJB//(lookup="java:module/Choice2EJB!org.myorg.encconfig.ejb.SampleRemote")
19      private SampleRemote remoteEJB;
20      
21      @Override
22      public boolean haveNoIfaceEJB() {
23          return noIface!=null;
24      }
25      
26      @Override
27      public boolean haveLocalEJB() {
28          return localEJB!=null && "Choice1EJB".equals(localEJB.whoAreYou()); 
29      }
30      
31      @Override
32      public boolean haveRemoteEJB() {
33          return remoteEJB!=null && "Choice2EJB".equals(remoteEJB.whoAreYou());
34      }
35  }