qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kw...@apache.org
Subject svn commit: r1690285 - in /qpid/java/trunk: client/src/main/java/org/apache/qpid/client/ client/src/main/java/org/apache/qpid/jndi/ doc/book/src/jms-client-0-8/
Date Fri, 10 Jul 2015 16:41:32 GMT
Author: kwall
Date: Fri Jul 10 16:41:32 2015
New Revision: 1690285

URL: http://svn.apache.org/r1690285
Log:
QPID-6635: Improve JMS Client functionality around Container JNDI integration - correct a
couple of typos, mainly in property handling.

Modified:
    qpid/java/trunk/client/src/main/java/org/apache/qpid/client/AMQConnectionFactory.java
    qpid/java/trunk/client/src/main/java/org/apache/qpid/client/PooledConnectionFactory.java
    qpid/java/trunk/client/src/main/java/org/apache/qpid/jndi/ObjectFactory.java
    qpid/java/trunk/doc/book/src/jms-client-0-8/JMS-Client-Appendix-Tomcat-JNDI-Integration.xml

Modified: qpid/java/trunk/client/src/main/java/org/apache/qpid/client/AMQConnectionFactory.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/client/src/main/java/org/apache/qpid/client/AMQConnectionFactory.java?rev=1690285&r1=1690284&r2=1690285&view=diff
==============================================================================
--- qpid/java/trunk/client/src/main/java/org/apache/qpid/client/AMQConnectionFactory.java
(original)
+++ qpid/java/trunk/client/src/main/java/org/apache/qpid/client/AMQConnectionFactory.java
Fri Jul 10 16:41:32 2015
@@ -25,7 +25,6 @@ import static org.apache.qpid.client.AMQ
 import org.apache.qpid.client.util.JMSExceptionHelper;
 import org.apache.qpid.jms.ConnectionURL;
 import org.apache.qpid.jndi.ObjectFactory;
-import org.apache.qpid.url.AMQBindingURL;
 import org.apache.qpid.url.URLSyntaxException;
 
 import javax.jms.ConnectionFactory;
@@ -43,7 +42,6 @@ import javax.jms.XATopicConnectionFactor
 import javax.naming.Context;
 import javax.naming.Name;
 import javax.naming.NamingException;
-import javax.naming.RefAddr;
 import javax.naming.Reference;
 import javax.naming.Referenceable;
 import javax.naming.StringRefAddr;

Modified: qpid/java/trunk/client/src/main/java/org/apache/qpid/client/PooledConnectionFactory.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/client/src/main/java/org/apache/qpid/client/PooledConnectionFactory.java?rev=1690285&r1=1690284&r2=1690285&view=diff
==============================================================================
--- qpid/java/trunk/client/src/main/java/org/apache/qpid/client/PooledConnectionFactory.java
(original)
+++ qpid/java/trunk/client/src/main/java/org/apache/qpid/client/PooledConnectionFactory.java
Fri Jul 10 16:41:32 2015
@@ -52,6 +52,7 @@ import javax.jms.IllegalStateException;
 import javax.jms.Session;
 import javax.naming.NamingException;
 import javax.naming.Reference;
+import javax.naming.Referenceable;
 import javax.naming.StringRefAddr;
 
 import org.apache.qpid.jndi.ObjectFactory;
@@ -63,7 +64,8 @@ import org.apache.qpid.client.util.JMSEx
 import org.apache.qpid.jms.*;
 import org.apache.qpid.url.URLSyntaxException;
 
-public class PooledConnectionFactory implements ConnectionFactory, QueueConnectionFactory,
TopicConnectionFactory
+public class PooledConnectionFactory implements ConnectionFactory, QueueConnectionFactory,
TopicConnectionFactory,
+                                                Referenceable
 {
 
     public static final String JNDI_ADDRESS_MAX_POOL_SIZE = "maxPoolSize";
@@ -393,6 +395,7 @@ public class PooledConnectionFactory imp
         }
     }
 
+    @Override
     public Reference getReference() throws NamingException
     {
         Reference reference = new Reference(
@@ -401,7 +404,7 @@ public class PooledConnectionFactory imp
                 ObjectFactory.class.getName(), null);          // factory location
 
         reference.add(new StringRefAddr(JNDI_ADDRESS_MAX_POOL_SIZE, String.valueOf(getMaxPoolSize())));
-        reference.add(new StringRefAddr(JNDI_ADDRESS_CONNECTION_TIMEOUT, String.valueOf(getMaxPoolSize())));
+        reference.add(new StringRefAddr(JNDI_ADDRESS_CONNECTION_TIMEOUT, String.valueOf(getConnectionTimeout())));
         return reference;
     }
 

