<?xml version="1.0" encoding="UTF-8"?>
<!--
 -
 - Licensed to the Apache Software Foundation (ASF) under one
 - or more contributor license agreements.  See the NOTICE file
 - distributed with this work for additional information
 - regarding copyright ownership.  The ASF licenses this file
 - to you under the Apache License, Version 2.0 (the
 - "License"); you may not use this file except in compliance
 - with the License.  You may obtain a copy of the License at
 -
 -   http://www.apache.org/licenses/LICENSE-2.0
 -
 - Unless required by applicable law or agreed to in writing,
 - software distributed under the License is distributed on an
 - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 - KIND, either express or implied.  See the License for the
 - specific language governing permissions and limitations
 - under the License.
 -
 -->
<connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2">
  <dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2">
    <dep:moduleId>
      <dep:groupId>qpid.jca</dep:groupId>
      <dep:artifactId>QpidJCAAdapter</dep:artifactId>
      <dep:version>1.0</dep:version>
      <dep:type>rar</dep:type>
    </dep:moduleId>
  </dep:environment>
  <resourceadapter>
    <resourceadapter-instance>
        <resourceadapter-name>QpidResourceAdapter</resourceadapter-name>
        <config-property-setting name="ClientId">client_id</config-property-setting>
        <config-property-setting name="TransactionManagerLocatorClass">org.apache.qpid.ra.tm.GeronimoTransactionManagerLocator</config-property-setting>
        <config-property-setting name="TransactionManagerLocatorMethod">getTransactionManager</config-property-setting>
        <!-- Note, currently there is a bug with end/suspend and Geronimo. For now use local transactions-->
        <config-property-setting name="UseLocalTx">true</config-property-setting>
      <workmanager>
        <gbean-link>DefaultWorkManager</gbean-link>
      </workmanager>
    </resourceadapter-instance>
    <outbound-resourceadapter>
        <connection-definition>
            <connectionfactory-interface>org.apache.qpid.ra.QpidRAConnectionFactory</connectionfactory-interface>
            <connectiondefinition-instance>
              <name>QpidJMSXA</name>
              <implemented-interface>javax.jms.QueueConnectionFactory</implemented-interface>
              <implemented-interface>javax.jms.TopicConnectionFactory</implemented-interface>
              <config-property-setting name="ConnectionURL">@broker.url@</config-property-setting>
              <connectionmanager>
                <!-- Note, currently there is a bug with end/suspend and Geronimo. For now use no transactions outbound -->
                <no-transaction/>
                <single-pool>
                  <max-size>20</max-size>
                  <min-size>0</min-size>
                  <match-one/>
                </single-pool>
              </connectionmanager>
            </connectiondefinition-instance>
        </connection-definition>
    </outbound-resourceadapter>
    <!-- Note, do not remove this admin object. There appears to be a bug in Geronimo's deployer that does not correctly create JNDI references
         if an extra admin object is not present -->
    <adminobject>
      <adminobject-interface>org.apache.qpid.ra.admin.QpidTopic</adminobject-interface>
      <adminobject-class>org.apache.qpid.ra.admin.QpidTopicImpl</adminobject-class>
      <adminobject-instance>
         <message-destination-name>Dummy</message-destination-name>
         <config-property-setting name="destinationAddress">amq.topic</config-property-setting>
      </adminobject-instance>
    </adminobject>
    <adminobject>
      <adminobject-interface>org.apache.qpid.ra.admin.QpidTopic</adminobject-interface>
      <adminobject-class>org.apache.qpid.ra.admin.QpidTopicImpl</adminobject-class>
      <adminobject-instance>
         <message-destination-name>HelloTopic</message-destination-name>
         <config-property-setting name="destinationAddress">@qpid.hello.topic.dest.address@</config-property-setting>
      </adminobject-instance>
    </adminobject>
    <adminobject>
      <adminobject-interface>org.apache.qpid.ra.admin.QpidTopic</adminobject-interface>
      <adminobject-class>org.apache.qpid.ra.admin.QpidTopicImpl</adminobject-class>
      <adminobject-instance>
         <message-destination-name>GoodByeTopic</message-destination-name>
         <config-property-setting name="destinationAddress">@qpid.goodbye.topic.dest.address@</config-property-setting>
      </adminobject-instance>
    </adminobject>
    <adminobject>
      <adminobject-interface>org.apache.qpid.ra.admin.QpidTopic</adminobject-interface>
      <adminobject-class>org.apache.qpid.ra.admin.QpidTopicImpl</adminobject-class>
      <adminobject-instance>
         <message-destination-name>HelloGoodByeTopic</message-destination-name>
         <config-property-setting name="destinationAddress">@qpid.hellogoodbye.topic.dest.address@</config-property-setting>
      </adminobject-instance>
    </adminobject>
    <adminobject>
      <adminobject-interface>org.apache.qpid.ra.admin.QpidQueue</adminobject-interface>
      <adminobject-class>org.apache.qpid.ra.admin.QpidQueueImpl</adminobject-class>
      <adminobject-instance>
         <message-destination-name>HelloQueue</message-destination-name>
         <config-property-setting name="destinationAddress">@qpid.hello.queue.dest.address@</config-property-setting>
      </adminobject-instance>
    </adminobject>
    <adminobject>
      <adminobject-interface>org.apache.qpid.ra.admin.QpidQueue</adminobject-interface>
      <adminobject-class>org.apache.qpid.ra.admin.QpidQueueImpl</adminobject-class>
      <adminobject-instance>
         <message-destination-name>GoodByeQueue</message-destination-name>
         <config-property-setting name="destinationAddress">@qpid.goodbye.queue.dest.address@</config-property-setting>
      </adminobject-instance>
    </adminobject>
    <adminobject>
      <adminobject-interface>org.apache.qpid.ra.admin.QpidQueue</adminobject-interface>
      <adminobject-class>org.apache.qpid.ra.admin.QpidQueueImpl</adminobject-class>
      <adminobject-instance>
         <message-destination-name>ResponderQueue</message-destination-name>
         <config-property-setting name="destinationAddress">@qpid.responder.queue.dest.address@</config-property-setting>
      </adminobject-instance>
    </adminobject>
    <adminobject>
      <adminobject-interface>javax.jms.ConnectionFactory</adminobject-interface>
      <adminobject-class>org.apache.qpid.ra.admin.QpidConnectionFactoryProxy</adminobject-class>
      <adminobject-instance>
         <message-destination-name>QpidConnectionFactory</message-destination-name>
         <config-property-setting name="connectionURL">@broker.url@</config-property-setting>
      </adminobject-instance>
    </adminobject>
  </resourceadapter>
</connector>

