Which environment annotation, when declared within the FooBean bean class, is equivalent to the ejb-local-ref shown above?

A developer writes a stateless session bean FooBean and uses its deployment descriptor to
declare a local ejb dependency on a stateful session bean in the same ejb-jar.
<ejb-local-ref>

<ejb-ref-name>barRef</ejb-ref-name>
<local>acme.Bar</local>
<ejb-link>BarBean</ejb-link>
<injection-target>
<injection-target-class>acme.FooBean</injection-target-class>
<injection-target-name>bar</injection-target-name>
</injection-target>
</ej b-1 o c a I- ref>
Which environment annotation, when declared within the FooBean bean class, is equivalent to the
ejb-local-ref shown above?

A developer writes a stateless session bean FooBean and uses its deployment descriptor to
declare a local ejb dependency on a stateful session bean in the same ejb-jar.
<ejb-local-ref>

<ejb-ref-name>barRef</ejb-ref-name>
<local>acme.Bar</local>
<ejb-link>BarBean</ejb-link>
<injection-target>
<injection-target-class>acme.FooBean</injection-target-class>
<injection-target-name>bar</injection-target-name>
</injection-target>
</ej b-1 o c a I- ref>
Which environment annotation, when declared within the FooBean bean class, is equivalent to the
ejb-local-ref shown above?

A.
@EJB(beanName=”BarBean”)
private acme. Bar barRef;

B.
@EJB(name=”bar”, beanName=”BarBean”)
private acme.BarbarRef;

C.
@EJB(name=”barRef,beanName-‘BarBean”)
privateacme.Bar bar;

D.
@EJB(name=”ejb/barRef, beanName-‘BarBean”)
private acme.Bar bar;



Leave a Reply 0

Your email address will not be published. Required fields are marked *