qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From raj...@apache.org
Subject svn commit: r1239411 - in /qpid/trunk/qpid/java/jca: example/ example/conf/ example/src/main/java/org/apache/qpid/jca/example/ejb/ example/src/main/java/org/apache/qpid/jca/example/web/ src/main/java/org/apache/qpid/ra/ src/main/java/org/apache/qpid/ra...
Date Wed, 01 Feb 2012 23:56:29 GMT
Author: rajith
Date: Wed Feb  1 23:56:28 2012
New Revision: 1239411

URL: http://svn.apache.org/viewvc?rev=1239411&view=rev
Log:
QPID-3734 Commiting patch by Weston Price.

Added:
    qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/admin/QpidQueueImpl.java
    qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/admin/QpidTopicImpl.java
      - copied, changed from r1239166, qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/admin/QpidTopic.java
Modified:
    qpid/trunk/qpid/java/jca/example/.gitignore
    qpid/trunk/qpid/java/jca/example/build-geronimo-properties.xml
    qpid/trunk/qpid/java/jca/example/build-jboss-properties.xml
    qpid/trunk/qpid/java/jca/example/build-properties.xml.temp
    qpid/trunk/qpid/java/jca/example/build.xml
    qpid/trunk/qpid/java/jca/example/conf/ejb-jar.xml
    qpid/trunk/qpid/java/jca/example/conf/geronimo-application.xml
    qpid/trunk/qpid/java/jca/example/conf/geronimo-ra.xml
    qpid/trunk/qpid/java/jca/example/conf/jboss.xml
    qpid/trunk/qpid/java/jca/example/conf/qpid-jca-ds.xml
    qpid/trunk/qpid/java/jca/example/conf/web.xml
    qpid/trunk/qpid/java/jca/example/qpid-jca-example-properties.xml
    qpid/trunk/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidGoodByeSubscriberBean.java
    qpid/trunk/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidHelloListenerBean.java
    qpid/trunk/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidHelloSubscriberBean.java
    qpid/trunk/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidJMSResponderBean.java
    qpid/trunk/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidTestBean.java
    qpid/trunk/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/web/QpidTestServlet.java
    qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/QpidRAManagedConnectionFactory.java
    qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/Util.java
    qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/admin/AdminObjectFactory.java
    qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/admin/QpidDestinationProxy.java
    qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/admin/QpidQueue.java
    qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/admin/QpidTopic.java
    qpid/trunk/qpid/java/jca/src/main/resources/META-INF/ra.xml

Modified: qpid/trunk/qpid/java/jca/example/.gitignore
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/jca/example/.gitignore?rev=1239411&r1=1239410&r2=1239411&view=diff
==============================================================================
--- qpid/trunk/qpid/java/jca/example/.gitignore (original)
+++ qpid/trunk/qpid/java/jca/example/.gitignore Wed Feb  1 23:56:28 2012
@@ -1,2 +1,4 @@
 build/*
 lib/*
+*.swp
+build-properties.xml

Modified: qpid/trunk/qpid/java/jca/example/build-geronimo-properties.xml
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/jca/example/build-geronimo-properties.xml?rev=1239411&r1=1239410&r2=1239411&view=diff
==============================================================================
--- qpid/trunk/qpid/java/jca/example/build-geronimo-properties.xml (original)
+++ qpid/trunk/qpid/java/jca/example/build-geronimo-properties.xml Wed Feb  1 23:56:28 2012
@@ -20,8 +20,12 @@
  -->
 <project name="qpid-jca-example-geronimo-properties" basedir="." default="">
 
-    <property name="geronimo.jndi.scheme" value="name"/>
+    <property name="jndi.scheme" value="name"/>
+
+    <!--
     <property name="qpid.xacf.jndi.name" value="jca:/qpid.jca/QpidJCAAdapter/JCAManagedConnectionFactory/QpidJMSXA"/>
+    -->
+    <property name="qpid.xacf.jndi.name" value="QpidJMSXA"/>
     <property name="qpid.cf.jndi.name" value="jca:/qpid.jca/QpidJCAAdapter/JCAAdminObject/QpidConnectionFactory"/>
     <property name="qpid.hello.queue.jndi.name" value="jca:/qpid.jca/QpidJCAAdapter/JCAAdminObject/HelloQueue"/>
     <property name="qpid.goodbye.queue.jndi.name" value="jca:/qpid.jca/QpidJCAAdapter/JCAAdminObject/GoodByeQueue"/>
@@ -64,16 +68,25 @@
     <property name="geronimo.rar.plan" value="${gen.dir}/geronimo-ra.xml"/>
     <property name="geronimo.ear.plan" value="${gen.dir}/geronimo-application.xml"/>
 
+    <available file="${geronimo.home}/bin/deploy" value="deploy" property="geronimo.deploy.exec"/>
+    <property name="geronimo.deploy.exec" value="deploy.sh"/>
+
     <path id="compile.classpath">
         <fileset dir="${geronimo.home}/repository/org/apache/geronimo/specs">
             <include name="geronimo-jms_1.1_spec/1.1.1/geronimo-jms_1.1_spec-1.1.1.jar"/>
             <include name="geronimo-servlet_2.5_spec/1.2/geronimo-servlet_2.5_spec-1.2.jar"/>
             <include name="geronimo-ejb_3.0_spec/1.0.1/geronimo-ejb_3.0_spec-1.0.1.jar"/>
             <include name="geronimo-jta_1.1_spec/1.1.1/geronimo-jta_1.1_spec-1.1.1.jar"/>
+
+            <!--Geronimo 3.x-->
+            <include name="geronimo-servlet_3.0_spec/1.0/geronimo-servlet_3.0_spec-1.0.jar"/>
+            <include name="geronimo-ejb_3.1_spec/1.0.2/geronimo-ejb_3.1_spec-1.0.2.jar"/>
         </fileset>
-        <fileset dir="${geronimo.home}/lib/">
+
+        <fileset dir="${qpid.jca.dir}">
             <include name="slf4j-api-*.jar"/>
         </fileset>
+
     </path>
 
     <path id="run.classpath">
@@ -119,7 +132,7 @@
         <attribute name="module"/>
         <attribute name="plan" default=""/>
         <sequential>
-            <exec executable="${geronimo.home}/bin/deploy.sh">
+            <exec executable="${geronimo.home}/bin/${geronimo.deploy.exec}">
                 <arg line="-u @{user} -p @{password} @{action} @{module} @{plan}"/>
             </exec>
         </sequential>

Modified: qpid/trunk/qpid/java/jca/example/build-jboss-properties.xml
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/jca/example/build-jboss-properties.xml?rev=1239411&r1=1239410&r2=1239411&view=diff
==============================================================================
--- qpid/trunk/qpid/java/jca/example/build-jboss-properties.xml (original)
+++ qpid/trunk/qpid/java/jca/example/build-jboss-properties.xml Wed Feb  1 23:56:28 2012
@@ -20,7 +20,7 @@
 -->
 <project name="qpid-jca-example-jboss-properties" basedir="." default="">
 
-    <property name="jboss.jndi.scheme" value="mappedName"/>
+    <property name="jndi.scheme" value="mappedName"/>
     <property name="qpid.xacf.jndi.name" value="java:QpidJMSXA"/>
     <property name="qpid.cf.jndi.name" value="QpidConnectionFactory"/>
     <property name="qpid.hello.topic.jndi.name" value="HelloTopic"/>

Modified: qpid/trunk/qpid/java/jca/example/build-properties.xml.temp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/jca/example/build-properties.xml.temp?rev=1239411&r1=1239410&r2=1239411&view=diff
==============================================================================
--- qpid/trunk/qpid/java/jca/example/build-properties.xml.temp (original)
+++ qpid/trunk/qpid/java/jca/example/build-properties.xml.temp Wed Feb  1 23:56:28 2012
@@ -20,4 +20,5 @@
  -->
 <project name="qpid-jca-example-build-properties" basedir="." default="">
   <property name="qpid.ver" value="@project.version@"/>
+  <property name="broker.address" value="localhost"/>
 </project>

Modified: qpid/trunk/qpid/java/jca/example/build.xml
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/jca/example/build.xml?rev=1239411&r1=1239410&r2=1239411&view=diff
==============================================================================
--- qpid/trunk/qpid/java/jca/example/build.xml (original)
+++ qpid/trunk/qpid/java/jca/example/build.xml Wed Feb  1 23:56:28 2012
@@ -26,11 +26,8 @@
     <!-- Change to BURL for older syntax support -->
     <property name="qpid.dest_syntax" value="ADDR"/>
 
-    <!-- Broker specific properties. By default in the adapter we use localhost here you an override this with host specific info-->
-    <property name="broker.address" value="localhost"/>
-
     <!-- Properties controlling running sample standalone client -->
-    <property name="client.use.ejb" value="false"/> <!-- uses JNDI/JMS or JNDI/RMI -->
+    <property name="client.use.ejb" value="true"/> <!-- uses JNDI/JMS or JNDI/RMI -->
     <property name="client.message" value="Hello Qpid World"/>
     <property name="client.message.count" value="1"/>
     <property name="client.use.topic" value="false"/> <!-- Use topic/queue -->
@@ -114,9 +111,6 @@
             <classes dir="${build.classes.dir}">
                 <include name="org/apache/qpid/jca/example/web/**"/>
             </classes>
-            <webinf dir="${gen.dir}">
-                <include name="jboss-web.xml"/>
-            </webinf>
         </war>
     </target>
 
@@ -125,7 +119,6 @@
             <include name="org/apache/qpid/jca/example/ejb/**/*.class"/>
             <metainf dir="${gen.dir}">
                 <include name="jboss.xml"/>
