Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Wiki Markup
{snippet:id=code|url=openejb3/examples/injection-of-ejbs/src/main/java/org/superbiz/injection/DataStoreRemote.java|lang=java}

DataReader session bean

...

Bean

Wiki Markup
{snippet:id=code|url=openejb3/examples/injection-of-ejbs/src/main/java/org/superbiz/injection/DataReaderLocalDataReaderImpl.java|lang=java}

...

Note the usage of the @EJB annotation on the DataStoreRemote and DataStoreLocal fields. This is the minimum required for EJB ref resolution. If you have two beans that implement the same business interfaces, you'll want to the beanName attribute as follows:

Code Block

@EJB(beanName = "DataStoreImpl") 
private DataStoreRemote dataStoreRemote;

@EJB(beanName = "DataStoreImpl") 
private DataStoreLocal dataStoreLocal;

Local business interface

Wiki Markup
{snippet:id=code|url=openejb3/examples/injection-of-ejbs/src/main/java/org/superbiz/injection/DataReaderImplDataReaderLocal.java|lang=java}

(The remote business interface is not shown for the sake of brevity).

...