activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r663689 - in /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/camel/component: ActiveMQComponent.java CamelEndpointLoader.java
Date Thu, 05 Jun 2008 18:08:47 GMT
Author: rajdavies
Date: Thu Jun  5 11:08:47 2008
New Revision: 663689

URL: http://svn.apache.org/viewvc?rev=663689&view=rev
Log:
Applied patch for https://issues.apache.org/activemq/browse/AMQ-1768

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/camel/component/ActiveMQComponent.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/camel/component/CamelEndpointLoader.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/camel/component/ActiveMQComponent.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/camel/component/ActiveMQComponent.java?rev=663689&r1=663688&r2=663689&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/camel/component/ActiveMQComponent.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/camel/component/ActiveMQComponent.java
Thu Jun  5 11:08:47 2008
@@ -47,7 +47,10 @@
      */
     public static ActiveMQComponent activeMQComponent(String brokerURL) {
         ActiveMQComponent answer = new ActiveMQComponent();
-        answer.getConfiguration().setBrokerURL(brokerURL);
+        if (answer.getConfiguration() instanceof ActiveMQConfiguration) {
+            ((ActiveMQConfiguration) answer.getConfiguration())
+                    .setBrokerURL(brokerURL);
+        }
         return answer;
     }
 
@@ -62,21 +65,23 @@
         super(configuration);
     }
 
-    @Override
-    public ActiveMQConfiguration getConfiguration() {
-        return (ActiveMQConfiguration) super.getConfiguration();
-    }
-
+   
     public void setBrokerURL(String brokerURL) {
-        getConfiguration().setBrokerURL(brokerURL);
+        if (getConfiguration() instanceof ActiveMQConfiguration) {
+            ((ActiveMQConfiguration)getConfiguration()).setBrokerURL(brokerURL);
+        }
     }
 
     public void setUserName(String userName) {
-        getConfiguration().setUserName(userName);
+        if (getConfiguration() instanceof ActiveMQConfiguration) {
+            ((ActiveMQConfiguration)getConfiguration()).setUserName(userName);
+        }
     }
 
     public void setPassword(String password) {
-        getConfiguration().setPassword(password);
+        if (getConfiguration() instanceof ActiveMQConfiguration) {
+            ((ActiveMQConfiguration)getConfiguration()).setPassword(password);
+        }
     }
 
     public boolean isExposeAllQueues() {
@@ -94,11 +99,15 @@
     }
 
     public void setUsePooledConnection(boolean usePooledConnection) {
-        getConfiguration().setUsePooledConnection(usePooledConnection);
+        if (getConfiguration() instanceof ActiveMQConfiguration) {
+            ((ActiveMQConfiguration)getConfiguration()).setUsePooledConnection(usePooledConnection);
+        }
     }
 
     public void setUseSingleConnection(boolean useSingleConnection) {
-        getConfiguration().setUseSingleConnection(useSingleConnection);
+        if (getConfiguration() instanceof ActiveMQConfiguration) {
+            ((ActiveMQConfiguration)getConfiguration()).setUseSingleConnection(useSingleConnection);
+        }
     }
 
     @Override

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/camel/component/CamelEndpointLoader.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/camel/component/CamelEndpointLoader.java?rev=663689&r1=663688&r2=663689&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/camel/component/CamelEndpointLoader.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/camel/component/CamelEndpointLoader.java
Thu Jun  5 11:08:47 2008
@@ -118,8 +118,10 @@
     }
 
     public ConnectionFactory getConnectionFactory() {
-        if (connectionFactory == null) {
-            connectionFactory = getComponent().getConfiguration().createConnectionFactory();
+        if (connectionFactory == null
+                && getComponent().getConfiguration() instanceof ActiveMQConfiguration)
{
+            connectionFactory = ((ActiveMQConfiguration) getComponent()
+                    .getConfiguration()).createConnectionFactory();
         }
         return connectionFactory;
     }



Mime
View raw message