activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [04/39] activemq-artemis git commit: AcceptorConfig: Refactor out BeanSupport
Date Wed, 17 Feb 2016 02:03:39 GMT
AcceptorConfig: Refactor out BeanSupport


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/15ce38e9
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/15ce38e9
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/15ce38e9

Branch: refs/heads/refactor-openwire
Commit: 15ce38e9df7c9d7a366612948185aa1f5229aca2
Parents: a210d19
Author: Clebert Suconic <clebertsuconic@apache.org>
Authored: Tue Feb 9 18:51:06 2016 -0500
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Tue Feb 16 21:03:12 2016 -0500

----------------------------------------------------------------------
 .../activemq/artemis/utils/uri/BeanSupport.java | 148 +++++++++++++++++++
 .../activemq/artemis/utils/uri/URISchema.java   | 131 ++--------------
 .../activemq/artemis/utils/URIParserTest.java   |   5 +-
 .../api/core/TransportConfiguration.java        |   8 +-
 .../client/impl/ClientSessionFactoryImpl.java   |   6 +-
 .../impl/netty/ActiveMQChannelHandler.java      |   5 +-
 .../remoting/impl/netty/NettyConnection.java    |   5 +-
 .../remoting/impl/netty/NettyConnector.java     |  16 +-
 .../impl/netty/NettyConnectorFactory.java       |   4 +-
 .../BaseConnectionLifeCycleListener.java        |  60 ++++++++
 .../ClientConnectionLifeCycleListener.java      |  22 +++
 .../remoting/ConnectionLifeCycleListener.java   |  40 +----
 .../spi/core/remoting/ConnectorFactory.java     |   2 +-
 .../TCPTransportConfigurationSchema.java        |   7 +-
 .../AbstractServerLocatorSchema.java            |   3 +-
 .../serverLocator/InVMServerLocatorSchema.java  |   3 +-
 .../JGroupsServerLocatorSchema.java             |   7 +-
 .../serverLocator/TCPServerLocatorSchema.java   |   7 +-
 .../serverLocator/UDPServerLocatorSchema.java   |   9 +-
 .../activemq/artemis/uri/AbstractCFSchema.java  |   3 +-
 .../apache/activemq/artemis/uri/InVMSchema.java |   3 +-
 .../activemq/artemis/uri/JGroupsSchema.java     |   6 +-
 .../apache/activemq/artemis/uri/TCPSchema.java  |   6 +-
 .../apache/activemq/artemis/uri/UDPSchema.java  |   6 +-
 .../proton/ProtonProtocolManagerFactory.java    |   9 +-
 .../hornetq/HornetQProtocolManagerFactory.java  |  18 ++-
 .../mqtt/MQTTProtocolManagerFactory.java        |   9 +-
 .../OpenWireProtocolManagerFactory.java         |   9 +-
 .../stomp/StompProtocolManagerFactory.java      |  11 +-
 .../artemis/core/protocol/ProtocolHandler.java  |   4 +
 .../core/impl/CoreProtocolManagerFactory.java   |  11 +-
 .../core/remoting/impl/invm/InVMAcceptor.java   |  18 ++-
 .../remoting/impl/invm/InVMAcceptorFactory.java |   7 +-
 .../core/remoting/impl/invm/InVMConnection.java |   9 +-
 .../core/remoting/impl/invm/InVMConnector.java  |  22 ++-
 .../impl/invm/InVMConnectorFactory.java         |   4 +-
 .../core/remoting/impl/netty/NettyAcceptor.java |  13 +-
 .../impl/netty/NettyAcceptorFactory.java        |   3 +-
 .../impl/netty/NettyServerConnection.java       |   3 +-
 .../server/impl/RemotingServiceImpl.java        |  94 ++++++------
 .../cluster/impl/MessageLoadBalancingType.java  |   4 +-
 .../AbstractProtocolManagerFactory.java         |   2 +-
 .../core/protocol/ProtocolManagerFactory.java   |   6 +-
 .../spi/core/remoting/AcceptorFactory.java      |   2 +-
 .../ServerConnectionLifeCycleListener.java      |  12 +-
 .../ClusterConnectionMulticastSchema.java       |   3 +-
 .../ClusterConnectionStaticSchema.java          |   3 +-
 .../artemis/uri/AcceptorParserTest.java         |  39 +++++
 .../impl/netty/NettyAcceptorFactoryTest.java    |   6 +-
 .../remoting/impl/netty/NettyAcceptorTest.java  |   8 +-
 .../server/impl/fake/FakeAcceptorFactory.java   |   4 +-
 51 files changed, 514 insertions(+), 331 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/15ce38e9/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/uri/BeanSupport.java
----------------------------------------------------------------------
diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/uri/BeanSupport.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/uri/BeanSupport.java
new file mode 100644
index 0000000..4985c65
--- /dev/null
+++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/uri/BeanSupport.java
@@ -0,0 +1,148 @@
+/**
+ * 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.utils.uri;
+
+import java.beans.PropertyDescriptor;
+import java.io.UnsupportedEncodingException;
+import java.net.URI;
+import java.net.URLDecoder;
+import java.net.URLEncoder;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.commons.beanutils.BeanUtilsBean;
+import org.apache.commons.beanutils.Converter;
+
+public class BeanSupport {
+
+   private static final BeanUtilsBean beanUtils = new BeanUtilsBean();
+
+   static {
+      // This is to customize the BeanUtils to use Fluent Proeprties as well
+      beanUtils.getPropertyUtils().addBeanIntrospector(new FluentPropertyBeanIntrospectorWithIgnores());
+   }
+
+   public static void registerConverter(Converter converter, Class type) {
+      synchronized (beanUtils) {
+         beanUtils.getConvertUtils().register(converter, type);
+      }
+   }
+
+   public static <P> P copyData(P source, P target) throws Exception {
+      synchronized (beanUtils) {
+         beanUtils.copyProperties(source, target);
+      }
+      return target;
+   }
+
+   public static <P> P setData(URI uri, P obj, Map<String, String> query) throws Exception {
+      synchronized (beanUtils) {
+         beanUtils.setProperty(obj, "host", uri.getHost());
+         beanUtils.setProperty(obj, "port", uri.getPort());
+         beanUtils.setProperty(obj, "userInfo", uri.getUserInfo());
+         beanUtils.populate(obj, query);
+      }
+      return obj;
+   }
+
+   public static <P> P setData( P obj, Map<String, Object> data) throws Exception {
+      synchronized (beanUtils) {
+         beanUtils.populate(obj, data);
+      }
+      return obj;
+   }
+
+   public static void setData(URI uri,
+                              HashMap<String, Object> properties,
+                              Set<String> allowableProperties,
+                              Map<String, String> query,
+                              Map<String, Object> extraProps) {
+      if (allowableProperties.contains("host")) {
+         properties.put("host", "" + uri.getHost());
+      }
+      if (allowableProperties.contains("port")) {
+         properties.put("port", "" + uri.getPort());
+      }
+      if (allowableProperties.contains("userInfo")) {
+         properties.put("userInfo", "" + uri.getUserInfo());
+      }
+      for (Map.Entry<String, String> entry : query.entrySet()) {
+         if (allowableProperties.contains(entry.getKey())) {
+            properties.put(entry.getKey(), entry.getValue());
+         }
+         else {
+            extraProps.put(entry.getKey(), entry.getValue());
+         }
+      }
+   }
+
+   public static String getData(List<String> ignored, Object... beans) throws Exception {
+      StringBuilder sb = new StringBuilder();
+      boolean empty = true;
+      synchronized (beanUtils) {
+         for (Object bean : beans) {
+            if (bean != null) {
+               PropertyDescriptor[] descriptors = beanUtils.getPropertyUtils().getPropertyDescriptors(bean);
+               for (PropertyDescriptor descriptor : descriptors) {
+                  if (descriptor.getReadMethod() != null && isWriteable(descriptor, ignored)) {
+                     String value = beanUtils.getProperty(bean, descriptor.getName());
+                     if (value != null) {
+                        if (!empty) {
+                           sb.append("&");
+                        }
+                        empty = false;
+                        sb.append(descriptor.getName()).append("=").append(encodeURI(value));
+                     }
+                  }
+               }
+            }
+         }
+      }
+      return sb.toString();
+   }
+
+   private static boolean isWriteable(PropertyDescriptor descriptor, List<String> ignored) {
+      if (ignored != null && ignored.contains(descriptor.getName())) {
+         return false;
+      }
+      Class<?> type = descriptor.getPropertyType();
+      return (type == Double.class) ||
+         (type == double.class) ||
+         (type == Long.class) ||
+         (type == long.class) ||
+         (type == Integer.class) ||
+         (type == int.class) ||
+         (type == Float.class) ||
+         (type == float.class) ||
+         (type == Boolean.class) ||
+         (type == boolean.class) ||
+         (type == String.class);
+   }
+
+
+   public static String decodeURI(String value) throws UnsupportedEncodingException {
+      return URLDecoder.decode(value, "UTF-8");
+   }
+
+   public static String encodeURI(String value) throws UnsupportedEncodingException {
+      return URLEncoder.encode(value, "UTF-8");
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/15ce38e9/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/uri/URISchema.java
----------------------------------------------------------------------
diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/uri/URISchema.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/uri/URISchema.java
index 2760e8a..3120292 100644
--- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/uri/URISchema.java
+++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/uri/URISchema.java
@@ -16,19 +16,11 @@
  */
 package org.apache.activemq.artemis.utils.uri;
 
