27.03.2013 Views

JBoss Enterprise Application Platform Common Criteria Certification ...

JBoss Enterprise Application Platform Common Criteria Certification ...

JBoss Enterprise Application Platform Common Criteria Certification ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

4 6 Chapter 6. The JNDI Naming Service<br />

the actual name of the EJB local home in the deployment environment. The J2EE specification<br />

recommends that all references to enterprise beans be organized in the java:comp/env/ejb context<br />

of the application component's environment.<br />

An EJB local reference is declared using an ejb-local-ref element in the deployment descriptor.<br />

Each ejb-local-ref element describes the interface requirements that the referencing application<br />

component has for the referenced enterprise bean. The ejb-local-ref element contains the<br />

following child elements:<br />

An optional description element that provides the purpose of the reference.<br />

An ejb-ref-name element that specifies the name of the reference relative to the java:comp/env<br />

context. To place the reference under the recommended java:comp/env/ejb context, use an<br />

ejb/link-name form for the ejb-ref-name value.<br />

An ejb-ref-type element that specifies the type of the EJB. This must be either Entity or<br />

Session.<br />

A local-home element that gives the fully qualified class name of the EJB local home interface.<br />

A local element that gives the fully qualified class name of the EJB local interface.<br />

An ejb-link element that links the reference to another enterprise bean in the ejb-jar file or in the<br />

same J2EE application unit. The ejb-link value is the ejb-name of the referenced bean. If there<br />

are multiple enterprise beans with the same ejb-name, the value uses the path name specifying the<br />

location of the ejb-jar file that contains the referenced component. The path name is relative to<br />

the referencing ejb-jar file. The <strong>Application</strong> Assembler appends the ejb-name of the referenced<br />

bean to the path name separated by #. This allows multiple beans with the same name to be<br />

uniquely identified. An ejb-link element must be specified in <strong>JBoss</strong> to match the local reference to<br />

the corresponding EJB.<br />

An EJB local reference is scoped to the application component whose declaration contains the ejblocal-ref<br />

element. This means that the EJB local reference is not accessible from other application<br />

components at runtime, and that other application components may define ejb-local-ref elements<br />

with the same ejb-ref-name without causing a name conflict. Example 6.10, “An example ejb-jar.xml<br />

ejb-local-ref descriptor fragment” provides an ejb-jar.xml fragment that illustrates the use of the<br />

ejb-local-ref element. A code sample that illustrates accessing the ProbeLocalHome reference<br />

declared in Example 6.10, “An example ejb-jar.xml ejb-local-ref descriptor fragment” is given in<br />

Example 6.11, “ENC ejb-local-ref access code fragment”.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!