-                <include name="ejb-jar.xml"/>
             </metainf>
         </jar>
     </target>

Modified: qpid/trunk/qpid/java/jca/example/conf/ejb-jar.xml
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/jca/example/conf/ejb-jar.xml?rev=1239411&r1=1239410&r2=1239411&view=diff
==============================================================================
--- qpid/trunk/qpid/java/jca/example/conf/ejb-jar.xml (original)
+++ qpid/trunk/qpid/java/jca/example/conf/ejb-jar.xml Wed Feb  1 23:56:28 2012
@@ -27,40 +27,13 @@
     <enterprise-beans>
         <message-driven>
             <ejb-name>QpidHelloListenerBean</ejb-name>
-            <resource-ref>
-                <res-ref-name>QpidJMSXA</res-ref-name>
-                <res-type>javax.jms.ConnectionFactory</res-type>
-                <res-auth>Container</res-auth>
-                <res-sharing-scope>Shareable</res-sharing-scope>
-            </resource-ref>
         </message-driven>
         <message-driven>
             <ejb-name>QpidHelloSubscriberBean</ejb-name>
-            <resource-ref>
-                <res-ref-name>QpidJMSXA</res-ref-name>
-                <res-type>javax.jms.ConnectionFactory</res-type>
-                <res-auth>Container</res-auth>
-                <res-sharing-scope>Shareable</res-sharing-scope>
-            </resource-ref>
         </message-driven>
         <message-driven>
             <ejb-name>QpidJMSResponderBean</ejb-name>
-            <resource-ref>
-                <res-ref-name>QpidJMSXA</res-ref-name>
-                <res-type>javax.jms.ConnectionFactory</res-type>
-                <res-auth>Container</res-auth>
-                <res-sharing-scope>Shareable</res-sharing-scope>
-            </resource-ref>
         </message-driven>
-        <session>
-            <ejb-name>QpidTestBean</ejb-name>
-            <resource-ref>
-                <res-ref-name>QpidJMSXA</res-ref-name>
-                <res-type>javax.jms.ConnectionFactory</res-type>
-                <res-auth>Container</res-auth>
-                <res-sharing-scope>Shareable</res-sharing-scope>
-            </resource-ref>
-        </session>
     </enterprise-beans>
 
 

Modified: qpid/trunk/qpid/java/jca/example/conf/geronimo-application.xml
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/jca/example/conf/geronimo-application.xml?rev=1239411&r1=1239410&r2=1239411&view=diff
==============================================================================
--- qpid/trunk/qpid/java/jca/example/conf/geronimo-application.xml (original)
+++ qpid/trunk/qpid/java/jca/example/conf/geronimo-application.xml Wed Feb  1 23:56:28 2012
@@ -58,15 +58,6 @@
 
             <context-root>/qpid-jca-web</context-root>
 
-            <naming:ejb-local-ref>
-              <naming:ref-name>QpidTestBean</naming:ref-name>
-              <naming:ejb-link>QpidTestBean</naming:ejb-link>
-            </naming:ejb-local-ref>
-
-            <naming:resource-ref>
-                <naming:ref-name>QpidJMSXA</naming:ref-name>
-                <naming:resource-link>QpidJMSXA</naming:resource-link>
-            </naming:resource-ref>
         </web-app>
     </module>
 
