diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/management/ConnectionFactoryControl.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/management/ConnectionFactoryControl.java index 52722f352f..f3ddd6268d 100644 --- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/management/ConnectionFactoryControl.java +++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/management/ConnectionFactoryControl.java @@ -375,6 +375,16 @@ public interface ConnectionFactoryControl { */ DiscoveryGroupConfiguration getDiscoveryGroupConfiguration(); + /** + * get the protocol manager factory name + */ + String getProtocolManagerFactoryStr(); + + /** + * set the protocol manager factory name + */ + void setProtocolManagerFactoryStr(String protocolManagerFactoryStr); + /** * Add the Registry binding to this destination */ diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQConnectionFactory.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQConnectionFactory.java index 0dce3fcb89..ce2aa3a488 100644 --- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQConnectionFactory.java +++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQConnectionFactory.java @@ -134,11 +134,11 @@ public class ActiveMQConnectionFactory implements Externalizable, Referenceable, public void setProtocolManagerFactoryStr(final String protocolManagerFactoryStr) { - if (protocolManagerFactoryStr != null && !protocolManagerFactoryStr.trim().isEmpty()) { + if (protocolManagerFactoryStr != null && !protocolManagerFactoryStr.trim().isEmpty() && + !protocolManagerFactoryStr.equals("undefined")) { AccessController.doPrivileged(new PrivilegedAction() { @Override public Object run() { - ClientProtocolManagerFactory protocolManagerFactory = (ClientProtocolManagerFactory) ClassloadingUtil.newInstanceFromClassLoader(protocolManagerFactoryStr); serverLocator.setProtocolManagerFactory(protocolManagerFactory); diff --git a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/management/impl/JMSConnectionFactoryControlImpl.java b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/management/impl/JMSConnectionFactoryControlImpl.java index 15f165e3ea..71239c770b 100644 --- a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/management/impl/JMSConnectionFactoryControlImpl.java +++ b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/management/impl/JMSConnectionFactoryControlImpl.java @@ -431,6 +431,16 @@ public class JMSConnectionFactoryControlImpl extends StandardMBean implements Co return cfConfig.getTransactionBatchSize(); } + @Override + public void setProtocolManagerFactoryStr(String protocolManagerFactoryStr) { + cfConfig.setProtocolManagerFactoryStr(protocolManagerFactoryStr); + recreateCF(); + } + + @Override + public String getProtocolManagerFactoryStr() { + return cfConfig.getProtocolManagerFactoryStr(); + } @Override public boolean isAutoGroup() { return cfConfig.isAutoGroup();