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 4 Chapter 6. The JNDI Naming Service<br />

Session.<br />

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

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

An optional ejb-link element that links the reference to another enterprise bean in the same EJB<br />

JAR or in the same J2EE application unit. The ejb-link value is the ejb-name of the referenced<br />

bean. If there are multiple enterprise beans with the same ejb-name, the value uses the path name<br />

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

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

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

name to be uniquely identified.<br />

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

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

runtime, and that other application components may define ejb-ref elements with the same ejb-refname<br />

without causing a name conflict. Example 6.7, “An example ejb-jar.xml ejb-ref descriptor fragment”<br />

provides an ejb-jar.xml fragment that illustrates the use of the ejb-ref element. A code sample<br />

that illustrates accessing the ShoppingCartHome reference declared in Example 6.7, “An example<br />

ejb-jar.xml ejb-ref descriptor fragment” is given in Example 6.8, “ENC ejb-ref access code fragment”.<br />

Example 6.7. An example ejb-jar.xml ejb-ref descriptor fragment<br />

<br />

<br />

ShoppingCartBean<br />

<br />

<br />

<br />

ProductBeanUser<br />

<br />

<br />

This is a reference to the store products entity<br />

<br />

ejb/ProductHome<br />

Entity<br />

org.jboss.store.ejb.ProductHome<br />

org.jboss.store.ejb.Product<br />

<br />

<br />

<br />

<br />

ShoppingCartUser<br />

<br />

ejb/ShoppingCartHome<br />

Session<br />

org.jboss.store.ejb.ShoppingCartHome<br />

org.jboss.store.ejb.ShoppingCart<br />

ShoppingCartBean<br />

<br />

<br />

<br />

The Product entity bean <br />

ProductBean<br />

<br />

<br />

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

Saved successfully!

Ooh no, something went wrong!