@@ -91,8 +82,6 @@
                         <sys:type>rar</sys:type>
                     </sys:dependency>
                 </sys:dependencies>
-                <sys:hidden-classes/>
-                <sys:non-overridable-classes/>
             </sys:environment>
 
             <enterprise-beans>
@@ -101,10 +90,6 @@
                     <resource-adapter>
                         <resource-link>QpidResourceAdapter</resource-link>
                     </resource-adapter>
-                      <naming:resource-ref>
-                        <naming:ref-name>QpidJMSXA</naming:ref-name>
-                        <naming:resource-link>QpidJMSXA</naming:resource-link>
-                    </naming:resource-ref>
                 </message-driven>
                 <message-driven>
                     <ejb-name>QpidGoodByeListenerBean</ejb-name>
@@ -117,10 +102,6 @@
                     <resource-adapter>
                         <resource-link>QpidResourceAdapter</resource-link>
                     </resource-adapter>
-                      <naming:resource-ref>
-                        <naming:ref-name>QpidJMSXA</naming:ref-name>
-                        <naming:resource-link>QpidJMSXA</naming:resource-link>
-                    </naming:resource-ref>
                 </message-driven>
                 <message-driven>
                     <ejb-name>QpidGoodByeSubscriberBean</ejb-name>
@@ -133,18 +114,7 @@
                     <resource-adapter>
                         <resource-link>QpidResourceAdapter</resource-link>
                     </resource-adapter>
-                      <naming:resource-ref>
-                        <naming:ref-name>QpidJMSXA</naming:ref-name>
-                        <naming:resource-link>QpidJMSXA</naming:resource-link>
-                    </naming:resource-ref>
                 </message-driven>
-                <session>
-                    <ejb-name>QpidTestBean</ejb-name>
-                      <naming:resource-ref>
-                        <naming:ref-name>QpidJMSXA</naming:ref-name>
-                        <naming:resource-link>QpidJMSXA</naming:resource-link>
-                    </naming:resource-ref>
-                </session>
             </enterprise-beans>
         </openejb-jar>
     </module>

Modified: qpid/trunk/qpid/java/jca/example/conf/geronimo-ra.xml
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/jca/example/conf/geronimo-ra.xml?rev=1239411&r1=1239410&r2=1239411&view=diff
==============================================================================
--- qpid/trunk/qpid/java/jca/example/conf/geronimo-ra.xml (original)
+++ qpid/trunk/qpid/java/jca/example/conf/geronimo-ra.xml Wed Feb  1 23:56:28 2012
@@ -63,65 +63,58 @@
     <!-- 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>javax.jms.Destination</adminobject-interface>
-      <adminobject-class>org.apache.qpid.ra.admin.QpidDestinationProxy</adminobject-class>
+      <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="destinationType">TOPIC</config-property-setting>
          <config-property-setting name="destinationAddress">amq.topic</config-property-setting>
       </adminobject-instance>
     </adminobject>
     <adminobject>
-      <adminobject-interface>javax.jms.Destination</adminobject-interface>
-      <adminobject-class>org.apache.qpid.ra.admin.QpidDestinationProxy</adminobject-class>
+      <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="destinationType">TOPIC</config-property-setting>
          <config-property-setting name="destinationAddress">@qpid.hello.topic.dest.address@</config-property-setting>
       </adminobject-instance>
     </adminobject>
     <adminobject>
-      <adminobject-interface>javax.jms.Destination</adminobject-interface>
-      <adminobject-class>org.apache.qpid.ra.admin.QpidDestinationProxy</adminobject-class>
+      <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="destinationType">TOPIC</config-property-setting>
          <config-property-setting name="destinationAddress">@qpid.goodbye.topic.dest.address@</config-property-setting>
       </adminobject-instance>
     </adminobject>
     <adminobject>
-      <adminobject-interface>javax.jms.Destination</adminobject-interface>
-      <adminobject-class>org.apache.qpid.ra.admin.QpidDestinationProxy</adminobject-class>
+      <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="destinationType">TOPIC</config-property-setting>
          <config-property-setting name="destinationAddress">@qpid.hellogoodbye.topic.dest.address@</config-property-setting>
       </adminobject-instance>
     </adminobject>
     <adminobject>
-      <adminobject-interface>javax.jms.Destination</adminobject-interface>
-      <adminobject-class>org.apache.qpid.ra.admin.QpidDestinationProxy</adminobject-class>
+      <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="destinationType">QUEUE</config-property-setting>
          <config-property-setting name="destinationAddress">@qpid.hello.queue.dest.address@</config-property-setting>
       </adminobject-instance>
     </adminobject>
     <adminobject>
-      <adminobject-interface>javax.jms.Destination</adminobject-interface>
-      <adminobject-class>org.apache.qpid.ra.admin.QpidDestinationProxy</adminobject-class>
+      <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="destinationType">QUEUE</config-property-setting>
          <config-property-setting name="destinationAddress">@qpid.goodbye.queue.dest.address@</config-property-setting>
       </adminobject-instance>
     </adminobject>
     <adminobject>
-      <adminobject-interface>javax.jms.Destination</adminobject-interface>
-      <adminobject-class>org.apache.qpid.ra.admin.QpidDestinationProxy</adminobject-class>
+      <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="destinationType">QUEUE</config-property-setting>
          <config-property-setting name="destinationAddress">@qpid.responder.queue.dest.address@</config-property-setting>
       </adminobject-instance>
     </adminobject>

Modified: qpid/trunk/qpid/java/jca/example/conf/jboss.xml
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/jca/example/conf/jboss.xml?rev=1239411&r1=1239410&r2=1239411&view=diff
==============================================================================
--- qpid/trunk/qpid/java/jca/example/conf/jboss.xml (original)
+++ qpid/trunk/qpid/java/jca/example/conf/jboss.xml Wed Feb  1 23:56:28 2012
@@ -30,11 +30,6 @@
         <message-driven>
            <ejb-name>QpidHelloListenerBean</ejb-name>
            <resource-adapter-name>@rar.name@</resource-adapter-name>
-            <resource-ref>
-                <res-ref-name>QpidJMSXA</res-ref-name>
-                <res-type>javax.sql.DataSource</res-type>
-                <jndi-name>java:/QpidJMSXA</jndi-name>
-            </resource-ref>
         </message-driven>
         <message-driven>
            <ejb-name>QpidGoodByeListenerBean</ejb-name>
@@ -43,38 +38,15 @@
         <message-driven>
            <ejb-name>QpidHelloSubscriberBean</ejb-name>
            <resource-adapter-name>@rar.name@</resource-adapter-name>
