Annotation Type EJB
-
@Target({TYPE,METHOD,FIELD}) @Retention(RUNTIME) public @interface EJB
Indicates a dependency on the local, no-interface, or remote view of an Enterprise Bean.Either the
beanNameor thelookupelement can be used to resolve the enterprise bean dependency to its target session bean component. It is an error to specify values for bothbeanNameandlookup.If no explicit linking information is provided and there is only one session bean within the same application that exposes the matching client view type, by default the enterprise bean dependency resolves to that session bean.
- Since:
- EJB 3.0
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description ClassbeanInterfaceThe interface type of the Enterprise Bean to which this reference is mapped.StringbeanNameThebeanNameelement references the value of thenameelement of theStatefulorStatelessannotation, whether defaulted or explicit.StringdescriptionA string describing the bean.StringlookupA portable lookup string containing the JNDI name for the target enterprise bean component.StringmappedNameThe product specific name of the enterprise bean component to which this enterprise bean reference should be mapped.StringnameThe logical name of the enterprise bean reference within the declaring component's (e.g., java:comp/env) environment.
-
-
-
-
beanName
String beanName
ThebeanNameelement references the value of thenameelement of theStatefulorStatelessannotation, whether defaulted or explicit. If the deployment descriptor was used to define the name of the bean, thebeanNameelement references theejb-nameelement of the bean definition.The
beanNameelement allows disambiguation if multiple session beans in the ejb-jar implement the same interface.In order to reference a bean in another ejb-jar file in the same application, the
beanNamemay be composed of a path name specifying the ejb-jar containing the referenced bean with the bean name of the target bean appended and separated from the path name by #. The path name is relative to the jar file containing the component that is referencing the target bean.Only applicable if the target enterprise bean is defined within the same application or stand-alone module as the declaring component.
- Returns:
- a
Stringobject.
- Default:
- ""
-
-
-
beanInterface
Class beanInterface
The interface type of the Enterprise Bean to which this reference is mapped.Holds one of the following types of the target enterprise bean :
- Local business interface
- Bean class (for no-interface view)
- Remote business interface
- Local Home interface
- Remote Home interface
- Returns:
- a
Classobject.
- Default:
- java.lang.Object.class
-
-
-
mappedName
String mappedName
The product specific name of the enterprise bean component to which this enterprise bean reference should be mapped. This mapped name is often a global JNDI name, but may be a name of any form.Application servers are not required to support any particular form or type of mapped name, nor the ability to use mapped names. The mapped name is product-dependent and often installation-dependent. No use of a mapped name is portable.
- Returns:
- a
Stringobject.
- Default:
- ""
-
-