-
@Target(value={TYPE,METHOD,FIELD}) @Retention(value=RUNTIME) public @interface EJB
Indicates a dependency on the local, no-interface, or remote view of an Enterprise JavaBean.Either the
beanName
or thelookup
element can be used to resolve the EJB dependency to its target session bean component. It is an error to specify values for bothbeanName
andlookup
.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 EJB dependency resolves to that session bean.
- Since:
- EJB 3.0
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element and Description Class
beanInterface
The interface type of the Enterprise Java Bean to which this reference is mapped.String
beanName
ThebeanName
element references the value of thename
element of theStateful
orStateless
annotation, whether defaulted or explicit.String
description
A string describing the bean.String
lookup
A portable lookup string containing the JNDI name for the target EJB component.String
mappedName
The product specific name of the EJB component to which this ejb reference should be mapped.String
name
The logical name of the ejb reference within the declaring component's (e.g., java:comp/env) environment.
-
-
-
Element Detail
-
name
public abstract String name
The logical name of the ejb reference within the declaring component's (e.g., java:comp/env) environment.- Default:
- ""
-
-
-
description
public abstract String description
A string describing the bean.- Default:
- ""
-
-
-
beanName
public abstract String beanName
ThebeanName
element references the value of thename
element of theStateful
orStateless
annotation, whether defaulted or explicit. If the deployment descriptor was used to define the name of the bean, thebeanName
element references theejb-name
element of the bean definition.The
beanName
element 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
beanName
may 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 EJB is defined within the same application or stand-alone module as the declaring component.
- Default:
- ""
-
-
-
beanInterface
public abstract Class beanInterface
The interface type of the Enterprise Java Bean to which this reference is mapped.Holds one of the following types of the target EJB :
- Local business interface
- Bean class (for no-interface view)
- Remote business interface
- Local Home interface
- Remote Home interface
- Default:
- java.lang.Object.class
-
-
-
mappedName
public abstract String mappedName
The product specific name of the EJB component to which this ejb 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.
- Default:
- ""
-
-
-
lookup
public abstract String lookup
A portable lookup string containing the JNDI name for the target EJB component.- Since:
- EJB 3.1
- Default:
- ""
-
-
Nederlandse vertaling
U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.
Bij voorbaat dank.
Document heeft de 11/06/2005 gemaakt, de laatste keer de 18/08/2025 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/java-api-javaee-rf-javax/ejb/EJB.html
De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.
Referenties
Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur van deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.