ARTEMIS-752 fix OSGi protocol parsing

This commit is contained in:
jbertram 2016-09-26 16:26:22 -05:00 committed by Clebert Suconic
parent 1548a4e217
commit 6faaf0445d
1 changed files with 7 additions and 3 deletions

View File

@ -32,6 +32,7 @@ import org.apache.activemq.artemis.api.core.Interceptor;
import org.apache.activemq.artemis.api.core.TransportConfiguration; import org.apache.activemq.artemis.api.core.TransportConfiguration;
import org.apache.activemq.artemis.core.config.FileDeploymentManager; import org.apache.activemq.artemis.core.config.FileDeploymentManager;
import org.apache.activemq.artemis.core.config.impl.FileConfiguration; import org.apache.activemq.artemis.core.config.impl.FileConfiguration;
import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants;
import org.apache.activemq.artemis.core.server.ActiveMQComponent; import org.apache.activemq.artemis.core.server.ActiveMQComponent;
import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.core.server.ActiveMQServer;
import org.apache.activemq.artemis.jms.server.config.impl.FileJMSConfiguration; import org.apache.activemq.artemis.jms.server.config.impl.FileJMSConfiguration;
@ -144,9 +145,12 @@ public class OsgiBroker {
private String[] getRequiredProtocols(Set<TransportConfiguration> acceptors) { private String[] getRequiredProtocols(Set<TransportConfiguration> acceptors) {
ArrayList<String> protocols = new ArrayList<>(); ArrayList<String> protocols = new ArrayList<>();
for (TransportConfiguration acceptor : acceptors) { for (TransportConfiguration acceptor : acceptors) {
String protoName = acceptor.getName().toUpperCase(); String protocolsFromAcceptor = acceptor.getParams().get(TransportConstants.PROTOCOLS_PROP_NAME).toString();
if (!"ARTEMIS".equals(protoName)) { String[] protocolsSplit = protocolsFromAcceptor.split(",");
protocols.add(protoName); for (String protocol : protocolsSplit) {
if (!protocol.contains(protocol)) {
protocols.add(protocol);
}
} }
} }
return protocols.toArray(new String[protocols.size()]); return protocols.toArray(new String[protocols.size()]);