<?xml version="1.0" encoding="US-ASCII"?>

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

    <description>
        Stateless Session Bean used to test the ActiveMQ outbound RA.
    </description>
    <enterprise-beans>
        <session>
            <description>
                A SSB that uses the JMS RA
            </description>
            <ejb-name>JMSToolBean</ejb-name>
            <home>org.activemq.itest.ejb.JMSToolHome</home>
            <remote>org.activemq.itest.ejb.JMSTool</remote>
            <ejb-class>org.activemq.itest.ejb.JMSToolBean</ejb-class>
            <session-type>Stateless</session-type>
            <transaction-type>Container</transaction-type>

            <resource-ref>
                <description>
                    This is a reference to the ActiveMQ JMS provider.
                </description>
                <res-ref-name>jms/Default</res-ref-name>
                <res-type>javax.jms.ConnectionFactory</res-type>
                <res-auth>Container</res-auth>
            </resource-ref>
            
            <message-destination-ref>
                <message-destination-ref-name>TestQueue</message-destination-ref-name>
                <message-destination-type>javax.jms.Queue</message-destination-type>
                <message-destination-usage>Produces</message-destination-usage>
                <message-destination-link>TestQueue</message-destination-link>
            </message-destination-ref>
            <message-destination-ref>
                <message-destination-ref-name>MDBInQueue</message-destination-ref-name>
                <message-destination-type>javax.jms.Queue</message-destination-type>
                <message-destination-usage>Consumes</message-destination-usage>
                <message-destination-link>MDBInQueue</message-destination-link>
            </message-destination-ref>
            <message-destination-ref>
                <message-destination-ref-name>MDBOutQueue</message-destination-ref-name>
                <message-destination-type>javax.jms.Queue</message-destination-type>
                <message-destination-usage>Consumes</message-destination-usage>
                <message-destination-link>MDBOutQueue</message-destination-link>
            </message-destination-ref>
            
        </session>
        
        <message-driven>
            <description>
                A MDB that uses the JMS RA. Transfers messages from one queue to another.
            </description>
            <ejb-name>MDBTransferBean</ejb-name>
            <ejb-class>org.activemq.itest.ejb.MDBTransferBean</ejb-class>
            <messaging-type>javax.jms.MessageListener</messaging-type>
            <transaction-type>Container</transaction-type>
            <activation-config>
                <activation-config-property>
                    <activation-config-property-name>destination</activation-config-property-name>
                    <activation-config-property-value>MDBInQueue</activation-config-property-value>
                </activation-config-property>
                <activation-config-property>
                    <activation-config-property-name>destinationType</activation-config-property-name>
                    <activation-config-property-value>javax.jms.Queue</activation-config-property-value>
                </activation-config-property>
            </activation-config>
            <resource-ref>
                <description>
                    This is a reference to the ActiveMQ JMS provider.
                </description>
                <res-ref-name>jms/Default</res-ref-name>
                <res-type>javax.jms.ConnectionFactory</res-type>
                <res-auth>Container</res-auth>
            </resource-ref>
            <message-destination-ref>
                <message-destination-ref-name>MDBOut</message-destination-ref-name>
                <message-destination-type>javax.jms.Queue</message-destination-type>
                <message-destination-usage>Produces</message-destination-usage>
                <message-destination-link>MDBOutQueue</message-destination-link>
            </message-destination-ref>
        </message-driven>
        
    </enterprise-beans>

    <assembly-descriptor>
        
        <container-transaction>
            <method>
                <ejb-name>JMSToolBean</ejb-name>
                <method-name>*</method-name>
            </method>
            <trans-attribute>Required</trans-attribute>
        </container-transaction>

        <container-transaction>
            <method>
                <ejb-name>MDBTransferBean</ejb-name>
                <method-intf>Remote</method-intf>
                <method-name>*</method-name>
            </method>
            <trans-attribute>Required</trans-attribute>
        </container-transaction>

        <message-destination>
            <message-destination-name>MDBInQueue</message-destination-name>
        </message-destination>
        <message-destination>
            <message-destination-name>MDBOutQueue</message-destination-name>
        </message-destination>
        <message-destination>
            <message-destination-name>TestQueue</message-destination-name>
        </message-destination>

    </assembly-descriptor>
</ejb-jar>

