You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@artemis.apache.org by "clebertsuconic (via GitHub)" <gi...@apache.org> on 2026/04/23 18:43:56 UTC
Re: [PR] ARTEMIS-6030 Expose Lock Coordinator Status through management and CLI [artemis]
clebertsuconic commented on code in PR #6380:
URL: https://github.com/apache/artemis/pull/6380#discussion_r3133028387
##########
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;
+
+@CommandLine.Command(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) {
Review Comment:
I changed it to always use the context instead of getActionContext()
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@artemis.apache.org
For additional commands, e-mail: issues-help@artemis.apache.org