Modified: qpid/java/trunk/client/src/main/java/org/apache/qpid/jndi/ObjectFactory.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/client/src/main/java/org/apache/qpid/jndi/ObjectFactory.java?rev=1690285&r1=1690284&r2=1690285&view=diff
==============================================================================
--- qpid/java/trunk/client/src/main/java/org/apache/qpid/jndi/ObjectFactory.java (original)
+++ qpid/java/trunk/client/src/main/java/org/apache/qpid/jndi/ObjectFactory.java Fri Jul 10
16:41:32 2015
@@ -96,7 +96,7 @@ public class ObjectFactory implements ja
             Object connectionTimeout = getRefAddressContent(reference, JNDI_ADDRESS_CONNECTION_TIMEOUT);
             if (connectionTimeout != null)
             {
-                connectionFactory.setConnectionTimeout(connectionTimeout instanceof Number
? ((Number) connectionTimeout).longValue() : Long.parseLong(String.valueOf(connectionURL)));
+                connectionFactory.setConnectionTimeout(connectionTimeout instanceof Number
? ((Number) connectionTimeout).longValue() : Long.parseLong(String.valueOf(connectionTimeout)));
             }
 
             return connectionFactory;
@@ -187,7 +187,7 @@ public class ObjectFactory implements ja
             else if (addressString.startsWith(AMQDestination.DestSyntax.ADDR.asPrefix()))
             {
                 addressSyntax = AMQDestination.DestSyntax.ADDR;
-                addressString = addressString.substring(AMQDestination.DestSyntax.BURL.asPrefix().length());
+                addressString = addressString.substring(AMQDestination.DestSyntax.ADDR.asPrefix().length());
             }
 
             return createAMQDestination(destinationClass, addressSyntax, addressString);

Modified: qpid/java/trunk/doc/book/src/jms-client-0-8/JMS-Client-Appendix-Tomcat-JNDI-Integration.xml
URL: http://svn.apache.org/viewvc/qpid/java/trunk/doc/book/src/jms-client-0-8/JMS-Client-Appendix-Tomcat-JNDI-Integration.xml?rev=1690285&r1=1690284&r2=1690285&view=diff
==============================================================================
--- qpid/java/trunk/doc/book/src/jms-client-0-8/JMS-Client-Appendix-Tomcat-JNDI-Integration.xml
(original)
+++ qpid/java/trunk/doc/book/src/jms-client-0-8/JMS-Client-Appendix-Tomcat-JNDI-Integration.xml
Fri Jul 10 16:41:32 2015
@@ -34,7 +34,7 @@
   <para>
     <literal>org.apache.qpid.jndi.ObjectFactory</literal> implements
     <ulink url="&oracleJdkDocUrl;javax/naming/spi/ObjectFactory.html">javax.naming.spi.ObjectFactory</ulink>
-    allowing it to create instances of <literal>AMQConnectionFactory</literal>,
<literal>PolledConnectionFactory</literal>,
+    allowing it to create instances of <literal>AMQConnectionFactory</literal>,
<literal>PooledConnectionFactory</literal>,
     <literal>AMQConnection</literal>, <literal>AMQQueue</literal>
and <literal>AMQTopic</literal> in external JNDI container from
     <ulink url="&oracleJdkDocUrl;javax/naming/Reference.html">javax.naming.Reference</ulink>s.
   </para>
@@ -58,7 +58,7 @@
       </listitem>
       <listitem>
         <para>
-          an instance of <literal>PolledConnectionFactory</literal> from a <literal>Reference</literal>
containing reference
+          an instance of <literal>PooledConnectionFactory</literal> from a <literal>Reference</literal>
containing reference
           address (<ulink url="&oracleJdkDocUrl;javax/naming/RefAddr.html">javax.naming.RefAddr</ulink>)
           <literal>connectionURL</literal> with content set to a
           <link linkend="JMS-Client-0-8-Connection-URL">Connection URL</link>.
@@ -112,7 +112,7 @@
             factory="org.apache.qpid.jndi.ObjectFactory"
             connectionURL="amqp://guest:guest@clientid/?brokerlist='localhost:5672'"/>
 
-  <Resource name="jms/polledConnectionFactory" auth="Container"
+  <Resource name="jms/pooledConnectionFactory" auth="Container"
             type="org.apache.qpid.client.PooledConnectionFactory"
             factory="org.apache.qpid.jndi.ObjectFactory"
             connectionURL="amqp://guest:guest@clientid/?brokerlist='localhost:5672'"
@@ -131,7 +131,7 @@
 </Context>]]></programlisting>
   </example>
   <para>In the example above <literal>AMQConnectionFactory</literal> would
be registered under JNDI name "jms/connectionFactory",
-    <literal>PooledConnectionFactory</literal> would be registered under JNDI
name "jms/polledConnectionFactory",
+    <literal>PooledConnectionFactory</literal> would be registered under JNDI
name "jms/pooledConnectionFactory",
     <literal>Queue</literal> "myQueue" would be registered under JNDI name "jms/queue"
and JMS <literal>Topic</literal>
    destination "myTopic" would be registered under JNDI name "jms/topic". (All resources
will be bound under "java:comp/env").
     On declaration of <literal>PooledConnectionFactory</literal> optional maxPoolSize
and connectionTimeout are set to



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message