This closes #3121
This commit is contained in:
commit
9f9c8f6a36
|
@ -42,6 +42,12 @@ public class BaseBroadcastGroupControlImpl extends AbstractControl implements Ba
|
||||||
|
|
||||||
// Constructors --------------------------------------------------
|
// Constructors --------------------------------------------------
|
||||||
|
|
||||||
|
public BaseBroadcastGroupControlImpl(final BroadcastGroup broadcastGroup,
|
||||||
|
final StorageManager storageManager,
|
||||||
|
final BroadcastGroupConfiguration configuration) throws Exception {
|
||||||
|
this(BaseBroadcastGroupControl.class, broadcastGroup, storageManager, configuration);
|
||||||
|
}
|
||||||
|
|
||||||
public BaseBroadcastGroupControlImpl(final Class broadcastGroupControlClass,
|
public BaseBroadcastGroupControlImpl(final Class broadcastGroupControlClass,
|
||||||
final BroadcastGroup broadcastGroup,
|
final BroadcastGroup broadcastGroup,
|
||||||
final StorageManager storageManager,
|
final StorageManager storageManager,
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
|
* this work for additional information regarding copyright ownership.
|
||||||
|
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||||
|
* (the "License"); you may not use this file except in compliance with
|
||||||
|
* the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.apache.activemq.artemis.core.management.impl;
|
||||||
|
|
||||||
|
import org.apache.activemq.artemis.api.core.management.Attribute;
|
||||||
|
import org.apache.activemq.artemis.api.core.management.JGroupsChannelBroadcastGroupControl;
|
||||||
|
|
||||||
|
public interface JGroupsPropertiesBroadcastGroupControl extends JGroupsChannelBroadcastGroupControl {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the JGroups properties
|
||||||
|
*/
|
||||||
|
@Attribute(desc = "Returns the JGroups properties")
|
||||||
|
String getProperties();
|
||||||
|
}
|
|
@ -0,0 +1,71 @@
|
||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
|
* this work for additional information regarding copyright ownership.
|
||||||
|
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||||
|
* (the "License"); you may not use this file except in compliance with
|
||||||
|
* the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.apache.activemq.artemis.core.management.impl;
|
||||||
|
|
||||||
|
import org.apache.activemq.artemis.api.core.BroadcastGroupConfiguration;
|
||||||
|
import org.apache.activemq.artemis.api.core.JGroupsPropertiesBroadcastEndpointFactory;
|
||||||
|
import org.apache.activemq.artemis.api.core.management.JGroupsChannelBroadcastGroupControl;
|
||||||
|
import org.apache.activemq.artemis.core.persistence.StorageManager;
|
||||||
|
import org.apache.activemq.artemis.core.server.cluster.BroadcastGroup;
|
||||||
|
import org.apache.activemq.artemis.logs.AuditLogger;
|
||||||
|
|
||||||
|
public class JGroupsPropertiesBroadcastGroupControlImpl extends BaseBroadcastGroupControlImpl implements JGroupsPropertiesBroadcastGroupControl {
|
||||||
|
|
||||||
|
// Constants -----------------------------------------------------
|
||||||
|
|
||||||
|
// Attributes ----------------------------------------------------
|
||||||
|
|
||||||
|
private JGroupsPropertiesBroadcastEndpointFactory endpointFactory;
|
||||||
|
|
||||||
|
// Static --------------------------------------------------------
|
||||||
|
|
||||||
|
// Constructors --------------------------------------------------
|
||||||
|
|
||||||
|
public JGroupsPropertiesBroadcastGroupControlImpl(final BroadcastGroup broadcastGroup,
|
||||||
|
final StorageManager storageManager,
|
||||||
|
final BroadcastGroupConfiguration configuration,
|
||||||
|
final JGroupsPropertiesBroadcastEndpointFactory endpointFactory) throws Exception {
|
||||||
|
super(JGroupsChannelBroadcastGroupControl.class, broadcastGroup, storageManager, configuration);
|
||||||
|
this.endpointFactory = endpointFactory;
|
||||||
|
}
|
||||||
|
|
||||||
|
// BroadcastGroupControlMBean implementation ---------------------
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getChannelName() throws Exception {
|
||||||
|
if (AuditLogger.isEnabled()) {
|
||||||
|
AuditLogger.getChannelName(this.endpointFactory.getChannelName());
|
||||||
|
}
|
||||||
|
return endpointFactory.getChannelName();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getProperties() {
|
||||||
|
return endpointFactory.getProperties();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Public --------------------------------------------------------
|
||||||
|
|
||||||
|
// Package protected ---------------------------------------------
|
||||||
|
|
||||||
|
// Protected -----------------------------------------------------
|
||||||
|
|
||||||
|
// Private -------------------------------------------------------
|
||||||
|
|
||||||
|
// Inner classes -------------------------------------------------
|
||||||
|
|
||||||
|
}
|
|
@ -39,6 +39,7 @@ import org.apache.activemq.artemis.api.core.BroadcastGroupConfiguration;
|
||||||
import org.apache.activemq.artemis.api.core.ChannelBroadcastEndpointFactory;
|
import org.apache.activemq.artemis.api.core.ChannelBroadcastEndpointFactory;
|
||||||
import org.apache.activemq.artemis.api.core.ICoreMessage;
|
import org.apache.activemq.artemis.api.core.ICoreMessage;
|
||||||
import org.apache.activemq.artemis.api.core.JGroupsFileBroadcastEndpointFactory;
|
import org.apache.activemq.artemis.api.core.JGroupsFileBroadcastEndpointFactory;
|
||||||
|
import org.apache.activemq.artemis.api.core.JGroupsPropertiesBroadcastEndpointFactory;
|
||||||
import org.apache.activemq.artemis.api.core.JsonUtil;
|
import org.apache.activemq.artemis.api.core.JsonUtil;
|
||||||
import org.apache.activemq.artemis.api.core.Message;
|
import org.apache.activemq.artemis.api.core.Message;
|
||||||
import org.apache.activemq.artemis.api.core.RoutingType;
|
import org.apache.activemq.artemis.api.core.RoutingType;
|
||||||
|
@ -60,12 +61,14 @@ import org.apache.activemq.artemis.core.config.DivertConfiguration;
|
||||||
import org.apache.activemq.artemis.core.management.impl.AcceptorControlImpl;
|
import org.apache.activemq.artemis.core.management.impl.AcceptorControlImpl;
|
||||||
import org.apache.activemq.artemis.core.management.impl.ActiveMQServerControlImpl;
|
import org.apache.activemq.artemis.core.management.impl.ActiveMQServerControlImpl;
|
||||||
import org.apache.activemq.artemis.core.management.impl.AddressControlImpl;
|
import org.apache.activemq.artemis.core.management.impl.AddressControlImpl;
|
||||||
|
import org.apache.activemq.artemis.core.management.impl.BaseBroadcastGroupControlImpl;
|
||||||
import org.apache.activemq.artemis.core.management.impl.BridgeControlImpl;
|
import org.apache.activemq.artemis.core.management.impl.BridgeControlImpl;
|
||||||
import org.apache.activemq.artemis.core.management.impl.BroadcastGroupControlImpl;
|
import org.apache.activemq.artemis.core.management.impl.BroadcastGroupControlImpl;
|
||||||
import org.apache.activemq.artemis.core.management.impl.ClusterConnectionControlImpl;
|
import org.apache.activemq.artemis.core.management.impl.ClusterConnectionControlImpl;
|
||||||
import org.apache.activemq.artemis.core.management.impl.DivertControlImpl;
|
import org.apache.activemq.artemis.core.management.impl.DivertControlImpl;
|
||||||
import org.apache.activemq.artemis.core.management.impl.JGroupsChannelBroadcastGroupControlImpl;
|
import org.apache.activemq.artemis.core.management.impl.JGroupsChannelBroadcastGroupControlImpl;
|
||||||
import org.apache.activemq.artemis.core.management.impl.JGroupsFileBroadcastGroupControlImpl;
|
import org.apache.activemq.artemis.core.management.impl.JGroupsFileBroadcastGroupControlImpl;
|
||||||
|
import org.apache.activemq.artemis.core.management.impl.JGroupsPropertiesBroadcastGroupControlImpl;
|
||||||
import org.apache.activemq.artemis.core.management.impl.QueueControlImpl;
|
import org.apache.activemq.artemis.core.management.impl.QueueControlImpl;
|
||||||
import org.apache.activemq.artemis.core.message.impl.CoreMessage;
|
import org.apache.activemq.artemis.core.message.impl.CoreMessage;
|
||||||
import org.apache.activemq.artemis.core.messagecounter.MessageCounter;
|
import org.apache.activemq.artemis.core.messagecounter.MessageCounter;
|
||||||
|
@ -353,10 +356,17 @@ public class ManagementServiceImpl implements ManagementService {
|
||||||
control = new JGroupsFileBroadcastGroupControlImpl(broadcastGroup, storageManager, configuration, (JGroupsFileBroadcastEndpointFactory) endpointFactory);
|
control = new JGroupsFileBroadcastGroupControlImpl(broadcastGroup, storageManager, configuration, (JGroupsFileBroadcastEndpointFactory) endpointFactory);
|
||||||
} else if (endpointFactory instanceof ChannelBroadcastEndpointFactory) {
|
} else if (endpointFactory instanceof ChannelBroadcastEndpointFactory) {
|
||||||
control = new JGroupsChannelBroadcastGroupControlImpl(broadcastGroup, storageManager, configuration, (ChannelBroadcastEndpointFactory) endpointFactory);
|
control = new JGroupsChannelBroadcastGroupControlImpl(broadcastGroup, storageManager, configuration, (ChannelBroadcastEndpointFactory) endpointFactory);
|
||||||
|
} else if (endpointFactory instanceof JGroupsPropertiesBroadcastEndpointFactory) {
|
||||||
|
control = new JGroupsPropertiesBroadcastGroupControlImpl(broadcastGroup, storageManager, configuration, (JGroupsPropertiesBroadcastEndpointFactory) endpointFactory);
|
||||||
|
} else {
|
||||||
|
control = new BaseBroadcastGroupControlImpl(broadcastGroup, storageManager, configuration);
|
||||||
}
|
}
|
||||||
|
//shouldnt ever be null
|
||||||
|
if (control != null) {
|
||||||
registerInJMX(objectName, control);
|
registerInJMX(objectName, control);
|
||||||
registerInRegistry(ResourceNames.BROADCAST_GROUP + configuration.getName(), control);
|
registerInRegistry(ResourceNames.BROADCAST_GROUP + configuration.getName(), control);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public synchronized void unregisterBroadcastGroup(final String name) throws Exception {
|
public synchronized void unregisterBroadcastGroup(final String name) throws Exception {
|
||||||
|
|
Loading…
Reference in New Issue