-import java.beans.PropertyDescriptor;
 import java.io.UnsupportedEncodingException;
 import java.net.URI;
 import java.net.URISyntaxException;
-import java.net.URLDecoder;
-import java.net.URLEncoder;
 import java.util.HashMap;
-import java.util.List;
 import java.util.Map;
-import java.util.Set;
-
-import org.apache.commons.beanutils.BeanUtilsBean;
-import org.apache.commons.beanutils.Converter;
 
 public abstract class URISchema<T, P> {
 
@@ -39,7 +31,7 @@ public abstract class URISchema<T, P> {
    }
 
    public void populateObject(URI uri, T bean) throws Exception {
-      setData(uri, bean, parseQuery(uri.getQuery(), null));
+      BeanSupport.setData(uri, bean, parseQuery(uri.getQuery(), null));
    }
 
    public URI newURI(T bean) throws Exception {
@@ -97,36 +89,15 @@ public abstract class URISchema<T, P> {
 
    protected abstract T internalNewObject(URI uri, Map<String, String> query, P param) throws Exception;
 
-   /** This is the default implementation.
-    *  Sub classes are should provide a proper implementation for their schemas. */
+   /**
+    * This is the default implementation.
+    * Sub classes are should provide a proper implementation for their schemas.
+    */
    protected URI internalNewURI(T bean) throws Exception {
-      String query = URISchema.getData(null, bean);
-
-      return new URI(getSchemaName(),
-          null,
-          "//", query, null);
-
-   }
+      String query = BeanSupport.getData(null, bean);
 
-   private static final BeanUtilsBean beanUtils = new BeanUtilsBean();
+      return new URI(getSchemaName(), null, "//", query, null);
 
-   public static void registerConverter(Converter converter, Class type) {
-      synchronized (beanUtils) {
-         beanUtils.getConvertUtils().register(converter, type);
-      }
-   }
-
-   public static String decodeURI(String value) throws UnsupportedEncodingException {
-      return URLDecoder.decode(value, "UTF-8");
-   }
-
-   public static String encodeURI(String value) throws UnsupportedEncodingException {
-      return URLEncoder.encode(value, "UTF-8");
-   }
-
-   static {
-      // This is to customize the BeanUtils to use Fluent Proeprties as well
-      beanUtils.getPropertyUtils().addBeanIntrospector(new FluentPropertyBeanIntrospectorWithIgnores());
    }
 
    public static Map<String, String> parseQuery(String uri,
@@ -138,8 +109,8 @@ public abstract class URISchema<T, P> {
             for (int i = 0; i < parameters.length; i++) {
                int p = parameters[i].indexOf("=");
                if (p >= 0) {
-                  String name = decodeURI(parameters[i].substring(0, p));
-                  String value = decodeURI(parameters[i].substring(p + 1));
+                  String name = BeanSupport.decodeURI(parameters[i].substring(0, p));
+                  String value = BeanSupport.decodeURI(parameters[i].substring(p + 1));
                   rc.put(name, value);
                }
                else {
@@ -171,88 +142,4 @@ public abstract class URISchema<T, P> {
 
       return buffer.toString();
    }
-
-   protected static <P> P copyData(P source, P target) throws Exception {
-      synchronized (beanUtils) {
-         beanUtils.copyProperties(source, target);
-      }
-      return target;
-   }
-
-   protected static <P> P setData(URI uri, P obj, Map<String, String> query) throws Exception {
-      synchronized (beanUtils) {
-         beanUtils.setProperty(obj, "host", uri.getHost());
-         beanUtils.setProperty(obj, "port", uri.getPort());
-         beanUtils.setProperty(obj, "userInfo", uri.getUserInfo());
-         beanUtils.populate(obj, query);
-      }
-      return obj;
-   }
-
-   public static void setData(URI uri,
-                              HashMap<String, Object> properties,
-                              Set<String> allowableProperties,
-                              Map<String, String> query,
-                              Map<String, Object> extraProps) {
-      if (allowableProperties.contains("host")) {
-         properties.put("host", "" + uri.getHost());
-      }
-      if (allowableProperties.contains("port")) {
-         properties.put("port", "" + uri.getPort());
-      }
-      if (allowableProperties.contains("userInfo")) {
-         properties.put("userInfo", "" + uri.getUserInfo());
-      }
-      for (Map.Entry<String, String> entry : query.entrySet()) {
-         if (allowableProperties.contains(entry.getKey())) {
-            properties.put(entry.getKey(), entry.getValue());
-         }
-         else {
-            extraProps.put(entry.getKey(), entry.getValue());
-         }
-      }
-   }
-
-   public static String getData(List<String> ignored, Object... beans) throws Exception {
-      StringBuilder sb = new StringBuilder();
-      boolean empty = true;
-      synchronized (beanUtils) {
-         for (Object bean : beans) {
-            if (bean != null) {
-               PropertyDescriptor[] descriptors = beanUtils.getPropertyUtils().getPropertyDescriptors(bean);
-               for (PropertyDescriptor descriptor : descriptors) {
-                  if (descriptor.getReadMethod() != null && isWriteable(descriptor, ignored)) {
-                     String value = beanUtils.getProperty(bean, descriptor.getName());
-                     if (value != null) {
-                        if (!empty) {
-                           sb.append("&");
-                        }
-                        empty = false;
-                        sb.append(descriptor.getName()).append("=").append(encodeURI(value));
-                     }
-                  }
-               }
-            }
-         }
-      }
-      return sb.toString();
-   }
-
-   private static boolean isWriteable(PropertyDescriptor descriptor, List<String> ignored) {
-      if (ignored != null && ignored.contains(descriptor.getName())) {
-         return false;
-      }
-      Class<?> type = descriptor.getPropertyType();
-      return (type == Double.class) ||
-         (type == double.class) ||
-         (type == Long.class) ||
-         (type == long.class) ||
-         (type == Integer.class) ||
-         (type == int.class) ||
-         (type == Float.class) ||
-         (type == float.class) ||
-         (type == Boolean.class) ||
-         (type == boolean.class) ||
-         (type == String.class);
-   }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/15ce38e9/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/URIParserTest.java
----------------------------------------------------------------------
diff --git a/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/URIParserTest.java b/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/URIParserTest.java
index 183d586..89596f6 100644
--- a/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/URIParserTest.java
+++ b/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/URIParserTest.java
@@ -20,6 +20,7 @@ package org.apache.activemq.artemis.utils;
 import java.net.URI;
 import java.util.Map;
 
+import org.apache.activemq.artemis.utils.uri.BeanSupport;
 import org.apache.activemq.artemis.utils.uri.URIFactory;
 import org.apache.activemq.artemis.utils.uri.URISchema;
 import org.junit.Assert;
@@ -116,7 +117,7 @@ public class URIParserTest {
 
       @Override
       public FruitBase internalNewObject(URI uri, Map<String, String> query, String fruitName) throws Exception {
-         return setData(uri, new Fruit(getSchemaName()), query);
+         return BeanSupport.setData(uri, new Fruit(getSchemaName()), query);
       }
 
    }
@@ -130,7 +131,7 @@ public class URIParserTest {
 
       @Override
       public FruitBase internalNewObject(URI uri, Map<String, String> query, String fruitName) throws Exception {
-         return setData(uri, new FruitBase(getSchemaName()), query);
+         return BeanSupport.setData(uri, new FruitBase(getSchemaName()), query);
       }
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/15ce38e9/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/TransportConfiguration.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/TransportConfiguration.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/TransportConfiguration.java
index d02c275..deceeea 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/TransportConfiguration.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/TransportConfiguration.java
@@ -172,12 +172,8 @@ public class TransportConfiguration implements Serializable {
       return params;
    }
 
-   public Map<String, Object> getAllParams() {
-      Map<String, Object> allParams = new HashMap<>(params);
-      if (extraProps != null) {
-         allParams.putAll(extraProps);
-      }
-      return allParams;
+   public Map<String, Object> getExtraParams() {
+      return extraProps;
    }
 
    @Override

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/15ce38e9/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionFactoryImpl.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionFactoryImpl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionFactoryImpl.java
index 755d93b..0803782 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionFactoryImpl.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionFactoryImpl.java
@@ -53,9 +53,9 @@ import org.apache.activemq.artemis.core.remoting.impl.TransportConfigurationUtil
 import org.apache.activemq.artemis.core.server.ActiveMQComponent;
 import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection;
 import org.apache.activemq.artemis.spi.core.remoting.BufferHandler;
+import org.apache.activemq.artemis.spi.core.remoting.ClientConnectionLifeCycleListener;
 import org.apache.activemq.artemis.spi.core.remoting.ClientProtocolManager;
 import org.apache.activemq.artemis.spi.core.remoting.Connection;
-import org.apache.activemq.artemis.spi.core.remoting.ConnectionLifeCycleListener;
 import org.apache.activemq.artemis.spi.core.remoting.Connector;
 import org.apache.activemq.artemis.spi.core.remoting.ConnectorFactory;
 import org.apache.activemq.artemis.spi.core.remoting.SessionContext;
@@ -67,7 +67,7 @@ import org.apache.activemq.artemis.utils.ExecutorFactory;
 import org.apache.activemq.artemis.utils.OrderedExecutorFactory;
 import org.apache.activemq.artemis.utils.UUIDGenerator;
 
-public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, ConnectionLifeCycleListener {
+public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, ClientConnectionLifeCycleListener {
    // Constants
    // ------------------------------------------------------------------------------------
 
@@ -350,7 +350,7 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
    @Override
    public void connectionCreated(final ActiveMQComponent component,
                                  final Connection connection,
-                                 final String protocol) {
+                                 final ClientProtocolManager protocol) {
    }
 
    @Override

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/15ce38e9/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/ActiveMQChannelHandler.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/ActiveMQChannelHandler.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/ActiveMQChannelHandler.java
index d2233d1..4772847 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/ActiveMQChannelHandler.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/ActiveMQChannelHandler.java
@@ -25,6 +25,7 @@ import org.apache.activemq.artemis.api.core.ActiveMQException;
 import org.apache.activemq.artemis.core.buffers.impl.ChannelBufferWrapper;
 import org.apache.activemq.artemis.core.client.ActiveMQClientLogger;
 import org.apache.activemq.artemis.core.client.ActiveMQClientMessageBundle;
+import org.apache.activemq.artemis.spi.core.remoting.BaseConnectionLifeCycleListener;
 import org.apache.activemq.artemis.spi.core.remoting.BufferHandler;
 import org.apache.activemq.artemis.spi.core.remoting.ConnectionLifeCycleListener;
 
@@ -37,13 +38,13 @@ public class ActiveMQChannelHandler extends ChannelDuplexHandler {
 
    private final BufferHandler handler;
 
-   private final ConnectionLifeCycleListener listener;
+   private final BaseConnectionLifeCycleListener listener;
 
    volatile boolean active;
 
    protected ActiveMQChannelHandler(final ChannelGroup group,
                                     final BufferHandler handler,
-                                    final ConnectionLifeCycleListener listener) {
+                                    final BaseConnectionLifeCycleListener listener) {
       this.group = group;
       this.handler = handler;
       this.listener = listener;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/15ce38e9/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnection.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnection.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnection.java
index 6608b54..8bbc06d 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnection.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnection.java
@@ -37,6 +37,7 @@ import org.apache.activemq.artemis.core.buffers.impl.ChannelBufferWrapper;
 import org.apache.activemq.artemis.core.client.ActiveMQClientLogger;
 import org.apache.activemq.artemis.core.security.ActiveMQPrincipal;
 import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection;
+import org.apache.activemq.artemis.spi.core.remoting.BaseConnectionLifeCycleListener;
 import org.apache.activemq.artemis.spi.core.remoting.Connection;
 import org.apache.activemq.artemis.spi.core.remoting.ConnectionLifeCycleListener;
 import org.apache.activemq.artemis.spi.core.remoting.ReadyListener;
@@ -53,7 +54,7 @@ public class NettyConnection implements Connection {
 
    private boolean closed;
 
-   private final ConnectionLifeCycleListener listener;
+   private final BaseConnectionLifeCycleListener listener;
 
    private final boolean batchingEnabled;
 
@@ -79,7 +80,7 @@ public class NettyConnection implements Connection {
 
    public NettyConnection(final Map<String, Object> configuration,
                           final Channel channel,
-                          final ConnectionLifeCycleListener listener,
+                          final BaseConnectionLifeCycleListener listener,
                           boolean batchingEnabled,
                           boolean directDeliver) {
       this.configuration = configuration;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/15ce38e9/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnector.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnector.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnector.java
index 55435f5..6b85798 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnector.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnector.java
@@ -94,7 +94,9 @@ import org.apache.activemq.artemis.core.protocol.core.impl.ActiveMQClientProtoco
 import org.apache.activemq.artemis.core.remoting.impl.ssl.SSLSupport;
 import org.apache.activemq.artemis.core.server.ActiveMQComponent;
 import org.apache.activemq.artemis.spi.core.remoting.AbstractConnector;
+import org.apache.activemq.artemis.spi.core.remoting.BaseConnectionLifeCycleListener;
 import org.apache.activemq.artemis.spi.core.remoting.BufferHandler;
+import org.apache.activemq.artemis.spi.core.remoting.ClientConnectionLifeCycleListener;
 import org.apache.activemq.artemis.spi.core.remoting.ClientProtocolManager;
 import org.apache.activemq.artemis.spi.core.remoting.Connection;
 import org.apache.activemq.artemis.spi.core.remoting.ConnectionLifeCycleListener;
@@ -151,7 +153,7 @@ public class NettyConnector extends AbstractConnector {
 
    private final BufferHandler handler;
 
-   private final ConnectionLifeCycleListener listener;
+   private final BaseConnectionLifeCycleListener listener;
 
    private boolean sslEnabled = TransportConstants.DEFAULT_SSL_ENABLED;
 
@@ -231,7 +233,7 @@ public class NettyConnector extends AbstractConnector {
    // Public --------------------------------------------------------
    public NettyConnector(final Map<String, Object> configuration,
                          final BufferHandler handler,
-                         final ConnectionLifeCycleListener listener,
+                         final BaseConnectionLifeCycleListener listener,
                          final Executor closeExecutor,
                          final Executor threadPool,
                          final ScheduledExecutorService scheduledThreadPool) {
@@ -240,7 +242,7 @@ public class NettyConnector extends AbstractConnector {
 
    public NettyConnector(final Map<String, Object> configuration,
                          final BufferHandler handler,
-                         final ConnectionLifeCycleListener listener,
+                         final BaseConnectionLifeCycleListener listener,
                          final Executor closeExecutor,
                          final Executor threadPool,
                          final ScheduledExecutorService scheduledThreadPool,
@@ -681,7 +683,7 @@ public class NettyConnector extends AbstractConnector {
          // No acceptor on a client connection
          Listener connectionListener = new Listener();
          NettyConnection conn = new NettyConnection(configuration, ch, connectionListener, !httpEnabled && batchDelay > 0, false);
-         connectionListener.connectionCreated(null, conn, protocolManager.getName());
+         connectionListener.connectionCreated(null, conn, protocolManager);
          return conn;
       }
       else {
@@ -709,7 +711,7 @@ public class NettyConnector extends AbstractConnector {
 
       ActiveMQClientChannelHandler(final ChannelGroup group,
                                    final BufferHandler handler,
-                                   final ConnectionLifeCycleListener listener) {
+                                   final ClientConnectionLifeCycleListener listener) {
          super(group, handler, listener);
       }
    }
@@ -899,12 +901,12 @@ public class NettyConnector extends AbstractConnector {
       }
    }
 
-   private class Listener implements ConnectionLifeCycleListener {
+   private class Listener implements ClientConnectionLifeCycleListener {
 
       @Override
       public void connectionCreated(final ActiveMQComponent component,
                                     final Connection connection,
-                                    final String protocol) {
+                                    final ClientProtocolManager protocol) {
          if (connections.putIfAbsent(connection.getID(), connection) != null) {
             throw ActiveMQClientMessageBundle.BUNDLE.connectionExists(connection.getID());
          }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/15ce38e9/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnectorFactory.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnectorFactory.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnectorFactory.java
index a7c5f0e..a0648df 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnectorFactory.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnectorFactory.java
@@ -21,8 +21,8 @@ import java.util.concurrent.Executor;
 import java.util.concurrent.ScheduledExecutorService;
 
 import org.apache.activemq.artemis.spi.core.remoting.BufferHandler;
+import org.apache.activemq.artemis.spi.core.remoting.ClientConnectionLifeCycleListener;
 import org.apache.activemq.artemis.spi.core.remoting.ClientProtocolManager;
-import org.apache.activemq.artemis.spi.core.remoting.ConnectionLifeCycleListener;
 import org.apache.activemq.artemis.spi.core.remoting.Connector;
 import org.apache.activemq.artemis.spi.core.remoting.ConnectorFactory;
 
@@ -31,7 +31,7 @@ public class NettyConnectorFactory implements ConnectorFactory {
    @Override
    public Connector createConnector(final Map<String, Object> configuration,
                                     final BufferHandler handler,
-                                    final ConnectionLifeCycleListener listener,
+                                    final ClientConnectionLifeCycleListener listener,
                                     final Executor closeExecutor,
                                     final Executor threadPool,
                                     final ScheduledExecutorService scheduledThreadPool,

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/15ce38e9/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/BaseConnectionLifeCycleListener.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/BaseConnectionLifeCycleListener.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/BaseConnectionLifeCycleListener.java
new file mode 100644
index 0000000..77a8c59
--- /dev/null
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/BaseConnectionLifeCycleListener.java
@@ -0,0 +1,60 @@
+/*
+ * 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.spi.core.remoting;
+
+import org.apache.activemq.artemis.api.core.ActiveMQException;
+import org.apache.activemq.artemis.core.server.ActiveMQComponent;
+
+/**
+ * A ConnectionLifeCycleListener is called by the remoting implementation to notify of connection events.
+ */
+public interface BaseConnectionLifeCycleListener<ProtocolClass> {
+
+   /**
+    * This method is used both by client connector creation and server connection creation through
+    * acceptors. On the client side the {@code component} parameter is normally passed as
+    * {@code null}.
+    * <p>
+    * Leaving this method here and adding a different one at
+    * {@code ServerConnectionLifeCycleListener} is a compromise for a reasonable split between the
+    * activemq-server and activemq-client packages while avoiding to pull too much into activemq-core.
+    * The pivotal point keeping us from removing the method is {@link ConnectorFactory} and the
+    * usage of it.
+    *
+    * @param component  This will probably be an {@code Acceptor} and only used on the server side.
+    * @param connection the connection that has been created
+    * @param protocol   the messaging protocol type this connection uses
+    */
+   void connectionCreated(ActiveMQComponent component, Connection connection, ProtocolClass protocol);
+
+   /**
+    * Called when a connection is destroyed.
+    *
+    * @param connectionID the connection being destroyed.
+    */
+   void connectionDestroyed(Object connectionID);
+
+   /**
+    * Called when an error occurs on the connection.
+    *
+    * @param connectionID the id of the connection.
+    * @param me           the exception.
+    */
+   void connectionException(Object connectionID, ActiveMQException me);
+
+   void connectionReadyForWrites(Object connectionID, boolean ready);
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/15ce38e9/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/ClientConnectionLifeCycleListener.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/ClientConnectionLifeCycleListener.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/ClientConnectionLifeCycleListener.java
new file mode 100644
index 0000000..deb36cd
--- /dev/null
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/ClientConnectionLifeCycleListener.java
@@ -0,0 +1,22 @@
+/**
+ * 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.spi.core.remoting;
+
+public interface ClientConnectionLifeCycleListener extends BaseConnectionLifeCycleListener<ClientProtocolManager> {
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/15ce38e9/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/ConnectionLifeCycleListener.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/ConnectionLifeCycleListener.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/ConnectionLifeCycleListener.java
index b5d7d97..f702227 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/ConnectionLifeCycleListener.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/ConnectionLifeCycleListener.java
@@ -16,45 +16,11 @@
  */
 package org.apache.activemq.artemis.spi.core.remoting;
 
-import org.apache.activemq.artemis.api.core.ActiveMQException;
-import org.apache.activemq.artemis.core.server.ActiveMQComponent;
-
 /**
  * A ConnectionLifeCycleListener is called by the remoting implementation to notify of connection events.
+ * @deprecated use {@link ClientConnectionLifeCycleListener} instead.
  */
-public interface ConnectionLifeCycleListener {
-
-   /**
-    * This method is used both by client connector creation and server connection creation through
-    * acceptors. On the client side the {@code component} parameter is normally passed as
-    * {@code null}.
-    * <p>
-    * Leaving this method here and adding a different one at
-    * {@code ServerConnectionLifeCycleListener} is a compromise for a reasonable split between the
-    * activemq-server and activemq-client packages while avoiding to pull too much into activemq-core.
-    * The pivotal point keeping us from removing the method is {@link ConnectorFactory} and the
-    * usage of it.
-    *
-    * @param component  This will probably be an {@code Acceptor} and only used on the server side.
-    * @param connection the connection that has been created
-    * @param protocol   the messaging protocol type this connection uses
-    */
-   void connectionCreated(ActiveMQComponent component, Connection connection, String protocol);
-
-   /**
-    * Called when a connection is destroyed.
-    *
-    * @param connectionID the connection being destroyed.
-    */
-   void connectionDestroyed(Object connectionID);
-
-   /**
-    * Called when an error occurs on the connection.
-    *
-    * @param connectionID the id of the connection.
-    * @param me           the exception.
-    */
-   void connectionException(Object connectionID, ActiveMQException me);
+@Deprecated
+public interface ConnectionLifeCycleListener extends BaseConnectionLifeCycleListener<String> {
 
-   void connectionReadyForWrites(Object connectionID, boolean ready);
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/15ce38e9/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/ConnectorFactory.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/ConnectorFactory.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/ConnectorFactory.java
index 3d7c7b3..e709f78 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/ConnectorFactory.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/ConnectorFactory.java
@@ -42,7 +42,7 @@ public interface ConnectorFactory extends TransportConfigurationHelper {
     */
    Connector createConnector(Map<String, Object> configuration,
                              BufferHandler handler,
-                             ConnectionLifeCycleListener listener,
+                             ClientConnectionLifeCycleListener listener,
                              Executor closeExecutor,
                              Executor threadPool,
                              ScheduledExecutorService scheduledThreadPool,

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/15ce38e9/artemis-core-client/src/main/java/org/apache/activemq/artemis/uri/schema/connector/TCPTransportConfigurationSchema.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/uri/schema/connector/TCPTransportConfigurationSchema.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/uri/schema/connector/TCPTransportConfigurationSchema.java
index 628a8ed..e962a5d 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/uri/schema/connector/TCPTransportConfigurationSchema.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/uri/schema/connector/TCPTransportConfigurationSchema.java
@@ -26,6 +26,7 @@ import java.util.Set;
 
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
 import org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory;
+import org.apache.activemq.artemis.utils.uri.BeanSupport;
 import org.apache.activemq.artemis.utils.uri.SchemaConstants;
 
 public class TCPTransportConfigurationSchema extends AbstractTransportConfigurationSchema {
@@ -61,7 +62,7 @@ public class TCPTransportConfigurationSchema extends AbstractTransportConfigurat
       HashMap<String, Object> props = new HashMap<>();
 
       Map<String, Object> extraProps = new HashMap<>();
-      setData(uri, props, allowableProperties, query, extraProps);
+      BeanSupport.setData(uri, props, allowableProperties, query, extraProps);
       List<TransportConfiguration> transportConfigurations = new ArrayList<>();
 
       TransportConfiguration config = new TransportConfiguration(factoryName, props, name, extraProps);
@@ -75,8 +76,8 @@ public class TCPTransportConfigurationSchema extends AbstractTransportConfigurat
             URI extraUri = new URI(s);
             HashMap<String, Object> newProps = new HashMap<>();
             extraProps = new HashMap<>();
-            setData(extraUri, newProps, allowableProperties, query, extraProps);
-            setData(extraUri, newProps, allowableProperties, parseQuery(extraUri.getQuery(), null), extraProps);
+            BeanSupport.setData(extraUri, newProps, allowableProperties, query, extraProps);
+            BeanSupport.setData(extraUri, newProps, allowableProperties, parseQuery(extraUri.getQuery(), null), extraProps);
             transportConfigurations.add(new TransportConfiguration(factoryName, newProps, name + ":" + extraUri.toString(), extraProps));
          }
       }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/15ce38e9/artemis-core-client/src/main/java/org/apache/activemq/artemis/uri/schema/serverLocator/AbstractServerLocatorSchema.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/uri/schema/serverLocator/AbstractServerLocatorSchema.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/uri/schema/serverLocator/AbstractServerLocatorSchema.java
index e1a5f2b..d0693d4 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/uri/schema/serverLocator/AbstractServerLocatorSchema.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/uri/schema/serverLocator/AbstractServerLocatorSchema.java
@@ -17,6 +17,7 @@
 package org.apache.activemq.artemis.uri.schema.serverLocator;
 
 import org.apache.activemq.artemis.api.core.client.ServerLocator;
+import org.apache.activemq.artemis.utils.uri.BeanSupport;
 import org.apache.activemq.artemis.utils.uri.URISchema;
 
 import java.net.URI;
@@ -25,6 +26,6 @@ import java.util.Map;
 public abstract class AbstractServerLocatorSchema extends URISchema<ServerLocator, String> {
 
    protected ConnectionOptions newConnectionOptions(URI uri, Map<String, String> query) throws Exception {
-      return setData(uri, new ConnectionOptions(), query);
+      return BeanSupport.setData(uri, new ConnectionOptions(), query);
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/15ce38e9/artemis-core-client/src/main/java/org/apache/activemq/artemis/uri/schema/serverLocator/InVMServerLocatorSchema.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/uri/schema/serverLocator/InVMServerLocatorSchema.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/uri/schema/serverLocator/InVMServerLocatorSchema.java
index ace312a..2060ea9 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/uri/schema/serverLocator/InVMServerLocatorSchema.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/uri/schema/serverLocator/InVMServerLocatorSchema.java
@@ -20,6 +20,7 @@ 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.uri.schema.connector.InVMTransportConfigurationSchema;
+import org.apache.activemq.artemis.utils.uri.BeanSupport;
 import org.apache.activemq.artemis.utils.uri.SchemaConstants;
 
 import java.net.URI;
@@ -37,7 +38,7 @@ public class InVMServerLocatorSchema extends AbstractServerLocatorSchema {
    protected ServerLocator internalNewObject(URI uri, Map<String, String> query, String name) throws Exception {
       TransportConfiguration tc = InVMTransportConfigurationSchema.createTransportConfiguration(uri, query, name, "org.apache.activemq.artemis.core.remoting.impl.invm.InVMConnectorFactory");
       ServerLocator factory = ActiveMQClient.createServerLocatorWithoutHA(tc);
-      return setData(uri, factory, query);
+      return BeanSupport.setData(uri, factory, query);
    }
 
    @Override

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/15ce38e9/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
index 73a1b94..c8ee305 100644
--- 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
@@ -22,6 +22,7 @@ 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.BeanSupport;
 import org.apache.activemq.artemis.utils.uri.SchemaConstants;
 
 import java.io.NotSerializableException;
@@ -63,7 +64,7 @@ public class JGroupsServerLocatorSchema extends AbstractServerLocatorSchema {
       else {
          throw new NotSerializableException(endpoint + "not serializable");
       }
-      String query = getData(null, bean, dgc, endpoint);
+      String query = BeanSupport.getData(null, bean, dgc, endpoint);
       dgc.setBroadcastEndpointFactory(endpoint);
       return new URI(SchemaConstants.JGROUPS, null, auth, -1, null, query, null);
    }
@@ -79,11 +80,11 @@ public class JGroupsServerLocatorSchema extends AbstractServerLocatorSchema {
          endpointFactory = new JGroupsPropertiesBroadcastEndpointFactory().setChannelName(uri.getAuthority());
       }
 
-      setData(uri, endpointFactory, query);
+      BeanSupport.setData(uri, endpointFactory, query);
 
       DiscoveryGroupConfiguration dcConfig = new DiscoveryGroupConfiguration().setName(name).setBroadcastEndpointFactory(endpointFactory);
 
-      setData(uri, dcConfig, query);
+      BeanSupport.setData(uri, dcConfig, query);
       return dcConfig;
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/15ce38e9/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
index d141ee6..4a2e2aa 100644
--- 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
@@ -27,6 +27,7 @@ import org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactor
 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.BeanSupport;
 import org.apache.activemq.artemis.utils.uri.SchemaConstants;
 
 public class TCPServerLocatorSchema extends AbstractServerLocatorSchema {
@@ -52,7 +53,7 @@ public class TCPServerLocatorSchema extends AbstractServerLocatorSchema {
 
    @Override
    protected URI internalNewURI(ServerLocator bean) throws Exception {
-      String query = getData(null, bean);
+      String query = BeanSupport.getData(null, bean);
       TransportConfiguration[] staticConnectors = bean.getStaticTransportConfigurations();
       return getURI(query, staticConnectors);
    }
@@ -122,9 +123,9 @@ public class TCPServerLocatorSchema extends AbstractServerLocatorSchema {
             else {
                empty = false;
             }
-            cb.append(encodeURI(entry.getKey()));
+            cb.append(BeanSupport.encodeURI(entry.getKey()));
             cb.append("=");
-            cb.append(encodeURI(entry.getValue().toString()));
+            cb.append(BeanSupport.encodeURI(entry.getValue().toString()));
          }
       }
       return cb.toString();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/15ce38e9/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
index a21e1a9..3498804 100644
--- 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
@@ -25,6 +25,7 @@ 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.BeanSupport;
 import org.apache.activemq.artemis.utils.uri.SchemaConstants;
 
 public class UDPServerLocatorSchema extends AbstractServerLocatorSchema {
@@ -60,7 +61,7 @@ public class UDPServerLocatorSchema extends AbstractServerLocatorSchema {
       DiscoveryGroupConfiguration dgc = bean.getDiscoveryGroupConfiguration();
       UDPBroadcastEndpointFactory endpoint = (UDPBroadcastEndpointFactory) dgc.getBroadcastEndpointFactory();
       dgc.setBroadcastEndpointFactory(endpoint);
-      String query = getData(IGNORED, bean, dgc, endpoint);
+      String query = BeanSupport.getData(IGNORED, bean, dgc, endpoint);
       return new URI(SchemaConstants.UDP, null, endpoint.getGroupAddress(), endpoint.getGroupPort(), null, query, null);
    }
 
@@ -71,11 +72,11 @@ public class UDPServerLocatorSchema extends AbstractServerLocatorSchema {
                                                                             String name) throws Exception {
       UDPBroadcastEndpointFactory endpointFactoryConfiguration = new UDPBroadcastEndpointFactory().setGroupAddress(host).setGroupPort(port);
 
-      setData(uri, endpointFactoryConfiguration, query);
+      BeanSupport.setData(uri, endpointFactoryConfiguration, query);
 
-      DiscoveryGroupConfiguration dgc = setData(uri, new DiscoveryGroupConfiguration(), query).setName(name).setBroadcastEndpointFactory(endpointFactoryConfiguration);
+      DiscoveryGroupConfiguration dgc = BeanSupport.setData(uri, new DiscoveryGroupConfiguration(), query).setName(name).setBroadcastEndpointFactory(endpointFactoryConfiguration);
 
-      setData(uri, dgc, query);
+      BeanSupport.setData(uri, dgc, query);
       return dgc;
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/15ce38e9/artemis-jms-client/src/main/java/org/apache/activemq/artemis/uri/AbstractCFSchema.java
----------------------------------------------------------------------
diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/uri/AbstractCFSchema.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/uri/AbstractCFSchema.java
index b93d2ea..9b407db 100644
--- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/uri/AbstractCFSchema.java
+++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/uri/AbstractCFSchema.java
@@ -22,6 +22,7 @@ import java.util.Map;
 
 import org.apache.activemq.artemis.core.client.ActiveMQClientLogger;
 import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
+import org.apache.activemq.artemis.utils.uri.BeanSupport;
 import org.apache.activemq.artemis.utils.uri.URISchema;
 
 public abstract class AbstractCFSchema extends URISchema<ActiveMQConnectionFactory, String> {
@@ -32,7 +33,7 @@ public abstract class AbstractCFSchema extends URISchema<ActiveMQConnectionFacto
       if (JMSConnectionOptions.convertCFType(type) == null) {
          ActiveMQClientLogger.LOGGER.invalidCFType(type, uri.toString());
       }
-      return setData(uri, new JMSConnectionOptions(), query);
+      return BeanSupport.setData(uri, new JMSConnectionOptions(), query);
    }
 
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/15ce38e9/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 4e69c4d..18b0111 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
@@ -20,6 +20,7 @@ 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.BeanSupport;
 import org.apache.activemq.artemis.utils.uri.SchemaConstants;
 
 import java.net.URI;
@@ -38,7 +39,7 @@ public class InVMSchema extends AbstractCFSchema {
                                                          String name) throws Exception {
       JMSConnectionOptions options = newConectionOptions(uri, query);
       ActiveMQConnectionFactory factory = ActiveMQJMSClient.createConnectionFactoryWithoutHA(options.getFactoryTypeEnum(), InVMTransportConfigurationSchema.createTransportConfiguration(uri, query, name, "org.apache.activemq.artemis.core.remoting.impl.invm.InVMConnectorFactory"));
-      return setData(uri, factory, query);
+      return BeanSupport.setData(uri, factory, query);
    }
 
    @Override

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/15ce38e9/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 2874fa9..1bc78c3 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
@@ -28,8 +28,8 @@ import org.apache.activemq.artemis.api.core.JGroupsPropertiesBroadcastEndpointFa
 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.BeanSupport;
 import org.apache.activemq.artemis.utils.uri.SchemaConstants;
-import org.apache.activemq.artemis.utils.uri.URISchema;
 
 public class JGroupsSchema extends AbstractCFSchema {
 
@@ -53,7 +53,7 @@ public class JGroupsSchema extends AbstractCFSchema {
       else {
          factory = ActiveMQJMSClient.createConnectionFactoryWithoutHA(dcConfig, options.getFactoryTypeEnum());
       }
-      return URISchema.setData(uri, factory, query);
+      return BeanSupport.setData(uri, factory, query);
    }
 
    @Override
@@ -70,7 +70,7 @@ public class JGroupsSchema extends AbstractCFSchema {
       else {
          throw new NotSerializableException(endpoint + "not serializable");
       }
-      String query = URISchema.getData(null, bean, dgc, endpoint);
+      String query = BeanSupport.getData(null, bean, dgc, endpoint);
       dgc.setBroadcastEndpointFactory(endpoint);
       return new URI(SchemaConstants.JGROUPS, null, auth, -1, null, query, null);
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/15ce38e9/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 5e9eb14..a350263 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
@@ -23,8 +23,8 @@ 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.BeanSupport;
 import org.apache.activemq.artemis.utils.uri.SchemaConstants;
-import org.apache.activemq.artemis.utils.uri.URISchema;
 
 import java.net.URI;
 import java.util.List;
@@ -58,12 +58,12 @@ public class TCPSchema extends AbstractCFSchema {
          factory = ActiveMQJMSClient.createConnectionFactoryWithoutHA(options.getFactoryTypeEnum(), tcs);
       }
 
-      return URISchema.setData(uri, factory, query);
+      return BeanSupport.setData(uri, factory, query);
    }
 
    @Override
    protected URI internalNewURI(ActiveMQConnectionFactory bean) throws Exception {
-      String query = URISchema.getData(null, bean);
+      String query = BeanSupport.getData(null, bean);
       TransportConfiguration[] staticConnectors = bean.getStaticConnectors();
       return TCPServerLocatorSchema.getURI(query, staticConnectors);
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/15ce38e9/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 5a6ca9a..4a1e87b 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
@@ -25,8 +25,8 @@ 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.BeanSupport;
 import org.apache.activemq.artemis.utils.uri.SchemaConstants;
-import org.apache.activemq.artemis.utils.uri.URISchema;
 
 public class UDPSchema extends AbstractCFSchema {
 
@@ -50,14 +50,14 @@ public class UDPSchema extends AbstractCFSchema {
       else {
          factory = ActiveMQJMSClient.createConnectionFactoryWithoutHA(dgc, options.getFactoryTypeEnum());
       }
-      return URISchema.setData(uri, factory, query);
+      return BeanSupport.setData(uri, factory, query);
    }
 
    @Override
    protected URI internalNewURI(ActiveMQConnectionFactory bean) throws Exception {
       DiscoveryGroupConfiguration dgc = bean.getDiscoveryGroupConfiguration();
       UDPBroadcastEndpointFactory endpoint = (UDPBroadcastEndpointFactory) dgc.getBroadcastEndpointFactory();
-      String query = URISchema.getData(UDPServerLocatorSchema.IGNORED, bean, dgc, endpoint);
+      String query = BeanSupport.getData(UDPServerLocatorSchema.IGNORED, bean, dgc, endpoint);
       dgc.setBroadcastEndpointFactory(endpoint);
       return new URI(SchemaConstants.UDP, null, endpoint.getGroupAddress(), endpoint.getGroupPort(), null, query, null);
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/15ce38e9/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/proton/ProtonProtocolManagerFactory.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/proton/ProtonProtocolManagerFactory.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/proton/ProtonProtocolManagerFactory.java
index c11e05b..e677563 100644
--- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/proton/ProtonProtocolManagerFactory.java
+++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/proton/ProtonProtocolManagerFactory.java
@@ -22,10 +22,12 @@ import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.spi.core.protocol.AbstractProtocolManagerFactory;
 import org.apache.activemq.artemis.spi.core.protocol.ProtocolManager;
 import org.apache.activemq.artemis.spi.core.protocol.ProtocolManagerFactory;
+import org.apache.activemq.artemis.utils.uri.BeanSupport;
 import org.osgi.service.component.annotations.Component;
 
 import java.util.Collections;
 import java.util.List;
+import java.util.Map;
 
 @Component(service = ProtocolManagerFactory.class)
 public class ProtonProtocolManagerFactory extends AbstractProtocolManagerFactory<Interceptor> {
@@ -38,9 +40,10 @@ public class ProtonProtocolManagerFactory extends AbstractProtocolManagerFactory
 
    @Override
    public ProtocolManager createProtocolManager(ActiveMQServer server,
-                                                List<Interceptor> incomingInterceptors,
-                                                List<Interceptor> outgoingInterceptors) {
-      return new ProtonProtocolManager(this, server);
+                                                final Map<String, Object> parameters,
+                                                List<BaseInterceptor> incomingInterceptors,
+                                                List<BaseInterceptor> outgoingInterceptors) throws Exception {
+      return BeanSupport.setData(new ProtonProtocolManager(this, server), parameters);
    }
 
    @Override

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/15ce38e9/artemis-protocols/artemis-hornetq-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/hornetq/HornetQProtocolManagerFactory.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-hornetq-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/hornetq/HornetQProtocolManagerFactory.java b/artemis-protocols/artemis-hornetq-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/hornetq/HornetQProtocolManagerFactory.java
index deeb191..9fd851f 100644
--- a/artemis-protocols/artemis-hornetq-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/hornetq/HornetQProtocolManagerFactory.java
+++ b/artemis-protocols/artemis-hornetq-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/hornetq/HornetQProtocolManagerFactory.java
@@ -17,7 +17,9 @@
 package org.apache.activemq.artemis.core.protocol.hornetq;
 
 import java.util.List;
+import java.util.Map;
 
+import org.apache.activemq.artemis.api.core.BaseInterceptor;
 import org.apache.activemq.artemis.api.core.Interceptor;
 import org.apache.activemq.artemis.core.protocol.core.impl.CoreProtocolManagerFactory;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
@@ -36,11 +38,17 @@ public class HornetQProtocolManagerFactory extends CoreProtocolManagerFactory {
 
    @Override
    public ProtocolManager createProtocolManager(final ActiveMQServer server,
-                                                final List<Interceptor> incomingInterceptors,
-                                                List<Interceptor> outgoingInterceptors) {
-      incomingInterceptors.add(new HQPropertiesConversionInterceptor(true));
-      outgoingInterceptors.add(new HQPropertiesConversionInterceptor(false));
-      return new HornetQProtocolManager(this, server, incomingInterceptors, outgoingInterceptors);
+                                                final Map<String, Object> parameters,
+                                                final List<BaseInterceptor> incomingInterceptors,
+                                                List<BaseInterceptor> outgoingInterceptors) {
+
+      List<Interceptor> hqIncoming = filterInterceptors(incomingInterceptors);
+      List<Interceptor> hqOutgoing = filterInterceptors(outgoingInterceptors);
+
+      hqIncoming.add(new HQPropertiesConversionInterceptor(true));
+      hqOutgoing.add(new HQPropertiesConversionInterceptor(false));
+
+      return new HornetQProtocolManager(this, server, hqIncoming, hqOutgoing);
    }
 
    @Override

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/15ce38e9/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTProtocolManagerFactory.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTProtocolManagerFactory.java b/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTProtocolManagerFactory.java
index 5bb34b5..982723f 100644
--- a/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTProtocolManagerFactory.java
+++ b/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTProtocolManagerFactory.java
@@ -18,14 +18,16 @@
 package org.apache.activemq.artemis.core.protocol.mqtt;
 
 import java.util.List;
+import java.util.Map;
 
+import org.apache.activemq.artemis.api.core.BaseInterceptor;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.spi.core.protocol.ProtocolManager;
 import org.apache.activemq.artemis.spi.core.protocol.ProtocolManagerFactory;
 import org.osgi.service.component.annotations.Component;
 
 @Component(service = ProtocolManagerFactory.class)
-public class MQTTProtocolManagerFactory implements ProtocolManagerFactory {
+public class MQTTProtocolManagerFactory implements ProtocolManagerFactory<BaseInterceptor> {
 
    public static final String MQTT_PROTOCOL_NAME = "MQTT";
 
@@ -35,8 +37,9 @@ public class MQTTProtocolManagerFactory implements ProtocolManagerFactory {
 
    @Override
    public ProtocolManager createProtocolManager(ActiveMQServer server,
-                                                List incomingInterceptors,
-                                                List outgoingInterceptors) {
+                                                final Map<String, Object> parameters,
+                                                List<BaseInterceptor> incomingInterceptors,
+                                                List<BaseInterceptor> outgoingInterceptors) {
       return new MQTTProtocolManager(server);
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/15ce38e9/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireProtocolManagerFactory.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireProtocolManagerFactory.java b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireProtocolManagerFactory.java
index 6b3076d..772ce8b 100644
--- a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireProtocolManagerFactory.java
+++ b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireProtocolManagerFactory.java
@@ -18,6 +18,7 @@ package org.apache.activemq.artemis.core.protocol.openwire;
 
 import java.util.Collections;
 import java.util.List;
+import java.util.Map;
 
 import org.apache.activemq.artemis.api.core.BaseInterceptor;
 import org.apache.activemq.artemis.api.core.Interceptor;
@@ -25,6 +26,7 @@ import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.spi.core.protocol.AbstractProtocolManagerFactory;
 import org.apache.activemq.artemis.spi.core.protocol.ProtocolManager;
 import org.apache.activemq.artemis.spi.core.protocol.ProtocolManagerFactory;
+import org.apache.activemq.artemis.utils.uri.BeanSupport;
 import org.osgi.service.component.annotations.Component;
 
 @Component(service = ProtocolManagerFactory.class)
@@ -38,9 +40,10 @@ public class OpenWireProtocolManagerFactory extends AbstractProtocolManagerFacto
 
    @Override
    public ProtocolManager createProtocolManager(final ActiveMQServer server,
-                                                final List<Interceptor> incomingInterceptors,
-                                                List<Interceptor> outgoingInterceptors) {
-      return new OpenWireProtocolManager(this, server);
+                                                Map<String, Object> parameters,
+                                                final List<BaseInterceptor> incomingInterceptors,
+                                                List<BaseInterceptor> outgoingInterceptors) throws Exception {
+      return BeanSupport.setData(new OpenWireProtocolManager(this, server), parameters);
    }
 
    @Override

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/15ce38e9/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompProtocolManagerFactory.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompProtocolManagerFactory.java b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompProtocolManagerFactory.java
index 2d41e03..f7d5d4a 100644
--- a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompProtocolManagerFactory.java
+++ b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompProtocolManagerFactory.java
@@ -17,12 +17,14 @@
 package org.apache.activemq.artemis.core.protocol.stomp;
 
 import java.util.List;
+import java.util.Map;
 
 import org.apache.activemq.artemis.api.core.BaseInterceptor;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.spi.core.protocol.AbstractProtocolManagerFactory;
 import org.apache.activemq.artemis.spi.core.protocol.ProtocolManager;
 import org.apache.activemq.artemis.spi.core.protocol.ProtocolManagerFactory;
+import org.apache.activemq.artemis.utils.uri.BeanSupport;
 import org.osgi.service.component.annotations.Component;
 
 @Component(service = ProtocolManagerFactory.class)
@@ -36,14 +38,15 @@ public class StompProtocolManagerFactory extends AbstractProtocolManagerFactory<
 
    @Override
    public ProtocolManager createProtocolManager(final ActiveMQServer server,
-                                                final List<StompFrameInterceptor> incomingInterceptors,
-                                                List<StompFrameInterceptor> outgoingInterceptors) {
-      return new StompProtocolManager(this, server, incomingInterceptors, outgoingInterceptors);
+                                                final Map<String, Object> parameters,
+                                                final List<BaseInterceptor> incomingInterceptors,
+                                                List<BaseInterceptor> outgoingInterceptors) throws Exception {
+      return BeanSupport.setData(new StompProtocolManager(this, server, filterInterceptors(incomingInterceptors), filterInterceptors(outgoingInterceptors)), parameters);
    }
 
    @Override
    public List<StompFrameInterceptor> filterInterceptors(List<BaseInterceptor> interceptors) {
-      return filterInterceptors(StompFrameInterceptor.class, interceptors);
+      return internalFilterInterceptors(StompFrameInterceptor.class, interceptors);
    }
 
    @Override

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/15ce38e9/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/ProtocolHandler.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/ProtocolHandler.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/ProtocolHandler.java
index 8f965ce..fed7a75 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/ProtocolHandler.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/ProtocolHandler.java
@@ -84,6 +84,10 @@ public class ProtocolHandler {
       }
    }
 
+   public ProtocolManager getProtocol(String name) {
+      return this.protocolMap.get(name);
+   }
+
    class ProtocolDecoder extends ByteToMessageDecoder {
 
       private final boolean http;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/15ce38e9/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/CoreProtocolManagerFactory.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/CoreProtocolManagerFactory.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/CoreProtocolManagerFactory.java
index 2a07606..7fed534 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/CoreProtocolManagerFactory.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/CoreProtocolManagerFactory.java
@@ -17,6 +17,7 @@
 package org.apache.activemq.artemis.core.protocol.core.impl;
 
 import java.util.List;
+import java.util.Map;
 
 import org.apache.activemq.artemis.api.core.BaseInterceptor;
 import org.apache.activemq.artemis.api.core.Interceptor;
@@ -24,6 +25,7 @@ import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.spi.core.protocol.AbstractProtocolManagerFactory;
 import org.apache.activemq.artemis.spi.core.protocol.ProtocolManager;
+import org.apache.activemq.artemis.utils.uri.BeanSupport;
 
 public class CoreProtocolManagerFactory extends AbstractProtocolManagerFactory<Interceptor> {
 
@@ -41,9 +43,10 @@ public class CoreProtocolManagerFactory extends AbstractProtocolManagerFactory<I
     */
    @Override
    public ProtocolManager createProtocolManager(final ActiveMQServer server,
-                                                final List<Interceptor> incomingInterceptors,
-                                                List<Interceptor> outgoingInterceptors) {
-      return new CoreProtocolManager(this, server, incomingInterceptors, outgoingInterceptors);
+                                                Map<String, Object> parameters,
+                                                final List<BaseInterceptor> incomingInterceptors,
+                                                List<BaseInterceptor> outgoingInterceptors) throws Exception {
+      return BeanSupport.setData(new CoreProtocolManager(this, server, filterInterceptors(incomingInterceptors), filterInterceptors(outgoingInterceptors)), parameters);
    }
 
    @Override
@@ -51,7 +54,7 @@ public class CoreProtocolManagerFactory extends AbstractProtocolManagerFactory<I
       // This is using this tool method
       // it wouldn't be possible to write a generic method without this class parameter
       // and I didn't want to bloat the cllaers for this
-      return filterInterceptors(Interceptor.class, interceptors);
+      return internalFilterInterceptors(Interceptor.class, interceptors);
    }
 
    @Override

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/15ce38e9/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMAcceptor.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMAcceptor.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMAcceptor.java
index 795a711..dedd51b 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMAcceptor.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMAcceptor.java
@@ -31,10 +31,11 @@ import org.apache.activemq.artemis.core.server.ActiveMQMessageBundle;
 import org.apache.activemq.artemis.core.server.cluster.ClusterConnection;
 import org.apache.activemq.artemis.core.server.management.Notification;
 import org.apache.activemq.artemis.core.server.management.NotificationService;
+import org.apache.activemq.artemis.spi.core.protocol.ProtocolManager;
 import org.apache.activemq.artemis.spi.core.remoting.Acceptor;
 import org.apache.activemq.artemis.spi.core.remoting.BufferHandler;
 import org.apache.activemq.artemis.spi.core.remoting.Connection;
-import org.apache.activemq.artemis.spi.core.remoting.ConnectionLifeCycleListener;
+import org.apache.activemq.artemis.spi.core.remoting.ServerConnectionLifeCycleListener;
 import org.apache.activemq.artemis.utils.ConfigurationHelper;
 import org.apache.activemq.artemis.utils.ExecutorFactory;
 import org.apache.activemq.artemis.utils.OrderedExecutorFactory;
@@ -46,7 +47,7 @@ public final class InVMAcceptor implements Acceptor {
 
    private final BufferHandler handler;
 
-   private final ConnectionLifeCycleListener listener;
+   private final ServerConnectionLifeCycleListener listener;
 
    private final ConcurrentMap<String, Connection> connections = new ConcurrentHashMap<>();
 
@@ -68,11 +69,14 @@ public final class InVMAcceptor implements Acceptor {
 
    private final String name;
 
+   private final Map<String, ProtocolManager> protocolMap;
+
    public InVMAcceptor(final String name,
                        final ClusterConnection clusterConnection,
                        final Map<String, Object> configuration,
                        final BufferHandler handler,
-                       final ConnectionLifeCycleListener listener,
+                       final ServerConnectionLifeCycleListener listener,
+                       final Map<String, ProtocolManager> protocolMap,
                        final Executor threadPool) {
 
       this.name = name;
@@ -90,6 +94,8 @@ public final class InVMAcceptor implements Acceptor {
       executorFactory = new OrderedExecutorFactory(threadPool);
 
       connectionsAllowed = ConfigurationHelper.getLongProperty(TransportConstants.CONNECTIONS_ALLOWED, TransportConstants.DEFAULT_CONNECTIONS_ALLOWED, configuration);
+
+      this.protocolMap = protocolMap;
    }
 
    @Override
@@ -219,7 +225,7 @@ public final class InVMAcceptor implements Acceptor {
 
       InVMConnection inVMConnection = new InVMConnection(id, connectionID, remoteHandler, connectionListener, clientExecutor, defaultActiveMQPrincipal);
 
-      connectionListener.connectionCreated(this, inVMConnection, ActiveMQClient.DEFAULT_CORE_PROTOCOL);
+      connectionListener.connectionCreated(this, inVMConnection, protocolMap.get(ActiveMQClient.DEFAULT_CORE_PROTOCOL));
    }
 
    public void disconnect(final String connectionID) {
@@ -249,7 +255,7 @@ public final class InVMAcceptor implements Acceptor {
       this.defaultActiveMQPrincipal = defaultActiveMQPrincipal;
    }
 
-   private class Listener implements ConnectionLifeCycleListener {
+   private class Listener implements ServerConnectionLifeCycleListener {
       //private static Listener instance = new Listener();
 
       private final InVMConnector connector;
@@ -261,7 +267,7 @@ public final class InVMAcceptor implements Acceptor {
       @Override
       public void connectionCreated(final ActiveMQComponent component,
                                     final Connection connection,
-                                    final String protocol) {
+                                    final ProtocolManager protocol) {
          if (connections.putIfAbsent((String) connection.getID(), connection) != null) {
             throw ActiveMQMessageBundle.BUNDLE.connectionExists(connection.getID());
          }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/15ce38e9/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMAcceptorFactory.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMAcceptorFactory.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMAcceptorFactory.java
index e28ee3a..d5c9d33 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMAcceptorFactory.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMAcceptorFactory.java
@@ -26,6 +26,7 @@ import org.apache.activemq.artemis.spi.core.remoting.Acceptor;
 import org.apache.activemq.artemis.spi.core.remoting.AcceptorFactory;
 import org.apache.activemq.artemis.spi.core.remoting.BufferHandler;
 import org.apache.activemq.artemis.spi.core.remoting.ConnectionLifeCycleListener;
+import org.apache.activemq.artemis.spi.core.remoting.ServerConnectionLifeCycleListener;
 
 public class InVMAcceptorFactory implements AcceptorFactory {
 
@@ -34,10 +35,10 @@ public class InVMAcceptorFactory implements AcceptorFactory {
                                   final ClusterConnection clusterConnection,
                                   final Map<String, Object> configuration,
                                   final BufferHandler handler,
-                                  final ConnectionLifeCycleListener listener,
+                                  final ServerConnectionLifeCycleListener listener,
                                   final Executor threadPool,
                                   final ScheduledExecutorService scheduledThreadPool,
-                                  final Map<String, ProtocolManager> protocolHandler) {
-      return new InVMAcceptor(name, clusterConnection, configuration, handler, listener, threadPool);
+                                  final Map<String, ProtocolManager> protocolMap) {
+      return new InVMAcceptor(name, clusterConnection, configuration, handler, listener, protocolMap, threadPool);
    }
 }


Mime
View raw message