<?xml version="1.0"?>

<ejb-jar
        xmlns="http://java.sun.com/xml/ns/javaee"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
                            http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"
        version="3.0">

   <display-name>ENC Tests</display-name>
   <enterprise-beans>

      <session>
         <description>A session bean on looks up stuff in the ENC</description>
         <ejb-name>ENCBean</ejb-name>
         <remote>org.jboss.ejb3.test.naming.TestENC</remote>
         <ejb-class>org.jboss.ejb3.test.naming.TestENCBean</ejb-class>
         <session-type>Stateless</session-type>
         <transaction-type>Container</transaction-type>

         <!-- Basic environment entries -->
         <env-entry>
            <description>A flag indicating if the bean should perform the full ENC testsuite</description>
            <env-entry-name>hasFullENC</env-entry-name>
            <env-entry-type>java.lang.Boolean</env-entry-type>
            <env-entry-value>true</env-entry-value>
         </env-entry>
         <env-entry>
            <description>Integer0</description>
            <env-entry-name>Ints/i0</env-entry-name>
            <env-entry-type>java.lang.Integer</env-entry-type>
            <env-entry-value>0</env-entry-value>
         </env-entry>
         <env-entry>
            <description>Integer1</description>
            <env-entry-name>Ints/i1</env-entry-name>
            <env-entry-type>java.lang.Integer</env-entry-type>
            <env-entry-value>1</env-entry-value>
         </env-entry>
         <env-entry>
            <description>Float0</description>
            <env-entry-name>Floats/f0</env-entry-name>
            <env-entry-type>java.lang.Float</env-entry-type>
            <env-entry-value>0.0</env-entry-value>
         </env-entry>
         <env-entry>
            <description>Float1</description>
            <env-entry-name>Floats/f1</env-entry-name>
            <env-entry-type>java.lang.Float</env-entry-type>
            <env-entry-value>1.1</env-entry-value>
         </env-entry>
         <env-entry>
            <description>String0</description>
            <env-entry-name>Strings/s0</env-entry-name>
            <env-entry-type>java.lang.String</env-entry-type>
            <env-entry-value>String0</env-entry-value>
         </env-entry>
         <env-entry>
            <description>String1</description>
            <env-entry-name>Strings/s1</env-entry-name>
            <env-entry-type>java.lang.String</env-entry-type>
            <env-entry-value>String1</env-entry-value>
         </env-entry>
         <env-entry>
            <description>Short0</description>
            <env-entry-name>Short/s0</env-entry-name>
            <env-entry-type>java.lang.Short</env-entry-type>
            <env-entry-value>32767</env-entry-value>
         </env-entry>
         <env-entry>
            <description>Long0</description>
            <env-entry-name>Long/l0</env-entry-name>
            <env-entry-type>java.lang.Long</env-entry-type>
            <env-entry-value>123456789987654321</env-entry-value>
         </env-entry>
         <env-entry>
            <description>Double0</description>
            <env-entry-name>Double/d0</env-entry-name>
            <env-entry-type>java.lang.Double</env-entry-type>
            <env-entry-value>123456789.987654321</env-entry-value>
         </env-entry>
         <env-entry>
            <description>Byte0</description>
            <env-entry-name>Byte/b0</env-entry-name>
            <env-entry-type>java.lang.Byte</env-entry-type>
            <env-entry-value>1</env-entry-value>
         </env-entry>
         <env-entry>
            <description>Char0</description>
            <env-entry-name>Character/c0</env-entry-name>
            <env-entry-type>java.lang.Character</env-entry-type>
            <env-entry-value>c</env-entry-value>
         </env-entry>

         <!-- EJB References (java:comp/env/ejb) -->
         <ejb-ref>
            <ejb-ref-name>ejb/bean0</ejb-ref-name>
            <ejb-ref-type>Session</ejb-ref-type>
            <remote>org.jboss.ejb3.test.naming.TestENC</remote>
            <ejb-link>ENCBean0</ejb-link>
         </ejb-ref>
         <ejb-ref>
            <ejb-ref-name>ejb/bean1</ejb-ref-name>
            <ejb-ref-type>Session</ejb-ref-type>
             <remote>org.jboss.ejb3.test.naming.TestENC</remote>
            <ejb-link>ENCBean1</ejb-link>
         </ejb-ref>
         <ejb-ref>
            <ejb-ref-name>ejb/bean2</ejb-ref-name>
            <ejb-ref-type>Session</ejb-ref-type>
            <remote>org.jboss.ejb3.test.naming.TestENC</remote>
            <ejb-link>ENCBean2</ejb-link>
         </ejb-ref>

         <!-- JDBC DataSources (java:comp/env/jdbc) -->
         <resource-ref>
            <description>The default DS</description>
            <res-ref-name>jdbc/DefaultDS</res-ref-name>
            <res-type>javax.sql.DataSource</res-type>
            <res-auth>Container</res-auth>
         </resource-ref>
         <!-- JavaMail Connection Factories (java:comp/env/mail) -->
         <resource-ref>
            <description>Default Mail</description>
            <res-ref-name>mail/DefaultMail</res-ref-name>
            <res-type>javax.mail.Session</res-type>
            <res-auth>Container</res-auth>
         </resource-ref>
         <!-- JMS Connection Factories (java:comp/env/jms) -->
         <resource-ref>
            <description>Default QueueFactory</description>
            <res-ref-name>jms/QueFactory</res-ref-name>
            <res-type>javax.jms.QueueConnectionFactory</res-type>
            <res-auth>Container</res-auth>
         </resource-ref>

         <resource-env-ref>
            <description>A test of the resource-env-ref tag</description>
            <resource-env-ref-name>res/aQueue</resource-env-ref-name>
            <resource-env-ref-type>javax.jms.Queue</resource-env-ref-type>
         </resource-env-ref>
         
         <message-destination-ref>
            <description>consumes using a link</description>
            <message-destination-ref-name>mdr/ConsumesLink</message-destination-ref-name>
            <message-destination-type>javax.jms.Queue</message-destination-type>
            <message-destination-usage>Consumes</message-destination-usage>
            <message-destination-link>TestQueue</message-destination-link>
         </message-destination-ref>
         <message-destination-ref>
            <description>produces using a link</description>
            <message-destination-ref-name>mdr/ProducesLink</message-destination-ref-name>
            <message-destination-type>javax.jms.Topic</message-destination-type>
            <message-destination-usage>Produces</message-destination-usage>
            <message-destination-link>TestTopic</message-destination-link>
         </message-destination-ref>
         <message-destination-ref>
            <description>consumesproduces using a jndi name</description>
            <message-destination-ref-name>mdr/ConsumesProducesJNDIName</message-destination-ref-name>
            <message-destination-type>javax.jms.Queue</message-destination-type>
            <message-destination-usage>ConsumesProduces</message-destination-usage>
         </message-destination-ref>
      </session>

      <session>
         <description>Referenced Bean0 Create by TestENCHome2</description>
         <ejb-name>ENCBean0</ejb-name>
         <remote>org.jboss.ejb3.test.naming.TestENC</remote>
         <ejb-class>org.jboss.ejb3.test.naming.TestENCBean</ejb-class>
         <session-type>Stateless</session-type>
         <transaction-type>Container</transaction-type>
         <env-entry>
            <description>This bean should NOT have the same ENC as ENCBean</description>
            <env-entry-name>hasFullENC</env-entry-name>
            <env-entry-type>java.lang.Boolean</env-entry-type>
            <env-entry-value>false</env-entry-value>
         </env-entry>
      </session>
      <session>
         <description>Referenced Bean1</description>
         <ejb-name>ENCBean1</ejb-name>
         <remote>org.jboss.ejb3.test.naming.TestENC</remote>
         <ejb-class>org.jboss.ejb3.test.naming.TestENCBean</ejb-class>
         <session-type>Stateless</session-type>
         <transaction-type>Container</transaction-type>
         <env-entry>
            <description>This bean should NOT have the same ENC as ENCBean</description>
            <env-entry-name>hasFullENC</env-entry-name>
            <env-entry-type>java.lang.Boolean</env-entry-type>
            <env-entry-value>false</env-entry-value>
         </env-entry>
      </session>
      <session>
         <description>A bean with a JNDI name that cannot be used in a JMX
            ObjectName</description>
         <ejb-name>ENCBean2</ejb-name>
         <remote>org.jboss.ejb3.test.naming.TestENC</remote>
         <ejb-class>org.jboss.ejb3.test.naming.TestENCBean</ejb-class>
         <session-type>Stateless</session-type>
         <transaction-type>Container</transaction-type>
         <env-entry>
            <description>This bean should NOT have the same ENC as ENCBean</description>
            <env-entry-name>hasFullENC</env-entry-name>
            <env-entry-type>java.lang.Boolean</env-entry-type>
            <env-entry-value>false</env-entry-value>
         </env-entry>
      </session>
      <session>
         <description>A deployment that is secured</description>
         <ejb-name>SecuredENCBean</ejb-name>
         <remote>org.jboss.ejb3.test.naming.TestENC</remote>
         <ejb-class>org.jboss.ejb3.test.naming.TestENCBean</ejb-class>
         <session-type>Stateless</session-type>
         <transaction-type>Container</transaction-type>
         <env-entry>
            <description>This bean should NOT have the same ENC as ENCBean</description>
            <env-entry-name>hasFullENC</env-entry-name>
            <env-entry-type>java.lang.Boolean</env-entry-type>
            <env-entry-value>false</env-entry-value>
         </env-entry>
      </session>
   </enterprise-beans>

   <assembly-descriptor>
      <security-role>
         <description>Users allowed to access SecuredENCBean</description>
         <role-name>ENCUser</role-name>
      </security-role>

      <method-permission>
         <role-name>ENCUser</role-name>
         <method>
            <ejb-name>SecuredENCBean</ejb-name>
            <method-name>*</method-name>
         </method>
      </method-permission>

      <message-destination>
         <message-destination-name>TestQueue</message-destination-name>
      </message-destination>
      <message-destination>
         <message-destination-name>TestTopic</message-destination-name>
      </message-destination>
   </assembly-descriptor>
</ejb-jar>
