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.

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

Example 6.15. An example ejb-jar.xml resource-env-ref fragment<br />

<br />

MyBean<br />

<br />

<br />

This is a reference to a JMS queue used in the<br />

processing of Stock info<br />

<br />

jms/StockInfo<br />

javax.jms.Queue<br />

<br />

<br />

<br />

Example 6.16. ENC resource-env-ref access code fragment<br />

InitialContext iniCtx = new InitialContext();<br />

javax.jms.Queue q = (javax.jms.Queue)<br />

envCtx.lookup("java:comp/env/jms/StockInfo");<br />

6.6.1.8. Resource Environment References and jboss.xml, jboss-web.xml<br />

The purpose of the <strong>JBoss</strong> jboss.xml EJB deployment descriptor and jboss-web.xml Web<br />

application deployment descriptor is to provide the link from the logical name defined by the resourceenv-ref-name<br />

element to the JNDI name of the administered object deployed in <strong>JBoss</strong>. This is<br />

accomplished by providing a resource-env-ref element in the jboss.xml or jboss-web.xml<br />

descriptor. The <strong>JBoss</strong> resource-env-ref element consists of the following child elements:<br />

A resource-env-ref-name element that must match the resource-env-ref-name of a<br />

corresponding resource-env-ref element from the ejb-jar.xml or web.xml standard<br />

descriptors<br />

A jndi-name element that specifies the JNDI name of the resource as deployed in <strong>JBoss</strong><br />

Example 6.17, “A sample jboss.xml resource-env-ref descriptor fragment” provides a sample<br />

jboss.xml descriptor fragment that shows a sample mapping for the StockInforesource-envref.<br />

Example 6.17. A sample jboss.xml resource-env-ref descriptor fragment<br />

<br />

MyBean<br />

<br />

<br />

jms/StockInfo<br />

queue/StockInfoQueue<br />

<br />

<br />

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

Saved successfully!

Ooh no, something went wrong!