This is an automated email from the ASF dual-hosted git repository.
albumenj pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo.git
The following commit(s) were added to refs/heads/master by this push:
new 8892a36 Optimize StatusTelnetHandler code and extract constants
(#8041)
8892a36 is described below
commit 8892a362b0ce740b45aa275e97688d048c49f17e
Author: xiaoheng1 <[email protected]>
AuthorDate: Tue Jun 15 17:48:48 2021 +0800
Optimize StatusTelnetHandler code and extract constants (#8041)
---
.../dubbo/remoting/telnet/support/command/StatusTelnetHandler.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git
a/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/telnet/support/command/StatusTelnetHandler.java
b/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/telnet/support/command/StatusTelnetHandler.java
index b64e708..692fb68 100644
---
a/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/telnet/support/command/StatusTelnetHandler.java
+++
b/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/telnet/support/command/StatusTelnetHandler.java
@@ -34,6 +34,7 @@ import java.util.List;
import java.util.Map;
import static
org.apache.dubbo.common.constants.CommonConstants.COMMA_SPLIT_PATTERN;
+import static org.apache.dubbo.config.Constants.STATUS_KEY;
/**
* StatusTelnetHandler
@@ -47,7 +48,7 @@ public class StatusTelnetHandler implements TelnetHandler {
@Override
public String telnet(Channel channel, String message) {
if ("-l".equals(message)) {
- List<StatusChecker> checkers =
extensionLoader.getActivateExtension(channel.getUrl(), "status");
+ List<StatusChecker> checkers =
extensionLoader.getActivateExtension(channel.getUrl(), STATUS_KEY);
String[] header = new String[]{"resource", "status", "message"};
List<List<String>> table = new ArrayList<List<String>>();
Map<String, Status> statuses = new HashMap<String, Status>();
@@ -80,7 +81,7 @@ public class StatusTelnetHandler implements TelnetHandler {
} else if (message.length() > 0) {
return "Unsupported parameter " + message + " for status.";
}
- String status = channel.getUrl().getParameter("status");
+ String status = channel.getUrl().getParameter(STATUS_KEY);
Map<String, Status> statuses = new HashMap<String, Status>();
if (StringUtils.isNotEmpty(status)) {
String[] ss = COMMA_SPLIT_PATTERN.split(status);