ARTEMIS-519 protocol-manager-factory is not implemented on ConnectionFactoryControl

This commit is contained in:
bayern39 2016-05-16 17:11:59 +08:00 committed by jbertram
parent 1ad1366d72
commit b51da98f47
3 changed files with 22 additions and 2 deletions

View File

@ -375,6 +375,16 @@ public interface ConnectionFactoryControl {
*/ */
DiscoveryGroupConfiguration getDiscoveryGroupConfiguration(); 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 * Add the Registry binding to this destination
*/ */

View File

@ -134,11 +134,11 @@ public class ActiveMQConnectionFactory implements Externalizable, Referenceable,
public void setProtocolManagerFactoryStr(final String protocolManagerFactoryStr) { 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<Object>() { AccessController.doPrivileged(new PrivilegedAction<Object>() {
@Override @Override
public Object run() { public Object run() {
ClientProtocolManagerFactory protocolManagerFactory = ClientProtocolManagerFactory protocolManagerFactory =
(ClientProtocolManagerFactory) ClassloadingUtil.newInstanceFromClassLoader(protocolManagerFactoryStr); (ClientProtocolManagerFactory) ClassloadingUtil.newInstanceFromClassLoader(protocolManagerFactoryStr);
serverLocator.setProtocolManagerFactory(protocolManagerFactory); serverLocator.setProtocolManagerFactory(protocolManagerFactory);

View File

@ -431,6 +431,16 @@ public class JMSConnectionFactoryControlImpl extends StandardMBean implements Co
return cfConfig.getTransactionBatchSize(); return cfConfig.getTransactionBatchSize();
} }
@Override
public void setProtocolManagerFactoryStr(String protocolManagerFactoryStr) {
cfConfig.setProtocolManagerFactoryStr(protocolManagerFactoryStr);
recreateCF();
}
@Override
public String getProtocolManagerFactoryStr() {
return cfConfig.getProtocolManagerFactoryStr();
}
@Override @Override
public boolean isAutoGroup() { public boolean isAutoGroup() {
return cfConfig.isAutoGroup(); return cfConfig.isAutoGroup();