activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [3/5] activemq-artemis git commit: ARTEMIS-347 - supporting URIs on the cluster connection
Date Tue, 19 Jan 2016 22:43:33 GMT
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3f23c991/artemis-core-client/src/main/java/org/apache/activemq/artemis/uri/schema/serverLocator/JGroupsServerLocatorSchema.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/uri/schema/serverLocator/JGroupsServerLocatorSchema.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/uri/schema/serverLocator/JGroupsServerLocatorSchema.java
new file mode 100644
index 0000000..73a1b94
--- /dev/null
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/uri/schema/serverLocator/JGroupsServerLocatorSchema.java
@@ -0,0 +1,89 @@
+/*
+ * 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.activemq.artemis.uri.schema.serverLocator;
+
+import org.apache.activemq.artemis.api.core.BroadcastEndpointFactory;
+import org.apache.activemq.artemis.api.core.DiscoveryGroupConfiguration;
+import org.apache.activemq.artemis.api.core.JGroupsFileBroadcastEndpointFactory;
+import org.apache.activemq.artemis.api.core.JGroupsPropertiesBroadcastEndpointFactory;
+import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
+import org.apache.activemq.artemis.api.core.client.ServerLocator;
+import org.apache.activemq.artemis.utils.uri.SchemaConstants;
+
+import java.io.NotSerializableException;
+import java.net.URI;
+import java.util.Map;
+
+public class JGroupsServerLocatorSchema extends AbstractServerLocatorSchema {
+
+   @Override
+   public String getSchemaName() {
+      return SchemaConstants.JGROUPS;
+   }
+
+   @Override
+   protected ServerLocator internalNewObject(URI uri, Map<String, String> query, String name) throws Exception {
+      ConnectionOptions options = newConnectionOptions(uri, query);
+
+      DiscoveryGroupConfiguration dcConfig = getDiscoveryGroupConfiguration(uri, query, name);
+
+      if (options.isHa()) {
+         return ActiveMQClient.createServerLocatorWithHA(dcConfig);
+      }
+      else {
+         return ActiveMQClient.createServerLocatorWithoutHA(dcConfig);
+      }
+   }
+
+   @Override
+   protected URI internalNewURI(ServerLocator bean) throws Exception {
+      DiscoveryGroupConfiguration dgc = bean.getDiscoveryGroupConfiguration();
+      BroadcastEndpointFactory endpoint = dgc.getBroadcastEndpointFactory();
+      String auth;
+      if (endpoint instanceof JGroupsFileBroadcastEndpointFactory) {
+         auth = ((JGroupsFileBroadcastEndpointFactory) endpoint).getChannelName();
+      }
+      else if (endpoint instanceof JGroupsPropertiesBroadcastEndpointFactory) {
+         auth = ((JGroupsPropertiesBroadcastEndpointFactory) endpoint).getChannelName();
+      }
+      else {
+         throw new NotSerializableException(endpoint + "not serializable");
+      }
+      String query = getData(null, bean, dgc, endpoint);
+      dgc.setBroadcastEndpointFactory(endpoint);
+      return new URI(SchemaConstants.JGROUPS, null, auth, -1, null, query, null);
+   }
+
+   public static DiscoveryGroupConfiguration getDiscoveryGroupConfiguration(URI uri,
+                                                                            Map<String, String> query,
+                                                                            String name) throws Exception {
+      BroadcastEndpointFactory endpointFactory;
+      if (query.containsKey("file")) {
+         endpointFactory = new JGroupsFileBroadcastEndpointFactory().setChannelName(uri.getAuthority());
+      }
+      else {
+         endpointFactory = new JGroupsPropertiesBroadcastEndpointFactory().setChannelName(uri.getAuthority());
+      }
+
+      setData(uri, endpointFactory, query);
+
+      DiscoveryGroupConfiguration dcConfig = new DiscoveryGroupConfiguration().setName(name).setBroadcastEndpointFactory(endpointFactory);
+
+      setData(uri, dcConfig, query);
+      return dcConfig;
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3f23c991/artemis-core-client/src/main/java/org/apache/activemq/artemis/uri/schema/serverLocator/TCPServerLocatorSchema.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/uri/schema/serverLocator/TCPServerLocatorSchema.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/uri/schema/serverLocator/TCPServerLocatorSchema.java
new file mode 100644
index 0000000..b330d0e
--- /dev/null
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/uri/schema/serverLocator/TCPServerLocatorSchema.java
@@ -0,0 +1,121 @@
+/*
+ * 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.activemq.artemis.uri.schema.serverLocator;
+
+import java.net.URI;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.activemq.artemis.api.core.TransportConfiguration;
+import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
+import org.apache.activemq.artemis.api.core.client.ServerLocator;
+import org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory;
+import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants;
+import org.apache.activemq.artemis.uri.schema.connector.TCPTransportConfigurationSchema;
+import org.apache.activemq.artemis.utils.IPV6Util;
+import org.apache.activemq.artemis.utils.uri.SchemaConstants;
+
+public class TCPServerLocatorSchema extends AbstractServerLocatorSchema {
+   @Override
+   public String getSchemaName() {
+      return SchemaConstants.TCP;
+   }
+
+   @Override
+   protected ServerLocator internalNewObject(URI uri, Map<String, String> query, String name) throws Exception {
+      ConnectionOptions options = newConnectionOptions(uri, query);
+
+      List<TransportConfiguration> configurations = TCPTransportConfigurationSchema.getTransportConfigurations(uri, query, TransportConstants.ALLOWABLE_CONNECTOR_KEYS, name, NettyConnectorFactory.class.getName());
+      TransportConfiguration[] tcs = new TransportConfiguration[configurations.size()];
+      configurations.toArray(tcs);
+      if (options.isHa()) {
+         return ActiveMQClient.createServerLocatorWithHA(tcs);
+      }
+      else {
+         return ActiveMQClient.createServerLocatorWithoutHA(tcs);
+      }
+   }
+
+   @Override
+   protected URI internalNewURI(ServerLocator bean) throws Exception {
+      String query = getData(null, bean);
+      TransportConfiguration[] staticConnectors = bean.getStaticTransportConfigurations();
+      return getURI(query, staticConnectors);
+   }
+
+   public static URI getURI(String query, TransportConfiguration[] staticConnectors) throws Exception {
+      if (staticConnectors == null || staticConnectors.length < 1) {
+         throw new Exception();
+      }
+      StringBuilder fragment = new StringBuilder();
+      for (int i = 1; i < staticConnectors.length; i++) {
+         TransportConfiguration connector = staticConnectors[i];
+         Map<String, Object> params = escapeIPv6Host(connector.getParams());
+         URI extraUri = new URI(SchemaConstants.TCP, null, getHost(params), getPort(params), null, createQuery(params, null), null);
+         if (i > 1) {
+            fragment.append(",");
+         }
+         fragment.append(extraUri.toASCIIString());
+
+      }
+      Map<String, Object> params = escapeIPv6Host(staticConnectors[0].getParams());
+      return new URI(SchemaConstants.TCP, null, getHost(params), getPort(params), null, createQuery(params, query), fragment.toString());
+   }
+
+   @SuppressWarnings("StringEquality")
+   private static Map<String, Object> escapeIPv6Host(Map<String, Object> params) {
+      String host = (String) params.get("host");
+      String newHost = IPV6Util.encloseHost(host);
+
+      // We really want to check the objects here
+      // Some bug finders may report this as an error, hence the SuppressWarnings on this method
+      if (host != newHost) {
+         params.put("host", "[" + host + "]");
+      }
+
+      return params;
+   }
+
+   private static int getPort(Map<String, Object> params) {
+      Object port = params.get("port");
+      if (port instanceof String) {
+         return Integer.valueOf((String) port);
+      }
+      return port != null ? (int) port : 61616;
+   }
+
+   private static String getHost(Map<String, Object> params) {
+      return params.get("host") != null ? (String) params.get("host") : "localhost";
+   }
+
+   private static String createQuery(Map<String, Object> params, String query) {
+      StringBuilder cb;
+      if (query == null) {
+         cb = new StringBuilder();
+      }
+      else {
+         cb = new StringBuilder(query);
+      }
+      for (String param : params.keySet()) {
+         if (cb.length() > 0) {
+            cb.append("&");
+         }
+         cb.append(param).append("=").append(params.get(param));
+      }
+      return cb.toString();
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3f23c991/artemis-core-client/src/main/java/org/apache/activemq/artemis/uri/schema/serverLocator/UDPServerLocatorSchema.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/uri/schema/serverLocator/UDPServerLocatorSchema.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/uri/schema/serverLocator/UDPServerLocatorSchema.java
new file mode 100644
index 0000000..a21e1a9
--- /dev/null
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/uri/schema/serverLocator/UDPServerLocatorSchema.java
@@ -0,0 +1,81 @@
+/*
+ * 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.activemq.artemis.uri.schema.serverLocator;
+
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.activemq.artemis.api.core.DiscoveryGroupConfiguration;
+import org.apache.activemq.artemis.api.core.UDPBroadcastEndpointFactory;
+import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
+import org.apache.activemq.artemis.api.core.client.ServerLocator;
+import org.apache.activemq.artemis.utils.uri.SchemaConstants;
+
+public class UDPServerLocatorSchema extends AbstractServerLocatorSchema {
+
+   public static List<String> IGNORED = new ArrayList<>();
+
+   static {
+      IGNORED.add("localBindAddress");
+      IGNORED.add("localBindPort");
+   }
+
+   @Override
+   public String getSchemaName() {
+      return SchemaConstants.UDP;
+   }
+
+   @Override
+   protected ServerLocator internalNewObject(URI uri, Map<String, String> query, String name) throws Exception {
+      ConnectionOptions options = newConnectionOptions(uri, query);
+
+      DiscoveryGroupConfiguration dgc = getDiscoveryGroupConfiguration(uri, query, getHost(uri), getPort(uri), name);
+
+      if (options.isHa()) {
+         return ActiveMQClient.createServerLocatorWithHA(dgc);
+      }
+      else {
+         return ActiveMQClient.createServerLocatorWithoutHA(dgc);
+      }
+   }
+
+   @Override
+   protected URI internalNewURI(ServerLocator bean) throws Exception {
+      DiscoveryGroupConfiguration dgc = bean.getDiscoveryGroupConfiguration();
+      UDPBroadcastEndpointFactory endpoint = (UDPBroadcastEndpointFactory) dgc.getBroadcastEndpointFactory();
+      dgc.setBroadcastEndpointFactory(endpoint);
+      String query = getData(IGNORED, bean, dgc, endpoint);
+      return new URI(SchemaConstants.UDP, null, endpoint.getGroupAddress(), endpoint.getGroupPort(), null, query, null);
+   }
+
+   public static DiscoveryGroupConfiguration getDiscoveryGroupConfiguration(URI uri,
+                                                                            Map<String, String> query,
+                                                                            String host,
+                                                                            int port,
+                                                                            String name) throws Exception {
+      UDPBroadcastEndpointFactory endpointFactoryConfiguration = new UDPBroadcastEndpointFactory().setGroupAddress(host).setGroupPort(port);
+
+      setData(uri, endpointFactoryConfiguration, query);
+
+      DiscoveryGroupConfiguration dgc = setData(uri, new DiscoveryGroupConfiguration(), query).setName(name).setBroadcastEndpointFactory(endpointFactoryConfiguration);
+
+      setData(uri, dgc, query);
+      return dgc;
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3f23c991/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/ConfigurationHelper.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/ConfigurationHelper.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/ConfigurationHelper.java
index 8771451..166c0a7 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/ConfigurationHelper.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/ConfigurationHelper.java
@@ -16,17 +16,17 @@
  */
 package org.apache.activemq.artemis.utils;
 
