<?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>MessengerBean</ejb-name>
            <home>org.codehaus.activemq.itest.ejb.MessengerHome</home>
            <remote>org.codehaus.activemq.itest.ejb.MessengerObject</remote>
            <ejb-class>org.codehaus.activemq.itest.ejb.MessengerBean</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>jms/SendQueue</message-destination-ref-name>
                <message-destination-type>javax.jms.Queue</message-destination-type>
                <message-destination-usage>Produces</message-destination-usage>
                <message-destination-link>SendReceiveQueue</message-destination-link>
            </message-destination-ref>
            <message-destination-ref>
                <message-destination-ref-name>jms/ReceiveQueue</message-destination-ref-name>
                <message-destination-type>javax.jms.Queue</message-destination-type>
                <message-destination-usage>Consumes</message-destination-usage>
                <message-destination-link>SendReceiveQueue</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.codehaus.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>MDBTransferBeanInQueue</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>jms/OutQueue</message-destination-ref-name>
                <message-destination-type>javax.jms.Queue</message-destination-type>
                <message-destination-usage>Produces</message-destination-usage>
                <message-destination-link>MDBTransferBeanOutQueue</message-destination-link>
            </message-destination-ref>
        </message-driven>
    </enterprise-beans>

    <assembly-descriptor>
        <!-- for when we test security with the RA -->
        <!--
<security-role>
<description>Admin</description>
<role-name>admin</role-name>
</security-role>
<security-role>
<description>User</description>
<role-name>user</role-name>
</security-role>

<method-permission>
<description></description>
<role-name>User</role-name>
<method>
<description></description>
                <ejb-name>MessengerBean</ejb-name>
                <method-name>sendMessage</method-name>
</method>
</method-permission>
<method-permission>
<description></description>
<role-name>Admin</role-name>
<method>
<description></description>
                <ejb-name>MessengerBean</ejb-name>
                <method-name>receiveMessage</method-name>
</method>
</method-permission>
        -->

        <container-transaction>
            <method>
                <ejb-name>MessengerBean</ejb-name>
                <method-name>*</method-name>
            </method>
            <trans-attribute>Required</trans-attribute>
        </container-transaction>

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

        <message-destination>
            <message-destination-name>MDBTransferBeanOutQueue</message-destination-name>
        </message-destination>
        <message-destination>
            <message-destination-name>SendReceiveQueue</message-destination-name>
        </message-destination>

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

