This is an automated email from the ASF dual-hosted git repository.
clebertsuconic pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/artemis.git
The following commit(s) were added to refs/heads/main by this push:
new 547854901e ARTEMIS-6030 Expose Lock Coordinator Status through
management and CLI
547854901e is described below
commit 547854901e536c56bc8905559f637965aaf88dd8
Author: Clebert Suconic <[email protected]>
AuthorDate: Thu Apr 23 11:01:39 2026 -0400
ARTEMIS-6030 Expose Lock Coordinator Status through management and CLI
---
.../org/apache/activemq/artemis/cli/Artemis.java | 2 +
.../artemis/cli/commands/lock/LockGroup.java | 38 +++++
.../artemis/cli/commands/lock/LockList.java | 104 +++++++++++++
.../apache/activemq/artemis/logs/AuditLogger.java | 7 +
.../api/core/management/ActiveMQServerControl.java | 3 +
.../api/core/management/SimpleManagement.java | 3 +
.../management/impl/ActiveMQServerControlImpl.java | 30 ++++
.../artemis/core/server/ActiveMQServer.java | 2 +
.../core/server/impl/ActiveMQServerImpl.java | 5 +
.../artemis/core/server/lock/LockCoordinator.java | 10 +-
.../management/ActiveMQServerControlTest.java | 162 ++++++++++++++++++++-
.../ActiveMQServerControlUsingCoreTest.java | 10 ++
12 files changed, 373 insertions(+), 3 deletions(-)
diff --git
a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/Artemis.java
b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/Artemis.java
index 5105b5bec0..ba763fd567 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/Artemis.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/Artemis.java
@@ -45,6 +45,7 @@ import org.apache.activemq.artemis.cli.commands.Upgrade;
import org.apache.activemq.artemis.cli.commands.activation.ActivationGroup;
import org.apache.activemq.artemis.cli.commands.address.AddressGroup;
import org.apache.activemq.artemis.cli.commands.check.CheckGroup;
+import org.apache.activemq.artemis.cli.commands.lock.LockGroup;
import org.apache.activemq.artemis.cli.commands.messages.Browse;
import org.apache.activemq.artemis.cli.commands.Connect;
import org.apache.activemq.artemis.cli.commands.messages.Consumer;
@@ -282,6 +283,7 @@ public class Artemis implements Runnable {
}
if (includeInstanceCommands) {
+ commandLine.addSubcommand(new LockGroup(commandLine));
commandLine.addSubcommand(new ExportProperties());
commandLine.addSubcommand(new ActivationGroup(commandLine));
commandLine.addSubcommand(new DataGroup(commandLine));
diff --git
a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/lock/LockGroup.java
b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/lock/LockGroup.java
new file mode 100644
index 0000000000..3df2a031f4
--- /dev/null
+++
b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/lock/LockGroup.java
@@ -0,0 +1,38 @@
+/*
+ * 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.cli.commands.lock;
+
+import org.apache.activemq.artemis.cli.commands.HelpAction;
+import picocli.CommandLine;
+import picocli.CommandLine.Command;
+
+@Command(name = "lock", description = "Lock coordinators group. use 'help
lock' for sub commands list", subcommands = {LockList.class})
+public class LockGroup implements Runnable {
+
+ CommandLine commandLine;
+
+ public LockGroup(CommandLine commandLine) {
+ this.commandLine = commandLine;
+ }
+
+ @Override
+ public void run() {
+ HelpAction.help(commandLine, "lock");
+ }
+
+}
diff --git
a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/lock/LockList.java
b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/lock/LockList.java
new file mode 100644
index 0000000000..7fe76655e1
--- /dev/null
+++
b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/lock/LockList.java
@@ -0,0 +1,104 @@
+/*
+ * 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.cli.commands.lock;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.activemq.artemis.api.core.management.SimpleManagement;
+import org.apache.activemq.artemis.cli.Terminal;
+import org.apache.activemq.artemis.cli.commands.ActionContext;
+import org.apache.activemq.artemis.cli.commands.messages.ConnectionAbstract;
+import org.apache.activemq.artemis.json.JsonArray;
+import org.apache.activemq.artemis.json.JsonObject;
+import org.apache.activemq.artemis.utils.TableOut;
+import picocli.CommandLine;
+
[email protected](name = "list", description = "List the lock coordinators
and their status on the server.")
+public class LockList extends ConnectionAbstract {
+
+ @Override
+ public Object execute(ActionContext context) throws Exception {
+ super.execute(context);
+ stat(context);
+ return null;
+ }
+
+ private void stat(final ActionContext context) throws Exception {
+ try (SimpleManagement simpleManagement = new SimpleManagement(brokerURL,
user, password).open()) {
+ JsonArray lockList = simpleManagement.listLockCoordinators();
+ printStats(context, lockList);
+ }
+ }
+
+ private void printStats(ActionContext context, JsonArray array) {
+ if (array.size() == 0) {
+ context.out.println(Terminal.INFO_COLOR_UNICODE + "No Lock
Coordinators configured" + Terminal.CLEAR_UNICODE);
+ context.out.println();
+ return;
+ }
+
+ String[] fieldNames = {"NAME", "CLASS_NAME", "LOCK_ID", "LOCKED",
"STARTED"};
+ int[] columnSizes = new int[fieldNames.length];
+ boolean[] centralize = new boolean[fieldNames.length];
+ List<String>[] fieldTitles = new ArrayList[fieldNames.length];
+
+ // Calculate column sizes and split field names
+ for (int i = 0; i < fieldNames.length; i++) {
+ List<String> splitTitleArrayList = new ArrayList<>();
+ String[] splitTitleStringArray = fieldNames[i].split("_");
+
+ for (String s : splitTitleStringArray) {
+ splitTitleArrayList.add(s);
+ columnSizes[i] = Math.max(columnSizes[i], s.length());
+ }
+
+ fieldTitles[i] = splitTitleArrayList;
+ }
+
+ // Calculate column sizes based on data
+ for (int i = 0; i < array.size(); i++) {
+ JsonObject lock = array.getJsonObject(i);
+ columnSizes[0] = Math.max(columnSizes[0], lock.getString("name",
"").length());
+ columnSizes[1] = Math.max(columnSizes[1],
lock.getString("simpleName", "").length());
+ columnSizes[2] = Math.max(columnSizes[2], lock.getString("lockId",
"").length());
+ columnSizes[3] = Math.max(columnSizes[3],
String.valueOf(lock.getBoolean("locked")).length());
+ columnSizes[4] = Math.max(columnSizes[4],
String.valueOf(lock.getBoolean("started")).length());
+ }
+
+ TableOut tableOut = new TableOut("|", 2, columnSizes);
+
+ // Print header
+ tableOut.print(context.out, fieldTitles, centralize);
+
+ // Print data rows
+ for (int i = 0; i < array.size(); i++) {
+ JsonObject lock = array.getJsonObject(i);
+ String[] columns = {
+ lock.getString("name", ""),
+ lock.getString("simpleName", ""),
+ lock.getString("lockId", ""),
+ String.valueOf(lock.getBoolean("locked")),
+ String.valueOf(lock.getBoolean("started"))
+ };
+ tableOut.print(context.out, columns, centralize);
+ }
+ context.out.println();
+ }
+
+}
diff --git
a/artemis-commons/src/main/java/org/apache/activemq/artemis/logs/AuditLogger.java
b/artemis-commons/src/main/java/org/apache/activemq/artemis/logs/AuditLogger.java
index 353911e296..41a4f0bc06 100644
---
a/artemis-commons/src/main/java/org/apache/activemq/artemis/logs/AuditLogger.java
+++
b/artemis-commons/src/main/java/org/apache/activemq/artemis/logs/AuditLogger.java
@@ -2905,4 +2905,11 @@ public interface AuditLogger {
@LogMessage(id = 601803, value = "User {} is getting BlockedViaManagement
on target resource: {}", level = LogMessage.Level.INFO)
void isBlockedViaManagement(String user, Object source);
+ static void listLockCoordinatorsAsJSON(Object source) {
+ BASE_LOGGER.listLockCoordinatorsAsJSON(getCaller(), source);
+ }
+
+ @LogMessage(id = 601804, value = "User {} is listing lock coordinators as
json on target resource: {}", level = LogMessage.Level.INFO)
+ void listLockCoordinatorsAsJSON(String user, Object source);
+
}
diff --git
a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.java
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.java
index 65e398234a..1d19b8ece6 100644
---
a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.java
+++
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.java
@@ -59,6 +59,9 @@ public interface ActiveMQServerControl {
@Attribute(desc = IS_ACTIVE_DESCRIPTION)
boolean isActive();
+ @Operation(desc = "Return the status of lock coordinators")
+ String listLockCoordinatorsAsJSON();
+
/**
* {@return the number of clients connected to this server.}
*/
diff --git
a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/SimpleManagement.java
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/SimpleManagement.java
index 65e066d8a6..d8e72d3ec7 100644
---
a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/SimpleManagement.java
+++
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/SimpleManagement.java
@@ -169,6 +169,9 @@ public class SimpleManagement implements AutoCloseable {
return consumersAsJSON.size();
}
+ public JsonArray listLockCoordinators() throws Exception {
+ return JsonUtil.readJsonArray(simpleManagement("broker",
"listLockCoordinatorsAsJSON"));
+ }
public long getMessagesAddedOnQueue(String queueName) throws Exception {
return simpleManagementLong(ResourceNames.QUEUE + queueName,
"getMessagesAdded");
diff --git
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
index 4ae62bcb4d..1f577b520c 100644
---
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
+++
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
@@ -125,6 +125,7 @@ import
org.apache.activemq.artemis.core.server.cluster.ha.PrimaryOnlyPolicy;
import org.apache.activemq.artemis.core.server.cluster.ha.ScaleDownPolicy;
import
org.apache.activemq.artemis.core.server.cluster.ha.SharedStoreBackupPolicy;
import org.apache.activemq.artemis.core.server.group.GroupingHandler;
+import org.apache.activemq.artemis.core.server.lock.LockCoordinator;
import org.apache.activemq.artemis.core.server.impl.Activation;
import org.apache.activemq.artemis.core.server.impl.AddressInfo;
import
org.apache.activemq.artemis.core.server.impl.SharedNothingPrimaryActivation;
@@ -4756,6 +4757,35 @@ public class ActiveMQServerControlImpl extends
AbstractControl implements Active
}
}
+ @Override
+ public String listLockCoordinatorsAsJSON() {
+ if (AuditLogger.isBaseLoggingEnabled()) {
+ AuditLogger.listLockCoordinatorsAsJSON(this.server);
+ }
+ checkStarted();
+
+ clearIO();
+ try {
+ List<LockCoordinator> coordinators = server.getLockCoordinators();
+
+ JsonArrayBuilder array = JsonLoader.createArrayBuilder();
+ coordinators.forEach(l -> {
+ JsonObjectBuilder objectBuilder = JsonLoader.createObjectBuilder();
+ objectBuilder.add("name", l.getName());
+ objectBuilder.add("lockId", l.getLockId());
+ objectBuilder.add("className",
l.getLockManager().getClass().getName());
+ objectBuilder.add("simpleName",
l.getLockManager().getClass().getSimpleName());
+ objectBuilder.add("locked", l.isLocked());
+ objectBuilder.add("started", l.isStarted());
+ array.add(objectBuilder);
+ });
+
+ return array.build().toString();
+ } finally {
+ blockOnIO();
+ }
+ }
+
public ActiveMQServer getServer() {
return server;
}
diff --git
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServer.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServer.java
index 0cf0bff50c..6db12d2d5b 100644
---
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServer.java
+++
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServer.java
@@ -183,6 +183,8 @@ public interface ActiveMQServer extends ServiceComponent {
CriticalAnalyzer getCriticalAnalyzer();
+ List<LockCoordinator> getLockCoordinators();
+
LockCoordinator getLockCoordinator(String name);
void updateStatus(String component, String statusJson);
diff --git
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
index c3db8beead..75e5e0284f 100644
---
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
+++
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
@@ -564,6 +564,11 @@ public class ActiveMQServerImpl implements ActiveMQServer {
return lockCoordinators.get(name);
}
+ @Override
+ public List<LockCoordinator> getLockCoordinators() {
+ return new ArrayList<>(lockCoordinators.values());
+ }
+
@Override
public void replay(Date start, Date end, String address, String target,
String filter) throws Exception {
if (replayManager == null) {
diff --git
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/lock/LockCoordinator.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/lock/LockCoordinator.java
index e4f9cb7483..a186b34979 100644
---
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/lock/LockCoordinator.java
+++
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/lock/LockCoordinator.java
@@ -72,7 +72,6 @@ public class LockCoordinator extends
ActiveMQScheduledComponent {
private final ArrayList<PrioritizedCallback> lockAcquiredCallback = new
ArrayList<>();
private final ArrayList<PrioritizedCallback> lockReleasedCallback = new
ArrayList<>();
- private final long checkPeriod;
private final String name;
private final String lockID;
@@ -84,6 +83,14 @@ public class LockCoordinator extends
ActiveMQScheduledComponent {
return lockManager;
}
+ public String getName() {
+ return name;
+ }
+
+ public String getLockId() {
+ return lockID;
+ }
+
/**
* Registers a callback to be executed when lock is acquired.
* If the lock is already held when this method is called, the callback
@@ -205,7 +212,6 @@ public class LockCoordinator extends
ActiveMQScheduledComponent {
super(scheduledExecutor, executor, checkPeriod, checkPeriod,
TimeUnit.MILLISECONDS, false);
assert executor != null;
this.lockManager = lockManager;
- this.checkPeriod = checkPeriod;
this.lockID = lockID;
this.name = name;
}
diff --git
a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java
index d6a5925dce..6b21b758bb 100644
---
a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java
+++
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java
@@ -45,6 +45,9 @@ import java.util.Properties;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
@@ -85,6 +88,7 @@ import
org.apache.activemq.artemis.core.config.BridgeConfiguration;
import org.apache.activemq.artemis.core.config.ClusterConnectionConfiguration;
import org.apache.activemq.artemis.core.config.Configuration;
import org.apache.activemq.artemis.core.config.DivertConfiguration;
+import org.apache.activemq.artemis.core.config.LockCoordinatorConfiguration;
import
org.apache.activemq.artemis.core.config.brokerConnectivity.BrokerConnectConfiguration;
import org.apache.activemq.artemis.core.config.impl.SecurityConfiguration;
import
org.apache.activemq.artemis.core.management.impl.ActiveMQServerControlImpl;
@@ -124,6 +128,10 @@ import
org.apache.activemq.artemis.jms.client.ActiveMQSession;
import org.apache.activemq.artemis.json.JsonArray;
import org.apache.activemq.artemis.json.JsonObject;
import org.apache.activemq.artemis.json.JsonValue;
+import org.apache.activemq.artemis.lockmanager.DistributedLock;
+import org.apache.activemq.artemis.lockmanager.DistributedLockManager;
+import org.apache.activemq.artemis.lockmanager.MutableLong;
+import org.apache.activemq.artemis.lockmanager.UnavailableStateException;
import org.apache.activemq.artemis.marker.WebServerComponentMarker;
import org.apache.activemq.artemis.nativo.jlibaio.LibaioContext;
import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection;
@@ -6565,6 +6573,69 @@ public class ActiveMQServerControlTest extends
ManagementTestBase {
}
}
+ @TestTemplate
+ public void testListLockCoordinators() throws Exception {
+ server.stop();
+
+ // Add two lock coordinator configurations using File implementation
+ LockCoordinatorConfiguration lock1 = new LockCoordinatorConfiguration();
+ lock1.setName("coordinator1");
+ lock1.setLockId("lock-id-1");
+ lock1.setClassName(MyFakeLockManager.class.getName());
+ lock1.setCheckPeriod(5000);
+
+ LockCoordinatorConfiguration lock2 = new LockCoordinatorConfiguration();
+ lock2.setName("coordinator2");
+ lock2.setLockId("lock-id-2");
+ lock2.setClassName(MyFakeLockManager.class.getName());
+ lock2.setCheckPeriod(10000);
+
+ conf.addLockCoordinatorConfiguration(lock1);
+ conf.addLockCoordinatorConfiguration(lock2);
+
+ server.start();
+
+ ActiveMQServerControl serverControl = createManagementControl();
+ String jsonString = serverControl.listLockCoordinatorsAsJSON();
+ assertNotNull(jsonString);
+
+ JsonArray array = JsonUtil.readJsonArray(jsonString);
+ assertEquals(2, array.size());
+
+ // Check first coordinator
+ JsonObject coord1 = array.getJsonObject(0);
+ assertEquals("coordinator1", coord1.getString("name"));
+ assertEquals(MyFakeLockManager.class.getName(),
coord1.getString("className"));
+ assertEquals(MyFakeLockManager.class.getSimpleName(),
coord1.getString("simpleName"));
+ assertTrue(coord1.containsKey("locked"));
+ assertTrue(coord1.containsKey("started"));
+
+ // Check second coordinator
+ JsonObject coord2 = array.getJsonObject(1);
+ assertEquals("coordinator2", coord2.getString("name"));
+ assertEquals(MyFakeLockManager.class.getName(),
coord2.getString("className"));
+ assertEquals(MyFakeLockManager.class.getSimpleName(),
coord2.getString("simpleName"));
+ assertTrue(coord2.containsKey("locked"));
+ assertTrue(coord2.containsKey("started"));
+ }
+
+
+ @TestTemplate
+ public void testEmptyLockCoordinators() throws Exception {
+ server.stop();
+
+ server.start();
+
+ ActiveMQServerControl serverControl = createManagementControl();
+ String jsonString = serverControl.listLockCoordinatorsAsJSON();
+ assertNotNull(jsonString);
+
+ JsonArray array = JsonUtil.readJsonArray(jsonString);
+ assertEquals(0, array.size());
+ }
+
+
+
class FakeWebServerComponent implements ServiceComponent,
WebServerComponentMarker {
AtomicBoolean started = new AtomicBoolean(false);
AtomicLong startTime = new AtomicLong(0);
@@ -6771,5 +6842,94 @@ public class ActiveMQServerControlTest extends
ManagementTestBase {
public void registered(ActiveMQServer server) {
}
}
-}
+ public static class MyFakeLockManager implements DistributedLockManager {
+
+ public MyFakeLockManager(Map<String, String> parameters) {
+ }
+
+ @Override
+ public void addUnavailableManagerListener(UnavailableManagerListener
listener) {
+
+ }
+
+ @Override
+ public void removeUnavailableManagerListener(UnavailableManagerListener
listener) {
+
+ }
+
+ @Override
+ public boolean start(long timeout, TimeUnit unit) throws
InterruptedException, ExecutionException {
+ return true;
+ }
+
+ @Override
+ public void start() throws InterruptedException, ExecutionException {
+
+ }
+
+ @Override
+ public boolean isStarted() {
+ return true;
+ }
+
+ @Override
+ public void stop() {
+
+ }
+
+ @Override
+ public DistributedLock getDistributedLock(String lockId) throws
InterruptedException, ExecutionException, TimeoutException {
+ return new MyLock(lockId);
+ }
+
+ @Override
+ public MutableLong getMutableLong(String mutableLongId) throws
InterruptedException, ExecutionException, TimeoutException {
+ return null;
+ }
+ }
+
+ public static class MyLock implements DistributedLock {
+
+ public MyLock(String lockId) {
+ this.lockId = lockId;
+ }
+
+ String lockId;
+
+ @Override
+ public String getLockId() {
+ return lockId;
+ }
+
+ @Override
+ public boolean isHeldByCaller() throws UnavailableStateException {
+ return true;
+ }
+
+ @Override
+ public boolean tryLock() throws UnavailableStateException,
InterruptedException {
+ return true;
+ }
+
+ @Override
+ public void unlock() throws UnavailableStateException {
+
+ }
+
+ @Override
+ public void addListener(UnavailableLockListener listener) {
+
+ }
+
+ @Override
+ public void removeListener(UnavailableLockListener listener) {
+
+ }
+
+ @Override
+ public void close() {
+
+ }
+ }
+}
\ No newline at end of file
diff --git
a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java
index c0a1c28ddd..f7496a4b0e 100644
---
a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java
+++
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java
@@ -1882,6 +1882,16 @@ public class ActiveMQServerControlUsingCoreTest extends
ActiveMQServerControlTes
public void exportConfigAsProperties() throws Exception {
proxy.invokeOperation("exportConfigAsProperties");
}
+
+ @Override
+ public String listLockCoordinatorsAsJSON() {
+ try {
+ return (String)
proxy.invokeOperation("listLockCoordinatorsAsJSON");
+ } catch (Throwable throwable) {
+ throwable.printStackTrace();
+ return null;
+ }
+ }
};
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]