-import org.apache.activemq.artemis.api.core.ActiveMQException;
-import org.apache.activemq.artemis.core.client.ActiveMQClientLogger;
-import org.apache.activemq.artemis.core.client.ActiveMQClientMessageBundle;
-
 import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
 
+import org.apache.activemq.artemis.api.core.ActiveMQException;
+import org.apache.activemq.artemis.core.client.ActiveMQClientLogger;
+import org.apache.activemq.artemis.core.client.ActiveMQClientMessageBundle;
+
 public class ConfigurationHelper {
 
-   public static String getStringProperty(final String propName, final String def, final Map<String, Object> props) {
+   public static String getStringProperty(final String propName, final String def, final Map<String, ?> props) {
       if (props == null) {
          return def;
       }
@@ -46,7 +46,7 @@ public class ConfigurationHelper {
       }
    }
 
-   public static int getIntProperty(final String propName, final int def, final Map<String, Object> props) {
+   public static int getIntProperty(final String propName, final int def, final Map<String, ?> props) {
       if (props == null) {
          return def;
       }
@@ -71,7 +71,7 @@ public class ConfigurationHelper {
       }
    }
 
-   public static long getLongProperty(final String propName, final long def, final Map<String, Object> props) {
+   public static long getLongProperty(final String propName, final long def, final Map<String, ?> props) {
       if (props == null) {
          return def;
       }
@@ -97,7 +97,7 @@ public class ConfigurationHelper {
       }
    }
 
-   public static boolean getBooleanProperty(final String propName, final boolean def, final Map<String, Object> props) {
+   public static boolean getBooleanProperty(final String propName, final boolean def, final Map<String, ?> props) {
       if (props == null) {
          return def;
       }
@@ -160,7 +160,7 @@ public class ConfigurationHelper {
 
    public static String getPasswordProperty(final String propName,
                                             final String def,
-                                            final Map<String, Object> props,
+                                            final Map<String, ?> props,
                                             String defaultMaskPassword,
                                             String defaultPasswordCodec) {
       if (props == null) {
@@ -201,4 +201,17 @@ public class ConfigurationHelper {
       }
    }
 
+   public static double getDoubleProperty(String name, double def, Map<String, ?> props) {
+      if (props == null) {
+         return def;
+      }
+      Object prop = props.get(name);
+      if (prop == null) {
+         return def;
+      }
+      else {
+         String value = prop.toString();
+         return Double.parseDouble(value);
+      }
+   }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3f23c991/artemis-jms-client/src/main/java/org/apache/activemq/artemis/uri/InVMSchema.java
----------------------------------------------------------------------
diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/uri/InVMSchema.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/uri/InVMSchema.java
index b161786..4e69c4d 100644
--- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/uri/InVMSchema.java
+++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/uri/InVMSchema.java
@@ -18,6 +18,8 @@ package org.apache.activemq.artemis.uri;
 
 import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
 import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
+import org.apache.activemq.artemis.uri.schema.serverLocator.InVMServerLocatorSchema;
+import org.apache.activemq.artemis.uri.schema.connector.InVMTransportConfigurationSchema;
 import org.apache.activemq.artemis.utils.uri.SchemaConstants;
 
 import java.net.URI;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3f23c991/artemis-jms-client/src/main/java/org/apache/activemq/artemis/uri/JGroupsSchema.java
----------------------------------------------------------------------
diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/uri/JGroupsSchema.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/uri/JGroupsSchema.java
index a6b3680..2874fa9 100644
--- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/uri/JGroupsSchema.java
+++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/uri/JGroupsSchema.java
@@ -27,6 +27,7 @@ import org.apache.activemq.artemis.api.core.JGroupsFileBroadcastEndpointFactory;
 import org.apache.activemq.artemis.api.core.JGroupsPropertiesBroadcastEndpointFactory;
 import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
 import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
+import org.apache.activemq.artemis.uri.schema.serverLocator.JGroupsServerLocatorSchema;
 import org.apache.activemq.artemis.utils.uri.SchemaConstants;
 import org.apache.activemq.artemis.utils.uri.URISchema;
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3f23c991/artemis-jms-client/src/main/java/org/apache/activemq/artemis/uri/JMSConnectionOptions.java
----------------------------------------------------------------------
diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/uri/JMSConnectionOptions.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/uri/JMSConnectionOptions.java
index 04d8e8f..92fb3b7 100644
--- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/uri/JMSConnectionOptions.java
+++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/uri/JMSConnectionOptions.java
@@ -18,6 +18,7 @@
 package org.apache.activemq.artemis.uri;
 
 import org.apache.activemq.artemis.api.jms.JMSFactoryType;
+import org.apache.activemq.artemis.uri.schema.serverLocator.ConnectionOptions;
 
 /**
  * This will represent all the possible options you could setup on URLs

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3f23c991/artemis-jms-client/src/main/java/org/apache/activemq/artemis/uri/TCPSchema.java
----------------------------------------------------------------------
diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/uri/TCPSchema.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/uri/TCPSchema.java
index 7a35a41..5e9eb14 100644
--- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/uri/TCPSchema.java
+++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/uri/TCPSchema.java
@@ -21,6 +21,8 @@ import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
 import org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory;
 import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants;
 import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
+import org.apache.activemq.artemis.uri.schema.serverLocator.TCPServerLocatorSchema;
+import org.apache.activemq.artemis.uri.schema.connector.TCPTransportConfigurationSchema;
 import org.apache.activemq.artemis.utils.uri.SchemaConstants;
 import org.apache.activemq.artemis.utils.uri.URISchema;
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3f23c991/artemis-jms-client/src/main/java/org/apache/activemq/artemis/uri/UDPSchema.java
----------------------------------------------------------------------
diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/uri/UDPSchema.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/uri/UDPSchema.java
index 9c83755..5a6ca9a 100644
--- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/uri/UDPSchema.java
+++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/uri/UDPSchema.java
@@ -24,6 +24,7 @@ import org.apache.activemq.artemis.api.core.DiscoveryGroupConfiguration;
 import org.apache.activemq.artemis.api.core.UDPBroadcastEndpointFactory;
 import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
 import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
+import org.apache.activemq.artemis.uri.schema.serverLocator.UDPServerLocatorSchema;
 import org.apache.activemq.artemis.utils.uri.SchemaConstants;
 import org.apache.activemq.artemis.utils.uri.URISchema;
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3f23c991/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/embedded/EmbeddedJMS.java
----------------------------------------------------------------------
diff --git a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/embedded/EmbeddedJMS.java b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/embedded/EmbeddedJMS.java
index 10962f9..7e235a6 100644
--- a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/embedded/EmbeddedJMS.java
+++ b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/embedded/EmbeddedJMS.java
@@ -55,8 +55,9 @@ public class EmbeddedJMS extends EmbeddedActiveMQ {
     *
     * @param registry
     */
-   public void setRegistry(BindingRegistry registry) {
+   public EmbeddedJMS setRegistry(BindingRegistry registry) {
       this.registry = registry;
+      return this;
    }
 
    /**
@@ -64,8 +65,9 @@ public class EmbeddedJMS extends EmbeddedActiveMQ {
     *
     * @param jmsConfiguration
     */
-   public void setJmsConfiguration(JMSConfiguration jmsConfiguration) {
+   public EmbeddedJMS setJmsConfiguration(JMSConfiguration jmsConfiguration) {
       this.jmsConfiguration = jmsConfiguration;
+      return this;
    }
 
    /**
@@ -73,8 +75,9 @@ public class EmbeddedJMS extends EmbeddedActiveMQ {
     *
     * @param context
     */
-   public void setContext(Context context) {
+   public EmbeddedJMS setContext(Context context) {
       this.context = context;
+      return this;
    }
 
    /**
@@ -89,7 +92,7 @@ public class EmbeddedJMS extends EmbeddedActiveMQ {
    }
 
    @Override
-   public void start() throws Exception {
+   public EmbeddedJMS start() throws Exception {
       super.initStart();
       if (jmsConfiguration != null) {
          serverManager = new JMSServerManagerImpl(activeMQServer, jmsConfiguration);
@@ -116,11 +119,14 @@ public class EmbeddedJMS extends EmbeddedActiveMQ {
       }
       serverManager.setRegistry(registry);
       serverManager.start();
+
+      return this;
    }
 
    @Override
-   public void stop() throws Exception {
+   public EmbeddedJMS stop() throws Exception {
       serverManager.stop();
+      return this;
    }
 
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3f23c991/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/ClusterConnectionConfiguration.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/ClusterConnectionConfiguration.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/ClusterConnectionConfiguration.java
index d125611..f3f2b25 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/ClusterConnectionConfiguration.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/ClusterConnectionConfiguration.java
@@ -16,21 +16,29 @@
  */
 package org.apache.activemq.artemis.core.config;
 
-import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration;
-import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
-import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType;
-
 import java.io.Serializable;
+import java.net.URI;
 import java.util.Collections;
+import java.util.LinkedList;
 import java.util.List;
 
+import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration;
+import org.apache.activemq.artemis.api.core.DiscoveryGroupConfiguration;
+import org.apache.activemq.artemis.api.core.TransportConfiguration;
+import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
+import org.apache.activemq.artemis.core.server.ActiveMQServerLogger;
+import org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType;
+import org.apache.activemq.artemis.uri.ClusterConnectionConfigurationParser;
+import org.apache.activemq.artemis.uri.ConnectorTransportConfigurationParser;
+import org.apache.activemq.artemis.utils.uri.URISupport;
+
 public final class ClusterConnectionConfiguration implements Serializable {
 
    private static final long serialVersionUID = 8948303813427795935L;
 
    private String name;
 
-   private String address;
+   private String address = ActiveMQDefaultConfiguration.getDefaultClusterAddress();
 
    private String connectorName;
 
@@ -56,6 +64,8 @@ public final class ClusterConnectionConfiguration implements Serializable {
 
    private MessageLoadBalancingType messageLoadBalancingType = Enum.valueOf(MessageLoadBalancingType.class, ActiveMQDefaultConfiguration.getDefaultClusterMessageLoadBalancingType());
 
+   private URISupport.CompositeData compositeMembers;
+
    private List<String> staticConnectors = Collections.emptyList();
 
    private String discoveryGroupName = null;
@@ -75,6 +85,11 @@ public final class ClusterConnectionConfiguration implements Serializable {
    public ClusterConnectionConfiguration() {
    }
 
+   public ClusterConnectionConfiguration(URI uri) throws Exception {
+      ClusterConnectionConfigurationParser parser = new ClusterConnectionConfigurationParser();
+      parser.populateObject(uri, this);
+   }
+
    public String getName() {
       return name;
    }
@@ -93,6 +108,15 @@ public final class ClusterConnectionConfiguration implements Serializable {
       return this;
    }
 
+   public ClusterConnectionConfiguration setCompositeMembers(URISupport.CompositeData members) {
+      this.compositeMembers = members;
+      return this;
+   }
+
+   public URISupport.CompositeData getCompositeMembers() {
+      return compositeMembers;
+   }
+
    /**
     * @return the clientFailureCheckPeriod
     */
@@ -334,6 +358,72 @@ public final class ClusterConnectionConfiguration implements Serializable {
       return this;
    }
 
+   /**
+    * This method will match the configuration and return the proper TransportConfiguration for the Configuration
+    */
+   public TransportConfiguration[] getTransportConfigurations(Configuration configuration) throws Exception {
+
+      if (getCompositeMembers() != null) {
+         ConnectorTransportConfigurationParser connectorTransportConfigurationParser = new ConnectorTransportConfigurationParser();
+
+         URI[] members = getCompositeMembers().getComponents();
+
+         List<TransportConfiguration> list = new LinkedList<>();
+
+         for (int i = 0; i < members.length; i++) {
+            list.addAll(connectorTransportConfigurationParser.newObject(members[i], null));
+         }
+
+         return list.toArray(new TransportConfiguration[list.size()]);
+      }
+      else {
+         return configuration.getTransportConfigurations(staticConnectors);
+      }
+   }
+
+   /**
+    * This method will return the proper discovery configuration from the main configuration
+    */
+   public DiscoveryGroupConfiguration getDiscoveryGroupConfiguration(Configuration configuration) {
+      if (discoveryGroupName != null) {
+         DiscoveryGroupConfiguration dg = configuration.getDiscoveryGroupConfigurations().get(discoveryGroupName);
+
+         if (dg == null) {
+            ActiveMQServerLogger.LOGGER.clusterConnectionNoDiscoveryGroup(discoveryGroupName);
+            return null;
+         }
+         return dg;
+      }
+      else {
+         return null;
+      }
+   }
+
+   public TransportConfiguration getTransportConfiguration(Configuration configuration) {
+      TransportConfiguration connector = configuration.getConnectorConfigurations().get(getConnectorName());
+
+      if (connector == null) {
+         ActiveMQServerLogger.LOGGER.clusterConnectionNoConnector(connectorName);
+         return null;
+      }
+      return connector;
+   }
+
+   public boolean validateConfiguration() {
+      if (getName() == null) {
+         ActiveMQServerLogger.LOGGER.clusterConnectionNotUnique();
+         return false;
+      }
+
+      if (getAddress() == null) {
+         ActiveMQServerLogger.LOGGER.clusterConnectionNoForwardAddress();
+
+         return false;
+      }
+
+      return true;
+   }
+
    @Override
    public int hashCode() {
       final int prime = 31;
@@ -440,4 +530,33 @@ public final class ClusterConnectionConfiguration implements Serializable {
          return false;
       return true;
    }
+
+   @Override
+   public String toString() {
+      return "ClusterConnectionConfiguration{" +
+         "name='" + name + '\'' +
+         ", address='" + address + '\'' +
+         ", connectorName='" + connectorName + '\'' +
+         ", clientFailureCheckPeriod=" + clientFailureCheckPeriod +
+         ", connectionTTL=" + connectionTTL +
+         ", retryInterval=" + retryInterval +
+         ", retryIntervalMultiplier=" + retryIntervalMultiplier +
+         ", maxRetryInterval=" + maxRetryInterval +
+         ", initialConnectAttempts=" + initialConnectAttempts +
+         ", reconnectAttempts=" + reconnectAttempts +
+         ", callTimeout=" + callTimeout +
+         ", callFailoverTimeout=" + callFailoverTimeout +
+         ", duplicateDetection=" + duplicateDetection +
+         ", messageLoadBalancingType=" + messageLoadBalancingType +
+         ", compositeMembers=" + compositeMembers +
+         ", staticConnectors=" + staticConnectors +
+         ", discoveryGroupName='" + discoveryGroupName + '\'' +
+         ", maxHops=" + maxHops +
+         ", confirmationWindowSize=" + confirmationWindowSize +
+         ", allowDirectConnectionsOnly=" + allowDirectConnectionsOnly +
+         ", minLargeMessageSize=" + minLargeMessageSize +
+         ", clusterNotificationInterval=" + clusterNotificationInterval +
+         ", clusterNotificationAttempts=" + clusterNotificationAttempts +
+         '}';
+   }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3f23c991/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/Configuration.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/Configuration.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/Configuration.java
index e493769..d52f53f 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/Configuration.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/Configuration.java
@@ -369,6 +369,8 @@ public interface Configuration {
 
    Configuration addClusterConfiguration(final ClusterConnectionConfiguration config);
 
+   ClusterConnectionConfiguration addClusterConfiguration(String name, String uri) throws Exception;
+
    Configuration clearClusterConfigurations();
 
    /**
@@ -911,6 +913,10 @@ public interface Configuration {
    * */
    Configuration setResolveProtocols(boolean resolveProtocols);
 
+   TransportConfiguration[] getTransportConfigurations(String ...connectorNames);
+
+   TransportConfiguration[] getTransportConfigurations(List<String> connectorNames);
+
    /*
    * @see #setResolveProtocols()
    * @return whether ActiveMQ Artemis should resolve and use any Protocols available on the classpath

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3f23c991/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImpl.java
index 0a6582f..a90374e 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImpl.java
@@ -22,9 +22,12 @@ import java.io.File;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.io.Serializable;
+import java.lang.reflect.Array;
+import java.net.URI;
 import java.security.AccessController;
 import java.security.PrivilegedExceptionAction;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.LinkedHashMap;
@@ -48,6 +51,7 @@ import org.apache.activemq.artemis.core.config.StoreConfiguration;
 import org.apache.activemq.artemis.core.config.ha.ReplicaPolicyConfiguration;
 import org.apache.activemq.artemis.core.config.ha.ReplicatedPolicyConfiguration;
 import org.apache.activemq.artemis.core.security.Role;
+import org.apache.activemq.artemis.core.server.ActiveMQServerLogger;
 import org.apache.activemq.artemis.core.server.JournalType;
 import org.apache.activemq.artemis.core.server.SecuritySettingPlugin;
 import org.apache.activemq.artemis.core.server.group.impl.GroupingHandlerConfiguration;
@@ -90,7 +94,7 @@ public class ConfigurationImpl implements Configuration, Serializable {
 
    protected String jmxDomain = ActiveMQDefaultConfiguration.getDefaultJmxDomain();
 
-   protected boolean jmxUseBrokerName =  ActiveMQDefaultConfiguration.isDefaultJMXUseBrokerName();
+   protected boolean jmxUseBrokerName = ActiveMQDefaultConfiguration.isDefaultJMXUseBrokerName();
 
    protected long connectionTTLOverride = ActiveMQDefaultConfiguration.getDefaultConnectionTtlOverride();
 
@@ -491,6 +495,12 @@ public class ConfigurationImpl implements Configuration, Serializable {
       return this;
    }
 
+   public ClusterConnectionConfiguration addClusterConfiguration(String name, String uri) throws Exception {
+      ClusterConnectionConfiguration newConfig = new ClusterConnectionConfiguration(new URI(uri)).setName(name);
+      clusterConfigurations.add(newConfig);
+      return newConfig;
+   }
+
    @Override
    public ConfigurationImpl clearClusterConfigurations() {
       clusterConfigurations.clear();
@@ -685,7 +695,6 @@ public class ConfigurationImpl implements Configuration, Serializable {
       return this;
    }
 
-
    @Override
    public int getJournalMinFiles() {
       return journalMinFiles;
@@ -1280,6 +1289,28 @@ public class ConfigurationImpl implements Configuration, Serializable {
       return this;
    }
 
+   public TransportConfiguration[] getTransportConfigurations(String... connectorNames) {
+      return getTransportConfigurations(Arrays.asList(connectorNames));
+   }
+
+   public TransportConfiguration[] getTransportConfigurations(final List<String> connectorNames) {
+      TransportConfiguration[] tcConfigs = (TransportConfiguration[]) Array.newInstance(TransportConfiguration.class, connectorNames.size());
+      int count = 0;
+      for (String connectorName : connectorNames) {
+         TransportConfiguration connector = getConnectorConfigurations().get(connectorName);
+
+         if (connector == null) {
+            ActiveMQServerLogger.LOGGER.warn("bridgeNoConnector(connectorName)");
+
+            return null;
+         }
+
+         tcConfigs[count++] = connector;
+      }
+
+      return tcConfigs;
+   }
+
    @Override
    public boolean isResolveProtocols() {
       return resolveProtocols;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3f23c991/artemis-server/src/main/java/org/apache/activemq/artemis/core/deployers/impl/FileConfigurationParser.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/deployers/impl/FileConfigurationParser.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/deployers/impl/FileConfigurationParser.java
index e34207e..793abd2 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/deployers/impl/FileConfigurationParser.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/deployers/impl/FileConfigurationParser.java
@@ -409,6 +409,14 @@ public final class FileConfigurationParser extends XMLConfigurationUtil {
          parseClusterConnectionConfiguration(ccNode, config);
       }
 
+      NodeList ccNodesURI = e.getElementsByTagName("cluster-connection-uri");
+
+      for (int i = 0; i < ccNodesURI.getLength(); i++) {
+         Element ccNode = (Element) ccNodesURI.item(i);
+
+         parseClusterConnectionConfigurationURI(ccNode, config);
+      }
+
       NodeList dvNodes = e.getElementsByTagName("divert");
 
       for (int i = 0; i < dvNodes.getLength(); i++) {
@@ -1236,7 +1244,18 @@ public final class FileConfigurationParser extends XMLConfigurationUtil {
       }
    }
 
-   private void parseClusterConnectionConfiguration(final Element e, final Configuration mainConfig) {
+   private void parseClusterConnectionConfigurationURI(final Element e, final Configuration mainConfig) throws Exception {
+      String name = e.getAttribute("name");
+
+
+      String uri = e.getAttribute("address");
+
+      ClusterConnectionConfiguration config = mainConfig.addClusterConfiguration(name, uri);
+
+      System.out.println("Adding cluster connection :: " + config);
+   }
+
+   private void parseClusterConnectionConfiguration(final Element e, final Configuration mainConfig) throws Exception {
       String name = e.getAttribute("name");
 
       String address = getString(e, "address", null, Validators.NOT_NULL_OR_EMPTY);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3f23c991/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServerLogger.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServerLogger.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServerLogger.java
index 5b7c39a..c0dfde3 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServerLogger.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServerLogger.java
@@ -869,7 +869,7 @@ public interface ActiveMQServerLogger extends BasicLogger {
    @LogMessage(level = Logger.Level.WARN)
    @Message(id = 222134, value = "No connector defined with name {0}. The bridge will not be deployed.",
       format = Message.Format.MESSAGE_FORMAT)
-   void bridgeNoConnector(String name);
+   void noConnector(String name);
 
    @LogMessage(level = Logger.Level.WARN)
    @Message(id = 222135, value = "Stopping Redistributor, Timed out waiting for tasks to complete", format = Message.Format.MESSAGE_FORMAT)

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3f23c991/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/BackupManager.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/BackupManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/BackupManager.java
index 81a3184..cbb4141 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/BackupManager.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/BackupManager.java
@@ -73,7 +73,7 @@ public class BackupManager implements ActiveMQComponent {
    * configuration, informing the cluster manager so that it can add it to its topology and announce itself to the cluster.
    * */
    @Override
-   public synchronized void start() {
+   public synchronized void start() throws Exception {
       if (started)
          return;
       //deploy the backup connectors using the cluster configuration
@@ -117,14 +117,18 @@ public class BackupManager implements ActiveMQComponent {
    /*
    * create the connectors using the cluster configurations
    * */
-   private void deployBackupConnector(final ClusterConnectionConfiguration config) {
-      TransportConfiguration connector = ClusterConfigurationUtil.getTransportConfiguration(config, configuration);
+   private void deployBackupConnector(final ClusterConnectionConfiguration config) throws Exception {
+      if (!config.validateConfiguration()) {
+         return;
+      }
+
+      TransportConfiguration connector = config.getTransportConfiguration(configuration);
 
       if (connector == null)
          return;
 
       if (config.getDiscoveryGroupName() != null) {
-         DiscoveryGroupConfiguration dg = ClusterConfigurationUtil.getDiscoveryGroupConfiguration(config, configuration);
+         DiscoveryGroupConfiguration dg = config.getDiscoveryGroupConfiguration(configuration);
 
          if (dg == null)
             return;
@@ -134,7 +138,7 @@ public class BackupManager implements ActiveMQComponent {
          backupConnectors.add(backupConnector);
       }
       else {
-         TransportConfiguration[] tcConfigs = ClusterConfigurationUtil.getTransportConfigurations(config, configuration);
+         TransportConfiguration[] tcConfigs = config.getTransportConfigurations(configuration);
 
          StaticBackupConnector backupConnector = new StaticBackupConnector(tcConfigs, config.getName(), connector, config.getRetryInterval(), clusterManager);
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3f23c991/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ClusterConfigurationUtil.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ClusterConfigurationUtil.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ClusterConfigurationUtil.java
deleted file mode 100644
index 0d6b761..0000000
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ClusterConfigurationUtil.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * 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.activemq.artemis.core.server.cluster;
-
-import org.apache.activemq.artemis.api.core.DiscoveryGroupConfiguration;
-import org.apache.activemq.artemis.api.core.TransportConfiguration;
-import org.apache.activemq.artemis.core.config.ClusterConnectionConfiguration;
-import org.apache.activemq.artemis.core.config.Configuration;
-import org.apache.activemq.artemis.core.server.ActiveMQServerLogger;
-
-import java.lang.reflect.Array;
-import java.util.List;
-
-public class ClusterConfigurationUtil {
-
-   public static TransportConfiguration getTransportConfiguration(ClusterConnectionConfiguration config,
-                                                                  Configuration configuration) {
-      if (config.getName() == null) {
-         ActiveMQServerLogger.LOGGER.clusterConnectionNotUnique();
-
-         return null;
-      }
-
-      if (config.getAddress() == null) {
-         ActiveMQServerLogger.LOGGER.clusterConnectionNoForwardAddress();
-
-         return null;
-      }
-
-      TransportConfiguration connector = configuration.getConnectorConfigurations().get(config.getConnectorName());
-
-      if (connector == null) {
-         ActiveMQServerLogger.LOGGER.clusterConnectionNoConnector(config.getConnectorName());
-         return null;
-      }
-      return connector;
-   }
-
-   public static DiscoveryGroupConfiguration getDiscoveryGroupConfiguration(ClusterConnectionConfiguration config,
-                                                                            Configuration configuration) {
-      DiscoveryGroupConfiguration dg = configuration.getDiscoveryGroupConfigurations().get(config.getDiscoveryGroupName());
-
-      if (dg == null) {
-         ActiveMQServerLogger.LOGGER.clusterConnectionNoDiscoveryGroup(config.getDiscoveryGroupName());
-         return null;
-      }
-      return dg;
-   }
-
-   public static TransportConfiguration[] getTransportConfigurations(ClusterConnectionConfiguration config,
-                                                                     Configuration configuration) {
-      return config.getStaticConnectors() != null ? connectorNameListToArray(config.getStaticConnectors(), configuration) : null;
-   }
-
-   public static TransportConfiguration[] connectorNameListToArray(final List<String> connectorNames,
-                                                                   Configuration configuration) {
-      TransportConfiguration[] tcConfigs = (TransportConfiguration[]) Array.newInstance(TransportConfiguration.class, connectorNames.size());
-      int count = 0;
-      for (String connectorName : connectorNames) {
-         TransportConfiguration connector = configuration.getConnectorConfigurations().get(connectorName);
-
-         if (connector == null) {
-            ActiveMQServerLogger.LOGGER.bridgeNoConnector(connectorName);
-
-            return null;
-         }
-
-         tcConfigs[count++] = connector;
-      }
-
-      return tcConfigs;
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3f23c991/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ClusterManager.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ClusterManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ClusterManager.java
index 9bb449a..a85e070 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ClusterManager.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ClusterManager.java
@@ -16,6 +16,18 @@
  */
 package org.apache.activemq.artemis.core.server.cluster;
 
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.Executor;
+import java.util.concurrent.ScheduledExecutorService;
+
 import org.apache.activemq.artemis.api.core.ActiveMQException;
 import org.apache.activemq.artemis.api.core.ActiveMQExceptionType;
 import org.apache.activemq.artemis.api.core.BroadcastGroupConfiguration;
@@ -54,18 +66,6 @@ import org.apache.activemq.artemis.utils.ConcurrentHashSet;
 import org.apache.activemq.artemis.utils.ExecutorFactory;
 import org.apache.activemq.artemis.utils.FutureLatch;
 
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.Executor;
-import java.util.concurrent.ScheduledExecutorService;
-
 /**
  * A ClusterManager manages {@link ClusterConnection}s, {@link BroadcastGroup}s and {@link Bridge}s.
  * <p>
@@ -432,7 +432,7 @@ public final class ClusterManager implements ActiveMQComponent {
 
       }
       else {
-         TransportConfiguration[] tcConfigs = ClusterConfigurationUtil.connectorNameListToArray(config.getStaticConnectors(), configuration);
+         TransportConfiguration[] tcConfigs = configuration.getTransportConfigurations(config.getStaticConnectors());
 
          if (tcConfigs == null) {
             ActiveMQServerLogger.LOGGER.bridgeCantFindConnectors(config.getName());
@@ -581,10 +581,16 @@ public final class ClusterManager implements ActiveMQComponent {
    }
 
    private void deployClusterConnection(final ClusterConnectionConfiguration config) throws Exception {
-      TransportConfiguration connector = ClusterConfigurationUtil.getTransportConfiguration(config, configuration);
 
-      if (connector == null)
+      if (!config.validateConfiguration()) {
          return;
+      }
+
+      TransportConfiguration connector = config.getTransportConfiguration(configuration);
+
+      if (connector == null) {
+         return;
+      }
 
       if (clusterConnections.containsKey(config.getName())) {
          ActiveMQServerLogger.LOGGER.clusterConnectionAlreadyExists(config.getConnectorName());
@@ -594,7 +600,7 @@ public final class ClusterManager implements ActiveMQComponent {
       ClusterConnectionImpl clusterConnection;
 
       if (config.getDiscoveryGroupName() != null) {
-         DiscoveryGroupConfiguration dg = ClusterConfigurationUtil.getDiscoveryGroupConfiguration(config, configuration);
+         DiscoveryGroupConfiguration dg = config.getDiscoveryGroupConfiguration(configuration);
 
          if (dg == null)
             return;
@@ -611,7 +617,7 @@ public final class ClusterManager implements ActiveMQComponent {
          clusterController.addClusterConnection(clusterConnection.getName(), dg, config);
       }
       else {
-         TransportConfiguration[] tcConfigs = ClusterConfigurationUtil.getTransportConfigurations(config, configuration);
+         TransportConfiguration[] tcConfigs = config.getTransportConfigurations(configuration);
 
          if (ActiveMQServerLogger.LOGGER.isDebugEnabled()) {
             ActiveMQServerLogger.LOGGER.debug(this + " defining cluster connection towards " + Arrays.toString(tcConfigs));

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3f23c991/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ha/ScaleDownPolicy.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ha/ScaleDownPolicy.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ha/ScaleDownPolicy.java
index 17777d4..1fcbd4d 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ha/ScaleDownPolicy.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ha/ScaleDownPolicy.java
@@ -16,6 +16,10 @@
  */
 package org.apache.activemq.artemis.core.server.cluster.ha;
 
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
 import org.apache.activemq.artemis.api.core.ActiveMQException;
 import org.apache.activemq.artemis.api.core.DiscoveryGroupConfiguration;
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
@@ -24,12 +28,6 @@ import org.apache.activemq.artemis.core.client.impl.ServerLocatorInternal;
 import org.apache.activemq.artemis.core.remoting.impl.invm.InVMConnectorFactory;
 import org.apache.activemq.artemis.core.server.ActiveMQMessageBundle;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
-import org.apache.activemq.artemis.core.server.ActiveMQServerLogger;
-
-import java.lang.reflect.Array;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
 
 public class ScaleDownPolicy {
 
@@ -126,20 +124,6 @@ public class ScaleDownPolicy {
 
    private static TransportConfiguration[] connectorNameListToArray(final List<String> connectorNames,
                                                                     ActiveMQServer activeMQServer) {
-      TransportConfiguration[] tcConfigs = (TransportConfiguration[]) Array.newInstance(TransportConfiguration.class, connectorNames.size());
-      int count = 0;
-      for (String connectorName : connectorNames) {
-         TransportConfiguration connector = activeMQServer.getConfiguration().getConnectorConfigurations().get(connectorName);
-
-         if (connector == null) {
-            ActiveMQServerLogger.LOGGER.bridgeNoConnector(connectorName);
-
-            return null;
-         }
-
-         tcConfigs[count++] = connector;
-      }
-
-      return tcConfigs;
+      return activeMQServer.getConfiguration().getTransportConfigurations(connectorNames);
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3f23c991/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/MessageLoadBalancingType.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/MessageLoadBalancingType.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/MessageLoadBalancingType.java
index 9c578cf..d9a8688 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/MessageLoadBalancingType.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/MessageLoadBalancingType.java
@@ -16,9 +16,25 @@
  */
 package org.apache.activemq.artemis.core.server.cluster.impl;
 
+import org.apache.activemq.artemis.utils.uri.URISchema;
+import org.apache.commons.beanutils.Converter;
+
 public enum MessageLoadBalancingType {
    OFF("OFF"), STRICT("STRICT"), ON_DEMAND("ON_DEMAND");
 
+   static {
+      // for URI support on ClusterConnection
+      URISchema.registerConverter(new MessageLoadBalancingTypeConverter(), MessageLoadBalancingType.class);
+   }
+
+   static class MessageLoadBalancingTypeConverter implements Converter {
+
+      @Override
+      public <T> T convert(Class<T> type, Object value) {
+         return type.cast(MessageLoadBalancingType.getType(value.toString()));
+      }
+   }
+
    private String type;
 
    MessageLoadBalancingType(final String type) {
@@ -28,4 +44,19 @@ public enum MessageLoadBalancingType {
    public String getType() {
       return type;
    }
+
+   public static MessageLoadBalancingType getType(String string) {
+      if (string.equals(OFF.getType())) {
+         return MessageLoadBalancingType.OFF;
+      }
+      else if (string.equals(STRICT.getType())) {
+         return MessageLoadBalancingType.STRICT;
+      }
+      else if (string.equals(ON_DEMAND.getType())) {
+         return MessageLoadBalancingType.ON_DEMAND;
+      }
+      else {
+         return null;
+      }
+   }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3f23c991/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/embedded/EmbeddedActiveMQ.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/embedded/EmbeddedActiveMQ.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/embedded/EmbeddedActiveMQ.java
index fc77bdc..ef384e0 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/embedded/EmbeddedActiveMQ.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/embedded/EmbeddedActiveMQ.java
@@ -18,10 +18,13 @@ package org.apache.activemq.artemis.core.server.embedded;
 
 import javax.management.MBeanServer;
 
+import java.util.concurrent.TimeUnit;
+
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.config.FileDeploymentManager;
 import org.apache.activemq.artemis.core.config.impl.FileConfiguration;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
+import org.apache.activemq.artemis.core.server.cluster.ClusterConnection;
 import org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl;
 import org.apache.activemq.artemis.spi.core.security.ActiveMQJAASSecurityManager;
 import org.apache.activemq.artemis.spi.core.security.ActiveMQSecurityManager;
@@ -42,8 +45,9 @@ public class EmbeddedActiveMQ {
     *
     * @param filename
     */
-   public void setConfigResourcePath(String filename) {
+   public EmbeddedActiveMQ setConfigResourcePath(String filename) {
       configResourcePath = filename;
+      return this;
    }
 
    /**
@@ -51,8 +55,30 @@ public class EmbeddedActiveMQ {
     *
     * @param securityManager
     */
-   public void setSecurityManager(ActiveMQSecurityManager securityManager) {
+   public EmbeddedActiveMQ setSecurityManager(ActiveMQSecurityManager securityManager) {
       this.securityManager = securityManager;
+      return this;
+   }
+
+   /**
+    * It will iterate the cluster connections until you have at least the number of expected servers
+    * @param timeWait Time to wait on each iteration
+    * @param unit unit of time to wait
+    * @param iterations number of iterations
+    * @param servers number of minimal servers
+    * @return
+    */
+   public boolean waitClusterForming(long timeWait, TimeUnit unit, int iterations, int servers) throws Exception {
+      for (int i = 0; i < iterations; i++) {
+         for (ClusterConnection connection : activeMQServer.getClusterManager().getClusterConnections()) {
+            if (connection.getTopology().getMembers().size() == servers) {
+               return true;
+            }
+            Thread.sleep(unit.toMillis(timeWait));
+         }
+      }
+
+      return false;
    }
 
    /**
@@ -60,8 +86,9 @@ public class EmbeddedActiveMQ {
     *
     * @param mbeanServer
     */
-   public void setMbeanServer(MBeanServer mbeanServer) {
+   public EmbeddedActiveMQ setMbeanServer(MBeanServer mbeanServer) {
       this.mbeanServer = mbeanServer;
+      return this;
    }
 
    /**
@@ -70,18 +97,19 @@ public class EmbeddedActiveMQ {
     *
     * @param configuration
     */
-   public void setConfiguration(Configuration configuration) {
+   public EmbeddedActiveMQ setConfiguration(Configuration configuration) {
       this.configuration = configuration;
+      return this;
    }
 
    public ActiveMQServer getActiveMQServer() {
       return activeMQServer;
    }
 
-   public void start() throws Exception {
+   public EmbeddedActiveMQ start() throws Exception {
       initStart();
       activeMQServer.start();
-
+      return this;
    }
 
    protected void initStart() throws Exception {
@@ -105,7 +133,8 @@ public class EmbeddedActiveMQ {
       }
    }
 
-   public void stop() throws Exception {
+   public EmbeddedActiveMQ stop() throws Exception {
       activeMQServer.stop();
+      return this;
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3f23c991/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedNothingLiveActivation.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedNothingLiveActivation.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedNothingLiveActivation.java
index 8803e22..299df00 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedNothingLiveActivation.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedNothingLiveActivation.java
@@ -49,7 +49,6 @@ import org.apache.activemq.artemis.core.server.cluster.ClusterConnection;
 import org.apache.activemq.artemis.core.server.cluster.ha.ReplicatedPolicy;
 import org.apache.activemq.artemis.spi.core.remoting.Acceptor;
 
-import java.lang.reflect.Array;
 import java.util.List;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
@@ -392,20 +391,6 @@ public class SharedNothingLiveActivation extends LiveActivation {
    }
 
    private TransportConfiguration[] connectorNameListToArray(final List<String> connectorNames) {
-      TransportConfiguration[] tcConfigs = (TransportConfiguration[]) Array.newInstance(TransportConfiguration.class, connectorNames.size());
-      int count = 0;
-      for (String connectorName : connectorNames) {
-         TransportConfiguration connector = activeMQServer.getConfiguration().getConnectorConfigurations().get(connectorName);
-
-         if (connector == null) {
-            ActiveMQServerLogger.LOGGER.bridgeNoConnector(connectorName);
-
-            return null;
-         }
-
-         tcConfigs[count++] = connector;
-      }
-
-      return tcConfigs;
+      return activeMQServer.getConfiguration().getTransportConfigurations(connectorNames);
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3f23c991/artemis-server/src/main/java/org/apache/activemq/artemis/uri/AcceptorTransportConfigurationParser.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/uri/AcceptorTransportConfigurationParser.java b/artemis-server/src/main/java/org/apache/activemq/artemis/uri/AcceptorTransportConfigurationParser.java
index e8f7dce..42300e4 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/uri/AcceptorTransportConfigurationParser.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/uri/AcceptorTransportConfigurationParser.java
@@ -16,12 +16,14 @@
  */
 package org.apache.activemq.artemis.uri;
 
+import java.util.List;
+
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
 import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants;
+import org.apache.activemq.artemis.uri.schemas.acceptor.InVMAcceptorTransportConfigurationSchema;
+import org.apache.activemq.artemis.uri.schemas.acceptor.TCPAcceptorTransportConfigurationSchema;
 import org.apache.activemq.artemis.utils.uri.URIFactory;
 
-import java.util.List;
-
 public class AcceptorTransportConfigurationParser extends URIFactory<List<TransportConfiguration>, String> {
 
    public AcceptorTransportConfigurationParser() {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3f23c991/artemis-server/src/main/java/org/apache/activemq/artemis/uri/ClusterConnectionConfigurationParser.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/uri/ClusterConnectionConfigurationParser.java b/artemis-server/src/main/java/org/apache/activemq/artemis/uri/ClusterConnectionConfigurationParser.java
new file mode 100644
index 0000000..e6637de
--- /dev/null
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/uri/ClusterConnectionConfigurationParser.java
@@ -0,0 +1,31 @@
+/**
+ * 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.activemq.artemis.uri;
+
+import org.apache.activemq.artemis.core.config.ClusterConnectionConfiguration;
+import org.apache.activemq.artemis.uri.schemas.clusterConnection.ClusterConnectionMulticastSchema;
+import org.apache.activemq.artemis.uri.schemas.clusterConnection.ClusterConnectionStaticSchema;
+import org.apache.activemq.artemis.utils.uri.URIFactory;
+
+public class ClusterConnectionConfigurationParser extends URIFactory<ClusterConnectionConfiguration, String> {
+
+   public ClusterConnectionConfigurationParser() {
+      registerSchema(new ClusterConnectionStaticSchema());
+      registerSchema(new ClusterConnectionMulticastSchema());
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3f23c991/artemis-server/src/main/java/org/apache/activemq/artemis/uri/InVMAcceptorTransportConfigurationSchema.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/uri/InVMAcceptorTransportConfigurationSchema.java b/artemis-server/src/main/java/org/apache/activemq/artemis/uri/InVMAcceptorTransportConfigurationSchema.java
deleted file mode 100644
index 72ec88e..0000000
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/uri/InVMAcceptorTransportConfigurationSchema.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * 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.activemq.artemis.uri;
-
-import org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory;
-
-public class InVMAcceptorTransportConfigurationSchema extends InVMTransportConfigurationSchema {
-
-   @Override
-   protected String getFactoryName() {
-      return InVMAcceptorFactory.class.getName();
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3f23c991/artemis-server/src/main/java/org/apache/activemq/artemis/uri/TCPAcceptorTransportConfigurationSchema.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/uri/TCPAcceptorTransportConfigurationSchema.java b/artemis-server/src/main/java/org/apache/activemq/artemis/uri/TCPAcceptorTransportConfigurationSchema.java
deleted file mode 100644
index ecd5ea4..0000000
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/uri/TCPAcceptorTransportConfigurationSchema.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * 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.activemq.artemis.uri;
-
-import org.apache.activemq.artemis.core.remoting.impl.netty.NettyAcceptorFactory;
-
-import java.net.URI;
-import java.util.Set;
-
-public class TCPAcceptorTransportConfigurationSchema extends TCPTransportConfigurationSchema {
-
-   public TCPAcceptorTransportConfigurationSchema(Set<String> allowableProperties) {
-      super(allowableProperties);
-   }
-
-   @Override
-   public String getFactoryName(URI uri) {
-      return NettyAcceptorFactory.class.getName();
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3f23c991/artemis-server/src/main/java/org/apache/activemq/artemis/uri/schemas/acceptor/InVMAcceptorTransportConfigurationSchema.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/uri/schemas/acceptor/InVMAcceptorTransportConfigurationSchema.java b/artemis-server/src/main/java/org/apache/activemq/artemis/uri/schemas/acceptor/InVMAcceptorTransportConfigurationSchema.java
new file mode 100644
index 0000000..3391f66
--- /dev/null
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/uri/schemas/acceptor/InVMAcceptorTransportConfigurationSchema.java
@@ -0,0 +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.activemq.artemis.uri.schemas.acceptor;
+
+import org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory;
+import org.apache.activemq.artemis.uri.schema.connector.InVMTransportConfigurationSchema;
+
+public class InVMAcceptorTransportConfigurationSchema extends InVMTransportConfigurationSchema {
+
+   @Override
+   protected String getFactoryName() {
+      return InVMAcceptorFactory.class.getName();
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3f23c991/artemis-server/src/main/java/org/apache/activemq/artemis/uri/schemas/acceptor/TCPAcceptorTransportConfigurationSchema.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/uri/schemas/acceptor/TCPAcceptorTransportConfigurationSchema.java b/artemis-server/src/main/java/org/apache/activemq/artemis/uri/schemas/acceptor/TCPAcceptorTransportConfigurationSchema.java
new file mode 100644
index 0000000..ed92ac3
--- /dev/null
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/uri/schemas/acceptor/TCPAcceptorTransportConfigurationSchema.java
@@ -0,0 +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.activemq.artemis.uri.schemas.acceptor;
+
+import org.apache.activemq.artemis.core.remoting.impl.netty.NettyAcceptorFactory;
+import org.apache.activemq.artemis.uri.schema.connector.TCPTransportConfigurationSchema;
+
+import java.net.URI;
+import java.util.Set;
+
+public class TCPAcceptorTransportConfigurationSchema extends TCPTransportConfigurationSchema {
+
+   public TCPAcceptorTransportConfigurationSchema(Set<String> allowableProperties) {
+      super(allowableProperties);
+   }
+
+   @Override
+   public String getFactoryName(URI uri) {
+      return NettyAcceptorFactory.class.getName();
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3f23c991/artemis-server/src/main/java/org/apache/activemq/artemis/uri/schemas/clusterConnection/ClusterConnectionMulticastSchema.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/uri/schemas/clusterConnection/ClusterConnectionMulticastSchema.java b/artemis-server/src/main/java/org/apache/activemq/artemis/uri/schemas/clusterConnection/ClusterConnectionMulticastSchema.java
new file mode 100644
index 0000000..f776924
--- /dev/null
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/uri/schemas/clusterConnection/ClusterConnectionMulticastSchema.java
@@ -0,0 +1,48 @@
+/**
+ * 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.activemq.artemis.uri.schemas.clusterConnection;
+
+import java.net.URI;
+import java.util.Map;
+
+import org.apache.activemq.artemis.core.config.ClusterConnectionConfiguration;
+import org.apache.activemq.artemis.utils.uri.URISupport;
+
+public class ClusterConnectionMulticastSchema extends ClusterConnectionStaticSchema {
+
+   // nothing different ATM. This is like a placeholder for future changes
+   @Override
+   public String getSchemaName() {
+      return "multicast";
+   }
+
+   @Override
+   public void populateObject(URI uri, ClusterConnectionConfiguration bean) throws Exception {
+
+      if (URISupport.isCompositeURI(uri)) {
+         super.populateObject(uri, bean);
+      }
+      else {
+         bean.setDiscoveryGroupName(uri.getHost());
+         Map<String, String> parameters = URISupport.parseParameters(uri);
+         setData(uri, bean, parameters);
+
+      }
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3f23c991/artemis-server/src/main/java/org/apache/activemq/artemis/uri/schemas/clusterConnection/ClusterConnectionStaticSchema.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/uri/schemas/clusterConnection/ClusterConnectionStaticSchema.java b/artemis-server/src/main/java/org/apache/activemq/artemis/uri/schemas/clusterConnection/ClusterConnectionStaticSchema.java
new file mode 100644
index 0000000..f81aa58
--- /dev/null
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/uri/schemas/clusterConnection/ClusterConnectionStaticSchema.java
@@ -0,0 +1,61 @@
+/**
+ * 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.activemq.artemis.uri.schemas.clusterConnection;
+
+import java.net.URI;
+import java.util.Map;
+
+import org.apache.activemq.artemis.core.config.ClusterConnectionConfiguration;
+import org.apache.activemq.artemis.utils.uri.URISchema;
+import org.apache.activemq.artemis.utils.uri.URISupport;
+
+public class ClusterConnectionStaticSchema extends URISchema<ClusterConnectionConfiguration, String> {
+
+   @Override
+   public String getSchemaName() {
+      return "static";
+   }
+
+   @Override
+   protected ClusterConnectionConfiguration internalNewObject(URI uri,
+                                                              Map<String, String> query,
+                                                              String param) throws Exception {
+
+
+      ClusterConnectionConfiguration configuration = new ClusterConnectionConfiguration();
+
+      populateObject(uri, configuration);
+
+      return configuration;
+   }
+
+
+   @Override
+   public void populateObject(URI uri, ClusterConnectionConfiguration bean) throws Exception {
+      URISupport.CompositeData compositeData = URISupport.parseComposite(uri);
+      bean.setCompositeMembers(compositeData);
+
+      setData(uri, bean, compositeData.getParameters());
+   }
+
+
+   @Override
+   protected URI internalNewURI(ClusterConnectionConfiguration bean) throws Exception {
+      return null;
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3f23c991/artemis-server/src/main/resources/schema/artemis-configuration.xsd
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/resources/schema/artemis-configuration.xsd b/artemis-server/src/main/resources/schema/artemis-configuration.xsd
index 8703e7b..2f71454 100644
--- a/artemis-server/src/main/resources/schema/artemis-configuration.xsd
+++ b/artemis-server/src/main/resources/schema/artemis-configuration.xsd
@@ -458,18 +458,12 @@
             </xsd:annotation>
          </xsd:element>
 
-         <xsd:element name="cluster-connections" maxOccurs="1" minOccurs="0">
+         <xsd:element name="cluster-connections" type="clusterConnectionChoiceType" maxOccurs="1" minOccurs="0">
             <xsd:annotation>
                <xsd:documentation>
                   a list of cluster connections
                </xsd:documentation>
             </xsd:annotation>
-            <xsd:complexType>
-               <xsd:sequence>
-                  <xsd:element name="cluster-connection" type="cluster-connectionType" maxOccurs="unbounded"
-                               minOccurs="0"/>
-               </xsd:sequence>
-            </xsd:complexType>
          </xsd:element>
 
          <xsd:element name="grouping-handler" type="groupingHandlerType" maxOccurs="1" minOccurs="0">
@@ -1181,6 +1175,33 @@
 
    <!-- CLUSTER CONNECTION CONFIGURATION -->
 
+   <xsd:complexType name="clusterConnectionChoiceType">
+      <xsd:sequence>
+      <xsd:choice maxOccurs="unbounded">
+         <xsd:element name="cluster-connection-uri" type="cluster-connectionUriType"/>
+         <xsd:element name="cluster-connection" type="cluster-connectionType">
+         </xsd:element>
+      </xsd:choice>
+      </xsd:sequence>
+   </xsd:complexType>
+
+   <xsd:complexType name="cluster-connectionUriType">
+      <xsd:attribute name="address" type="xsd:string" use="required">
+         <xsd:annotation>
+            <xsd:documentation>
+               uri of the cluster connection
+            </xsd:documentation>
+         </xsd:annotation>
+      </xsd:attribute>
+      <xsd:attribute name="name" type="xsd:string" use="required">
+         <xsd:annotation>
+            <xsd:documentation>
+               name of the cluster connection
+            </xsd:documentation>
+         </xsd:annotation>
+      </xsd:attribute>
+   </xsd:complexType>
+
    <xsd:complexType name="cluster-connectionType">
       <xsd:sequence>
          <xsd:element name="address" type="xsd:string" maxOccurs="1" minOccurs="1">
@@ -1388,6 +1409,31 @@
             </xsd:documentation>
          </xsd:annotation>
       </xsd:attribute>
+      <xsd:attribute name="uri" type="xsd:string" use="optional">
+         <xsd:annotation>
+            <xsd:documentation>
+               The URI for the cluster connection options
+            </xsd:documentation>
+         </xsd:annotation>
+      </xsd:attribute>
+   </xsd:complexType>
+
+
+   <xsd:complexType name="cluster-connection-uri-type">
+      <xsd:attribute name="name" type="xsd:ID" use="required">
+         <xsd:annotation>
+            <xsd:documentation>
+               unique name for this cluster connection
+            </xsd:documentation>
+         </xsd:annotation>
+      </xsd:attribute>
+      <xsd:attribute name="uri" type="xsd:string" use="required">
+         <xsd:annotation>
+            <xsd:documentation>
+               The URI for the cluster connection options
+            </xsd:documentation>
+         </xsd:annotation>
+      </xsd:attribute>
    </xsd:complexType>
 
    <!-- DIVERT CONFIGURATION TYPE -->

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3f23c991/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/FileConfigurationParserTest.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/FileConfigurationParserTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/FileConfigurationParserTest.java
index 84441a2..44f1c61 100644
--- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/FileConfigurationParserTest.java
+++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/FileConfigurationParserTest.java
@@ -27,6 +27,7 @@ import org.apache.activemq.artemis.core.config.FileDeploymentManager;
 import org.apache.activemq.artemis.core.deployers.impl.FileConfigurationParser;
 import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.apache.activemq.artemis.utils.DefaultSensitiveStringCodec;
+import org.junit.Assert;
 import org.junit.Test;
 
 public class FileConfigurationParserTest extends ActiveMQTestBase {
@@ -70,6 +71,23 @@ public class FileConfigurationParserTest extends ActiveMQTestBase {
    }
 
    @Test
+   public void testParsingClusterConnectionURIs() throws Exception {
+      FileConfigurationParser parser = new FileConfigurationParser();
+
+      String configStr = firstPart + "<cluster-connections>\n" +
+         "   <cluster-connection-uri name=\"my-cluster\" address=\"multicast://my-discovery-group?messageLoadBalancingType=STRICT;retryInterval=333;connectorName=netty-connector;maxHops=1\"/>\n" +
+         "</cluster-connections>\n" + lastPart;
+      ByteArrayInputStream input = new ByteArrayInputStream(configStr.getBytes(StandardCharsets.UTF_8));
+
+      Configuration config = parser.parseMainConfig(input);
+
+      Assert.assertEquals(1, config.getClusterConfigurations().size());
+
+      Assert.assertEquals("my-discovery-group", config.getClusterConfigurations().get(0).getDiscoveryGroupName());
+      Assert.assertEquals(333, config.getClusterConfigurations().get(0).getRetryInterval());
+   }
+
+   @Test
    public void testParsingDefaultServerConfig() throws Exception {
       FileConfigurationParser parser = new FileConfigurationParser();
 


Mime
View raw message