-            <resource-ref>
-                <res-ref-name>QpidJMSXA</res-ref-name>
-                <res-type>javax.sql.DataSource</res-type>
-                <jndi-name>java:/QpidJMSXA</jndi-name>
-            </resource-ref>
         </message-driven>
         <message-driven>
            <ejb-name>QpidGoodByeSubscriberBean</ejb-name>
            <resource-adapter-name>@rar.name@</resource-adapter-name>
-            <resource-ref>
-                <res-ref-name>QpidJMSXA</res-ref-name>
-                <res-type>javax.sql.DataSource</res-type>
-                <jndi-name>java:/QpidJMSXA</jndi-name>
-            </resource-ref>
         </message-driven>
         <message-driven>
            <ejb-name>QpidJMSResponderBean</ejb-name>
            <resource-adapter-name>@rar.name@</resource-adapter-name>
-            <resource-ref>
-                <res-ref-name>QpidJMSXA</res-ref-name>
-                <res-type>javax.sql.DataSource</res-type>
-                <jndi-name>java:/QpidJMSXA</jndi-name>
-            </resource-ref>
         </message-driven>
-        <session>
-            <ejb-name>QpidTestBean</ejb-name>
-            <resource-ref>
-                <res-ref-name>QpidJMSXA</res-ref-name>
-                <res-type>javax.sql.DataSource</res-type>
-                <jndi-name>java:/QpidJMSXA</jndi-name>
-            </resource-ref>
-        </session>
     </enterprise-beans>
 
 </jboss>

Modified: qpid/trunk/qpid/java/jca/example/conf/qpid-jca-ds.xml
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/jca/example/conf/qpid-jca-ds.xml?rev=1239411&r1=1239410&r2=1239411&view=diff
==============================================================================
--- qpid/trunk/qpid/java/jca/example/conf/qpid-jca-ds.xml (original)
+++ qpid/trunk/qpid/java/jca/example/conf/qpid-jca-ds.xml Wed Feb  1 23:56:28 2012
@@ -25,9 +25,8 @@
          name="qpid.jca:name=HelloTopic">
      <attribute name="JNDIName">HelloTopic</attribute>
      <depends optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='@rar.name@'</depends>
-     <attribute name="Type">javax.jms.Destination</attribute>
+     <attribute name="Type">org.apache.qpid.ra.admin.QpidTopic</attribute>
      <attribute name="Properties">
-        destinationType=TOPIC
         destinationAddress=@qpid.hello.topic.dest.address@
      </attribute>
   </mbean>
@@ -36,9 +35,8 @@
          name="qpid.jca:name=GoodByeTopic">
      <attribute name="JNDIName">GoodByeTopic</attribute>
      <depends optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='@rar.name@'</depends>
-     <attribute name="Type">javax.jms.Destination</attribute>
+     <attribute name="Type">org.apache.qpid.ra.admin.QpidTopic</attribute>
      <attribute name="Properties">
-        destinationType=TOPIC
         destinationAddress=@qpid.goodbye.topic.dest.address@
      </attribute>
   </mbean>
@@ -47,9 +45,8 @@
          name="qpid.jca:name=HelloGoodByeTopic">
      <attribute name="JNDIName">HelloGoodByeTopic</attribute>
      <depends optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='@rar.name@'</depends>
-     <attribute name="Type">javax.jms.Destination</attribute>
+     <attribute name="Type">org.apache.qpid.ra.admin.QpidTopic</attribute>
      <attribute name="Properties">
-        destinationType=TOPIC
         destinationAddress=@qpid.hellogoodbye.topic.dest.address@
      </attribute>
   </mbean>
@@ -58,9 +55,8 @@
          name="qpid.jca:name=HelloQueue">
      <attribute name="JNDIName">HelloQueue</attribute>
      <depends optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='@rar.name@'</depends>
-     <attribute name="Type">javax.jms.Destination</attribute>
+     <attribute name="Type">org.apache.qpid.ra.admin.QpidQueue</attribute>
      <attribute name="Properties">
-        destinationType=QUEUE
         destinationAddress=@qpid.hello.queue.dest.address@
      </attribute>
   </mbean>
@@ -69,9 +65,8 @@
          name="qpid.jca:name=GoodByeQueue">
      <attribute name="JNDIName">GoodByeQueue</attribute>
      <depends optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='@rar.name@'</depends>
-     <attribute name="Type">javax.jms.Destination</attribute>
+     <attribute name="Type">org.apache.qpid.ra.admin.QpidQueue</attribute>
      <attribute name="Properties">
-        destinationType=QUEUE
         destinationAddress=@qpid.goodbye.queue.dest.address@
      </attribute>
   </mbean>
@@ -80,9 +75,8 @@
          name="qpid.jca:name=QpidResponderQueue">
      <attribute name="JNDIName">QpidResponderQueue</attribute>
      <depends optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='@rar.name@'</depends>
-     <attribute name="Type">javax.jms.Destination</attribute>
+     <attribute name="Type">org.apache.qpid.ra.admin.QpidQueue</attribute>
      <attribute name="Properties">
-        destinationType=QUEUE
         destinationAddress=@qpid.responder.queue.dest.address@
      </attribute>
   </mbean>

Modified: qpid/trunk/qpid/java/jca/example/conf/web.xml
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/jca/example/conf/web.xml?rev=1239411&r1=1239410&r2=1239411&view=diff
==============================================================================
--- qpid/trunk/qpid/java/jca/example/conf/web.xml (original)
+++ qpid/trunk/qpid/java/jca/example/conf/web.xml Wed Feb  1 23:56:28 2012
@@ -22,19 +22,6 @@
 <web-app version="2.5" 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/web-app_2_5.xsd">
 
-    <resource-ref>
-        <res-ref-name>QpidJMSXA</res-ref-name>
-        <res-type>javax.jms.ConnectionFactory</res-type>
-        <res-auth>Container</res-auth>
-        <res-sharing-scope>Shareable</res-sharing-scope>
-    </resource-ref>
-
-    <ejb-local-ref>
-        <ejb-ref-name>QpidTestBean</ejb-ref-name>
-        <ejb-ref-type>Session</ejb-ref-type>
-        <local>org.apache.qpid.jca.example.ejb.QpidTestLocal</local>
-    </ejb-local-ref>
-
     <servlet>
         <display-name>QpidTestServlet</display-name>
         <servlet-name>QpidTestServlet</servlet-name>

