activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [1/3] activemq-6 git commit: some refactoring around improving compatibility testing
Date Tue, 24 Feb 2015 14:53:29 GMT
Repository: activemq-6
Updated Branches:
  refs/heads/master 59deb8558 -> 661232079


some refactoring around improving compatibility testing


Project: http://git-wip-us.apache.org/repos/asf/activemq-6/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-6/commit/4fcb6b4b
Tree: http://git-wip-us.apache.org/repos/asf/activemq-6/tree/4fcb6b4b
Diff: http://git-wip-us.apache.org/repos/asf/activemq-6/diff/4fcb6b4b

Branch: refs/heads/master
Commit: 4fcb6b4b750cdb9757333823ed00f159bebb6b0e
Parents: 59deb85
Author: Andy Taylor <andytaylor@apache.org>
Authored: Tue Feb 24 14:34:27 2015 +0000
Committer: Andy Taylor <andytaylor@apache.org>
Committed: Tue Feb 24 14:34:27 2015 +0000

----------------------------------------------------------------------
 .../activemq/uri/TCPTransportConfigurationSchema.java       | 9 +++++++--
 .../apache/activemq/jndi/ActiveMQInitialContextFactory.java | 6 +++---
 .../uri/TCPAcceptorTransportConfigurationSchema.java        | 4 +++-
 3 files changed, 13 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-6/blob/4fcb6b4b/activemq-core-client/src/main/java/org/apache/activemq/uri/TCPTransportConfigurationSchema.java
----------------------------------------------------------------------
diff --git a/activemq-core-client/src/main/java/org/apache/activemq/uri/TCPTransportConfigurationSchema.java
b/activemq-core-client/src/main/java/org/apache/activemq/uri/TCPTransportConfigurationSchema.java
index c519851..1da596f 100644
--- a/activemq-core-client/src/main/java/org/apache/activemq/uri/TCPTransportConfigurationSchema.java
+++ b/activemq-core-client/src/main/java/org/apache/activemq/uri/TCPTransportConfigurationSchema.java
@@ -50,7 +50,7 @@ public class TCPTransportConfigurationSchema extends AbstractTransportConfigurat
    @Override
    protected List<TransportConfiguration> internalNewObject(URI uri, Map<String,
String> query, String name) throws Exception
    {
-      return getTransportConfigurations(uri, query, allowableProperties, name, getFactoryName());
+      return getTransportConfigurations(uri, query, allowableProperties, name, getFactoryName(uri));
    }
 
    @Override
@@ -88,8 +88,13 @@ public class TCPTransportConfigurationSchema extends AbstractTransportConfigurat
       return transportConfigurations;
    }
 
-   protected String getFactoryName()
+   protected String getFactoryName(URI uri)
    {
+      //here for backwards compatibility
+      if (uri.getPath() != null && uri.getPath().contains("hornetq"))
+      {
+         return "org.hornetq.core.remoting.impl.netty.NettyConnectorFactory";
+      }
       return NettyConnectorFactory.class.getName();
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/4fcb6b4b/activemq-jms-client/src/main/java/org/apache/activemq/jndi/ActiveMQInitialContextFactory.java
----------------------------------------------------------------------
diff --git a/activemq-jms-client/src/main/java/org/apache/activemq/jndi/ActiveMQInitialContextFactory.java
b/activemq-jms-client/src/main/java/org/apache/activemq/jndi/ActiveMQInitialContextFactory.java
index b398129..e14ff82 100644
--- a/activemq-jms-client/src/main/java/org/apache/activemq/jndi/ActiveMQInitialContextFactory.java
+++ b/activemq-jms-client/src/main/java/org/apache/activemq/jndi/ActiveMQInitialContextFactory.java
@@ -16,6 +16,7 @@
  */
 package org.apache.activemq.jndi;
 
+import javax.jms.ConnectionFactory;
 import javax.jms.Queue;
 import javax.jms.Topic;
 import javax.naming.Context;
@@ -27,7 +28,6 @@ import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 
 import org.apache.activemq.api.jms.ActiveMQJMSClient;
-import org.apache.activemq.jms.client.ActiveMQConnectionFactory;
 import org.apache.activemq.uri.ConnectionFactoryParser;
 
 /**
@@ -60,7 +60,7 @@ public class ActiveMQInitialContextFactory implements InitialContextFactory
             String jndiName = key.substring(connectionFactoryPrefix.length());
             try
             {
-               ActiveMQConnectionFactory factory = createConnectionFactory((String) environment.get(key),
jndiName);
+               ConnectionFactory factory = createConnectionFactory((String) environment.get(key),
jndiName);
                data.put(jndiName, factory);
             }
             catch (Exception e)
@@ -175,7 +175,7 @@ public class ActiveMQInitialContextFactory implements InitialContextFactory
    /**
     * Factory method to create a new connection factory from the given environment
     */
-   protected ActiveMQConnectionFactory createConnectionFactory(String uri, String name) throws
Exception
+   protected ConnectionFactory createConnectionFactory(String uri, String name) throws Exception
    {
       ConnectionFactoryParser parser = new ConnectionFactoryParser();
       return parser.newObject(parser.expandURI(uri), name);

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/4fcb6b4b/activemq-server/src/main/java/org/apache/activemq/uri/TCPAcceptorTransportConfigurationSchema.java
----------------------------------------------------------------------
diff --git a/activemq-server/src/main/java/org/apache/activemq/uri/TCPAcceptorTransportConfigurationSchema.java
b/activemq-server/src/main/java/org/apache/activemq/uri/TCPAcceptorTransportConfigurationSchema.java
index 01962d3..73b25b1 100644
--- a/activemq-server/src/main/java/org/apache/activemq/uri/TCPAcceptorTransportConfigurationSchema.java
+++ b/activemq-server/src/main/java/org/apache/activemq/uri/TCPAcceptorTransportConfigurationSchema.java
@@ -17,6 +17,8 @@
 package org.apache.activemq.uri;
 
 import org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory;
+
+import java.net.URI;
 import java.util.Set;
 
 /**
@@ -29,7 +31,7 @@ public class TCPAcceptorTransportConfigurationSchema extends TCPTransportConfigu
       super(allowableProperties);
    }
 
-   public String getFactoryName()
+   public String getFactoryName(URI uri)
    {
       return NettyAcceptorFactory.class.getName();
    }


Mime
View raw message