Modified: qpid/trunk/qpid/java/jca/example/qpid-jca-example-properties.xml
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/jca/example/qpid-jca-example-properties.xml?rev=1239411&r1=1239410&r2=1239411&view=diff
==============================================================================
--- qpid/trunk/qpid/java/jca/example/qpid-jca-example-properties.xml (original)
+++ qpid/trunk/qpid/java/jca/example/qpid-jca-example-properties.xml Wed Feb  1 23:56:28 2012
@@ -36,7 +36,7 @@
     <property name="rar.ver" value="${qpid.ver}"/>
     <property name="rar.name" value="qpid-ra-${rar.ver}.rar"/>
 
-    <property name="broker.url" value="amqp://anonymous:passwd@client/test?brokerlist='tcp://${broker.address}?sasl_mechs='ANONYMOUS''"/>
+    <property name="broker.url" value="amqp://anonymous:passwd@client/test?brokerlist='tcp://${broker.address}?sasl_mechs='PLAIN''"/>
 
     <property name="qpid.hello.topic.dest.address.ADDR" value="amq.topic/hello.Topic"/>
     <property name="qpid.goodbye.topic.dest.address.ADDR" value="amq.topic/goodbye.Topic"/>

Modified: qpid/trunk/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidGoodByeSubscriberBean.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidGoodByeSubscriberBean.java?rev=1239411&r1=1239410&r2=1239411&view=diff
==============================================================================
--- qpid/trunk/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidGoodByeSubscriberBean.java (original)
+++ qpid/trunk/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidGoodByeSubscriberBean.java Wed Feb  1 23:56:28 2012
@@ -1,9 +1,35 @@
+/*
+ *
+ * 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.
+ *
+ */
 package org.apache.qpid.jca.example.ejb;
 
+import java.util.Date;
+
 import javax.ejb.ActivationConfigProperty;
 import javax.ejb.MessageDriven;
 import javax.jms.Message;
 import javax.jms.MessageListener;
+import javax.jms.TextMessage;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 @MessageDriven(activationConfig = {
     @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),
@@ -17,11 +43,25 @@ import javax.jms.MessageListener;
 
 public class QpidGoodByeSubscriberBean implements MessageListener
 {
+    private static final Logger _log = LoggerFactory.getLogger(QpidGoodByeSubscriberBean.class);
 
     @Override
     public void onMessage(Message message)
     {
-        System.out.println(message);
+        try
+        {
+            if(message instanceof TextMessage)
+            {
+                String content = ((TextMessage)message).getText();
+
+                _log.info("Received text message with contents: [" + content + "] at " + new Date());
+            }
+        }
+        catch(Exception e)
+        {
+            _log.error(e.getMessage(), e);
+        }
+
     }
 
 }

Modified: qpid/trunk/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidHelloListenerBean.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidHelloListenerBean.java?rev=1239411&r1=1239410&r2=1239411&view=diff
==============================================================================
--- qpid/trunk/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidHelloListenerBean.java (original)
+++ qpid/trunk/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidHelloListenerBean.java Wed Feb  1 23:56:28 2012
@@ -23,6 +23,7 @@ package org.apache.qpid.jca.example.ejb;
 import java.util.Date;
 
 import javax.annotation.PostConstruct;
+import javax.annotation.Resource;
 import javax.ejb.ActivationConfigProperty;
 import javax.ejb.MessageDriven;
 import javax.jms.Connection;
@@ -49,33 +50,12 @@ public class QpidHelloListenerBean imple
 {
     private static final Logger _log = LoggerFactory.getLogger(QpidHelloListenerBean.class);
 
+    @Resource(@jndi.scheme@="@qpid.xacf.jndi.name@")
     private ConnectionFactory _connectionFactory;
 
+    @Resource(@jndi.scheme@="GoodByeQueue")
     private Destination _queue;
 
-    @PostConstruct
-    public void init()
-    {
-        InitialContext context = null;
-
-        try
-        {
-            context = new InitialContext();
-            _connectionFactory = (ConnectionFactory)context.lookup("java:comp/env/QpidJMSXA");
-            _queue = (Destination)context.lookup("@qpid.goodbye.queue.jndi.name@");
-
-        }
-        catch(Exception e)
-        {
-           _log.error(e.getMessage(), e);
-        }
-        finally
-        {
-            QpidUtil.closeResources(context);
-        }
-
-    }
-
     @Override
     public void onMessage(Message message)
     {

Modified: qpid/trunk/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidHelloSubscriberBean.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidHelloSubscriberBean.java?rev=1239411&r1=1239410&r2=1239411&view=diff
==============================================================================
--- qpid/trunk/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidHelloSubscriberBean.java (original)
+++ qpid/trunk/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidHelloSubscriberBean.java Wed Feb  1 23:56:28 2012
@@ -22,7 +22,7 @@ package org.apache.qpid.jca.example.ejb;
 
 import java.util.Date;
 
-import javax.annotation.PostConstruct;
+import javax.annotation.Resource;
 import javax.ejb.ActivationConfigProperty;
 import javax.ejb.MessageDriven;
 import javax.jms.Connection;
@@ -52,35 +52,14 @@ public class QpidHelloSubscriberBean imp
 {
     private static final Logger _log = LoggerFactory.getLogger(QpidHelloSubscriberBean.class);
 
+    @Resource(@jndi.scheme@="@qpid.xacf.jndi.name@")
     private ConnectionFactory _connectionFactory;
 
+    @Resource(@jndi.scheme@="GoodByeTopic")
     private Destination _topic;
 
-    @PostConstruct
-    public void init()
-    {
-        InitialContext context = null;
-
-        try
-        {
-            context = new InitialContext();
-            _connectionFactory = (ConnectionFactory)context.lookup("java:comp/env/QpidJMSXA");
-            _topic = (Destination)context.lookup("@qpid.goodbye.topic.jndi.name@");
-
-        }
-        catch(Exception e)
-        {
-           _log.error(e.getMessage(), e);
-        }
-        finally
-        {
-            QpidUtil.closeResources(context);
-        }
-
-    }
-    
     @Override
-    public void onMessage(Message message) 
+    public void onMessage(Message message)
     {
         Connection connection = null;
         Session session = null;

Modified: qpid/trunk/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidJMSResponderBean.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidJMSResponderBean.java?rev=1239411&r1=1239410&r2=1239411&view=diff
==============================================================================
--- qpid/trunk/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidJMSResponderBean.java (original)
+++ qpid/trunk/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidJMSResponderBean.java Wed Feb  1 23:56:28 2012
@@ -1,8 +1,28 @@
+/*
+ *
+ * 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.
+ *
+ */
 package org.apache.qpid.jca.example.ejb;
 
 import java.util.Date;
 
-import javax.annotation.PostConstruct;
+import javax.annotation.Resource;
 import javax.ejb.ActivationConfigProperty;
 import javax.ejb.MessageDriven;
 import javax.jms.Connection;
@@ -29,30 +49,9 @@ public class QpidJMSResponderBean implem
 
     private static final Logger _log = LoggerFactory.getLogger(QpidJMSResponderBean.class);
 
+    @Resource(@jndi.scheme@="@qpid.xacf.jndi.name@")
     private ConnectionFactory _connectionFactory;
 
-    @PostConstruct
-    public void init()
-    {
-        InitialContext context = null;
-
-        try
-        {
-            context = new InitialContext();
-            _connectionFactory = (ConnectionFactory)context.lookup("java:comp/env/QpidJMSXA");
-
-        }
-        catch(Exception e)
-        {
-           _log.error(e.getMessage(), e);
-        }
-        finally
-        {
-            QpidUtil.closeResources(context);
-        }
-
-    }
-
     @Override
     public void onMessage(Message message)
     {

Modified: qpid/trunk/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidTestBean.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidTestBean.java?rev=1239411&r1=1239410&r2=1239411&view=diff
==============================================================================
--- qpid/trunk/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidTestBean.java (original)
+++ qpid/trunk/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/ejb/QpidTestBean.java Wed Feb  1 23:56:28 2012
@@ -21,6 +21,7 @@
 package org.apache.qpid.jca.example.ejb;
 
 import javax.annotation.PostConstruct;
+import javax.annotation.Resource;
 import javax.ejb.Stateless;
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
@@ -39,35 +40,15 @@ public class QpidTestBean implements Qpi
 
     private static final Logger _log = LoggerFactory.getLogger(QpidTestBean.class);
 
+    @Resource(@jndi.scheme@="@qpid.xacf.jndi.name@")
     private ConnectionFactory _connectionFactory;
 
+    @Resource(@jndi.scheme@="HelloQueue")
     private Destination _queue;
 
+    @Resource(@jndi.scheme@="HelloTopic")
     private Destination _topic;
 
-    @PostConstruct
-    public void init()
-    {
-        InitialContext context = null;
-
-        try
-        {
-            context = new InitialContext();
-            _connectionFactory = (ConnectionFactory)context.lookup("java:comp/env/QpidJMSXA");
-            _queue = (Destination)context.lookup("@qpid.hello.queue.jndi.name@");
-            _topic = (Destination)context.lookup("@qpid.hello.topic.jndi.name@");
-
-        }
-        catch(Exception e)
-        {
-           _log.error(e.getMessage(), e);
-        }
-        finally
-        {
-           QpidUtil.closeResources(context);
-        }
-
-    }
     @Override
     public void testQpidAdapter(String content) throws Exception
     {

Modified: qpid/trunk/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/web/QpidTestServlet.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/web/QpidTestServlet.java?rev=1239411&r1=1239410&r2=1239411&view=diff
==============================================================================
--- qpid/trunk/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/web/QpidTestServlet.java (original)
+++ qpid/trunk/qpid/java/jca/example/src/main/java/org/apache/qpid/jca/example/web/QpidTestServlet.java Wed Feb  1 23:56:28 2012
@@ -22,6 +22,8 @@
 package org.apache.qpid.jca.example.web;
 import java.io.IOException;
 
+import javax.annotation.Resource;
+import javax.ejb.EJB;
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
 import javax.jms.Destination;
@@ -36,7 +38,7 @@ import javax.servlet.http.HttpServletReq
 import javax.servlet.http.HttpServletResponse;
 import javax.transaction.UserTransaction;
 
-import org.apache.qpid.jca.example.ejb.QpidTest;
+import org.apache.qpid.jca.example.ejb.QpidTestLocal;
 import org.apache.qpid.jca.example.ejb.QpidUtil;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -52,35 +54,17 @@ public class QpidTestServlet extends Htt
     private static final boolean DEFAULT_XA = false;
     private static final boolean DEFAULT_SAY_GOODBYE = true;
 
+    @Resource(@jndi.scheme@="@qpid.xacf.jndi.name@")
     private ConnectionFactory _connectionFactory;
 
+    @Resource(@jndi.scheme@="HelloQueue")
     private Destination _queue;
 
+    @Resource(@jndi.scheme@="HelloTopic")
     private Destination _topic;
 
-    public void init(ServletConfig config) throws ServletException
-    {
-
-        InitialContext context = null;
-
-        try
-        {
-            context = new InitialContext();
-            _connectionFactory = (ConnectionFactory)context.lookup("java:comp/env/QpidJMSXA");
-            _queue = (Destination)context.lookup("@qpid.hello.queue.jndi.name@");
-            _topic = (Destination)context.lookup("@qpid.hello.topic.jndi.name@");
-
-        }
-        catch(Exception e)
-        {
-            _log.error(e.getMessage(), e);
-            throw new ServletException(e.getMessage(), e);
-        }
-        finally
-        {
-            QpidUtil.closeResources(context);
-        }
-    }
+    @EJB
+    private QpidTestLocal ejb;
 
     @Override
     protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
@@ -127,7 +111,6 @@ public class QpidTestServlet extends Htt
 
             if(useEJB)
             {
-                QpidTest ejb = (QpidTest)ctx.lookup("java:comp/env/QpidTestBean");
                 ejb.testQpidAdapter(content, count, useTopic, false, sayGoodBye);
             }
             else

Modified: qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/QpidRAManagedConnectionFactory.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/QpidRAManagedConnectionFactory.java?rev=1239411&r1=1239410&r2=1239411&view=diff
==============================================================================
--- qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/QpidRAManagedConnectionFactory.java (original)
+++ qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/QpidRAManagedConnectionFactory.java Wed Feb  1 23:56:28 2012
@@ -330,7 +330,7 @@ public class QpidRAManagedConnectionFact
    public int hashCode()
    {
       int hash = _mcfProperties.hashCode();
-      hash += 31 * _ra.hashCode();
+      hash += 31 * ((_ra != null) ? _ra.hashCode() : 1);
 
       return hash;
    }

Modified: qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/Util.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/Util.java?rev=1239411&r1=1239410&r2=1239411&view=diff
==============================================================================
--- qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/Util.java (original)
+++ qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/Util.java Wed Feb  1 23:56:28 2012
@@ -32,11 +32,10 @@ import javax.naming.Context;
 import javax.naming.RefAddr;
 import javax.naming.Reference;
 import javax.naming.Referenceable;
+import javax.naming.spi.NamingManager;
 import javax.transaction.TransactionManager;
 
 import org.apache.qpid.client.AMQConnectionURL;
-import org.apache.qpid.ra.admin.QpidQueue;
-import org.apache.qpid.ra.admin.QpidTopic;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -88,31 +87,7 @@ public class Util
 
 	   if (object instanceof Reference)
        {
-
-           Reference ref = (Reference) object;
-           String addressContent = null;
-
-           if (ref.getClassName().equals(QpidQueue.class.getName()))
-           {
-               RefAddr addr = ref.get(QpidQueue.class.getName());
-               addressContent = (String) addr.getContent();
-
-               if (addr != null)
-               {
-                   return (T)new QpidQueue(addressContent);
-               }
-           }
-
-           if (ref.getClassName().equals(QpidTopic.class.getName()))
-           {
-               RefAddr addr = ref.get(QpidTopic.class.getName());
-               addressContent = (String) addr.getContent();
-
-               if (addr != null)
-               {
-                   return (T)new QpidTopic(addressContent);
-               }
-           }
+		   return (T)NamingManager.getObjectInstance(object, null, null, null);
        }
 
 	   return clazz.cast(object);

Modified: qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/admin/AdminObjectFactory.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/admin/AdminObjectFactory.java?rev=1239411&r1=1239410&r2=1239411&view=diff
==============================================================================
--- qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/admin/AdminObjectFactory.java (original)
+++ qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/admin/AdminObjectFactory.java Wed Feb  1 23:56:28 2012
@@ -46,26 +46,26 @@ public class AdminObjectFactory implemen
             Reference ref = (Reference) object;
             String bindingURLString;
 
-            if (ref.getClassName().equals(QpidQueue.class.getName()))
+            if (ref.getClassName().equals(QpidQueueImpl.class.getName()))
             {
-                RefAddr addr = ref.get(QpidQueue.class.getName());
+                RefAddr addr = ref.get(QpidQueueImpl.class.getName());
                 bindingURLString = (String) addr.getContent();
 
                 if (addr != null)
                 {
-                    return new QpidQueue(bindingURLString);
+                    return new QpidQueueImpl(bindingURLString);
                 }
 
             }
 
-            if (ref.getClassName().equals(QpidTopic.class.getName()))
+            if (ref.getClassName().equals(QpidTopicImpl.class.getName()))
             {
-                RefAddr addr = ref.get(QpidTopic.class.getName());
+                RefAddr addr = ref.get(QpidTopicImpl.class.getName());
                 bindingURLString = (String) addr.getContent();
 
                 if (addr != null)
                 {
-                    return new QpidTopic(bindingURLString);
+                    return new QpidTopicImpl(bindingURLString);
                 }
             }
         }

Modified: qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/admin/QpidDestinationProxy.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/admin/QpidDestinationProxy.java?rev=1239411&r1=1239410&r2=1239411&view=diff
==============================================================================
--- qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/admin/QpidDestinationProxy.java (original)
+++ qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/admin/QpidDestinationProxy.java Wed Feb  1 23:56:28 2012
@@ -111,11 +111,11 @@ public class QpidDestinationProxy implem
         {
             if(getDestinationType().equalsIgnoreCase(DEFAULT_QUEUE_TYPE))
             {
-                _delegate = new QpidQueue(getDestinationAddress());
+                _delegate = new QpidQueueImpl(getDestinationAddress());
             }
             else if(getDestinationType().equalsIgnoreCase(DEFAULT_TOPIC_TYPE))
             {
-                _delegate = new QpidTopic(getDestinationAddress());
+                _delegate = new QpidTopicImpl(getDestinationAddress());
             }
             else
             {

Modified: qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/admin/QpidQueue.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/admin/QpidQueue.java?rev=1239411&r1=1239410&r2=1239411&view=diff
==============================================================================
--- qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/admin/QpidQueue.java (original)
+++ qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/admin/QpidQueue.java Wed Feb  1 23:56:28 2012
@@ -20,32 +20,8 @@
  */
 package org.apache.qpid.ra.admin;
 
-import javax.naming.NamingException;
-import javax.naming.Reference;
-import javax.naming.StringRefAddr;
-
-import org.apache.qpid.client.AMQQueue;
-
-public class QpidQueue extends AMQQueue
+public interface QpidQueue
 {
-    private String _url;
-
-    public QpidQueue(final String address) throws Exception
-    {
-        super(address);
-        this._url = address;
-    }
-
-    @Override
-    public Reference getReference() throws NamingException
-    {
-        return new Reference(this.getClass().getName(), new StringRefAddr(this.getClass().getName(), toURL()),
-                AdminObjectFactory.class.getName(), null);
-    }
-
-    @Override
-    public String toURL()
-    {
-        return _url;
-    }
+	public void setDestinationAddress(String destinationAddress) throws Exception;
+	public String getDestinationAddress();
 }

Added: qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/admin/QpidQueueImpl.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/admin/QpidQueueImpl.java?rev=1239411&view=auto
==============================================================================
--- qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/admin/QpidQueueImpl.java (added)
+++ qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/admin/QpidQueueImpl.java Wed Feb  1 23:56:28 2012
@@ -0,0 +1,119 @@
+/*
+ *
+ * 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.
+ *
+ */
+package org.apache.qpid.ra.admin;
+
+import java.io.Externalizable;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutput;
+import java.io.ObjectOutputStream;
+import java.util.Hashtable;
+
+import javax.naming.Context;
+import javax.naming.Name;
+import javax.naming.NamingException;
+import javax.naming.RefAddr;
+import javax.naming.Reference;
+import javax.naming.StringRefAddr;
+import javax.naming.spi.ObjectFactory;
+
+import org.apache.qpid.client.AMQQueue;
+import org.apache.qpid.ra.admin.AdminObjectFactory;
+
+public class QpidQueueImpl extends AMQQueue implements QpidQueue, Externalizable
+{
+    private String _url;
+
+    public QpidQueueImpl()
+    {
+        super();
+    }
+
+    public QpidQueueImpl(final String address) throws Exception
+    {
+        super(address);
+        this._url = address;
+    }
+
+    @Override
+    public Reference getReference() throws NamingException
+    {
+        return new Reference(this.getClass().getName(), new StringRefAddr(this.getClass().getName(), toURL()),
+                AdminObjectFactory.class.getName(), null);
+    }
+
+    @Override
+    public String toURL()
+    {
+        return _url;
+    }
+
+    public void setDestinationAddress(String destinationAddress) throws Exception
+    {
+        this._url = destinationAddress;
+        setDestinationString(this._url);
+    }
+
+
+    public String getDestinationAddress()
+    {
+    	return this._url;
+    }
+
+    public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
+    {
+        this._url = (String)in.readObject();
+
+        try
+        {
+            setDestinationString(this._url);
+
+        }
+        catch(Exception e)
+        {
+        	throw new IOException(e.getMessage(), e);
+        }
+    }
+
+    public void writeExternal(ObjectOutput out) throws IOException
+    {
+        out.writeObject(this._url);
+    }
+
+    //TODO move to tests
+    public static void main(String[] args) throws Exception
+    {
+        QpidQueueImpl q = new QpidQueueImpl();
+        q.setDestinationAddress("hello.Queue;{create:always, node:{type:queue, x-declare:{auto-delete:true}}}");
+        ObjectOutputStream os = new ObjectOutputStream(new FileOutputStream("queue.out"));
+        os.writeObject(q);
+        os.close();
+
+
+        ObjectInputStream is = new ObjectInputStream(new FileInputStream("queue.out"));
+        q = (QpidQueueImpl)is.readObject();
+        System.out.println(q);
+
+    }
+}

Modified: qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/admin/QpidTopic.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/admin/QpidTopic.java?rev=1239411&r1=1239410&r2=1239411&view=diff
==============================================================================
--- qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/admin/QpidTopic.java (original)
+++ qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/admin/QpidTopic.java Wed Feb  1 23:56:28 2012
@@ -20,33 +20,9 @@
  */
 package org.apache.qpid.ra.admin;
 
-import javax.naming.NamingException;
-import javax.naming.Reference;
-import javax.naming.StringRefAddr;
-
-import org.apache.qpid.client.AMQTopic;
-
-public class QpidTopic extends AMQTopic
+public interface QpidTopic
 {
-    private String _url;
-
-    public QpidTopic(final String address) throws Exception
-    {
-        super(address);
-        this._url = address;
-    }
-
-    @Override
-    public Reference getReference() throws NamingException
-    {
-        return new Reference(this.getClass().getName(), new StringRefAddr(this.getClass().getName(), toURL()),
-                AdminObjectFactory.class.getName(), null);
-    }
-
-    @Override
-    public String toURL()
-    {
-        return _url;
-    }
+	public void setDestinationAddress(String destinationAddress) throws Exception;
+	public String getDestinationAddress();
 
 }

Copied: qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/admin/QpidTopicImpl.java (from r1239166, qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/admin/QpidTopic.java)
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/admin/QpidTopicImpl.java?p2=qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/admin/QpidTopicImpl.java&p1=qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/admin/QpidTopic.java&r1=1239166&r2=1239411&rev=1239411&view=diff
==============================================================================
--- qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/admin/QpidTopic.java (original)
+++ qpid/trunk/qpid/java/jca/src/main/java/org/apache/qpid/ra/admin/QpidTopicImpl.java Wed Feb  1 23:56:28 2012
@@ -20,17 +20,27 @@
  */
 package org.apache.qpid.ra.admin;
 
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+
 import javax.naming.NamingException;
 import javax.naming.Reference;
 import javax.naming.StringRefAddr;
 
 import org.apache.qpid.client.AMQTopic;
+import org.apache.qpid.ra.inflow.QpidActivation;
 
-public class QpidTopic extends AMQTopic
+public class QpidTopicImpl extends AMQTopic implements QpidTopic, Externalizable
 {
     private String _url;
 
-    public QpidTopic(final String address) throws Exception
+    public QpidTopicImpl()
+    {
+    	super();
+    }
+    public QpidTopicImpl(final String address) throws Exception
     {
         super(address);
         this._url = address;
@@ -49,4 +59,35 @@ public class QpidTopic extends AMQTopic
         return _url;
     }
 
+    public void setDestinationAddress(String destinationAddress) throws Exception
+    {
+        this._url = destinationAddress;
+        setDestinationString(this._url);
+    }
+
+
+    public String getDestinationAddress()
+    {
+    	return this._url;
+    }
+
+    public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
+    {
+        this._url = (String)in.readObject();
+
+        try
+        {
+            setDestinationString(this._url);
+
+        }
+        catch(Exception e)
+        {
+        	throw new IOException(e.getMessage(), e);
+        }
+    }
+
+    public void writeExternal(ObjectOutput out) throws IOException
+    {
+        out.writeObject(this._url);
+    }
 }

Modified: qpid/trunk/qpid/java/jca/src/main/resources/META-INF/ra.xml
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/jca/src/main/resources/META-INF/ra.xml?rev=1239411&r1=1239410&r2=1239411&view=diff
==============================================================================
--- qpid/trunk/qpid/java/jca/src/main/resources/META-INF/ra.xml (original)
+++ qpid/trunk/qpid/java/jca/src/main/resources/META-INF/ra.xml Wed Feb  1 23:56:28 2012
@@ -197,6 +197,23 @@
       </inbound-resourceadapter>
 
       <adminobject>
+            <adminobject-interface>org.apache.qpid.ra.admin.QpidQueue</adminobject-interface>
+            <adminobject-class> org.apache.qpid.ra.admin.QpidQueueImpl</adminobject-class>
+            <config-property>
+                <config-property-name>destinationAddress </config-property-name>
+                <config-property-type>java.lang.String </config-property-type>
+            </config-property>
+        </adminobject>
+      <adminobject>
+            <adminobject-interface>org.apache.qpid.ra.admin.QpidTopic</adminobject-interface>
+            <adminobject-class> org.apache.qpid.ra.admin.QpidTopicImpl</adminobject-class>
+            <config-property>
+                <config-property-name>destinationAddress </config-property-name>
+                <config-property-type>java.lang.String </config-property-type>
+            </config-property>
+        </adminobject>
+      <!--
+      <adminobject>
             <adminobject-interface>javax.jms.Destination</adminobject-interface>
             <adminobject-class> org.apache.qpid.ra.admin.QpidDestinationProxy</adminobject-class>
             <config-property>
@@ -208,6 +225,7 @@
                 <config-property-type>java.lang.String </config-property-type>
             </config-property>
         </adminobject>
+      -->
       <adminobject>
             <adminobject-interface>javax.jms.ConnectionFactory</adminobject-interface>
             <adminobject-class> org.apache.qpid.ra.admin.QpidConnectionFactoryProxy</adminobject-class>



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message