Improvements to live hovers for request mappings

This commit is contained in:
nsingh
2017-10-12 22:58:18 -07:00
parent 423c6bcaef
commit dd61505bb5
3 changed files with 225 additions and 68 deletions

View File

@@ -169,6 +169,19 @@ public class SpringBootApp {
return null;
}
public Object getRequestMapping(String rawKey) throws Exception {
Object result = getActuatorDataFromAttribute("org.springframework.boot:type=Endpoint,name=requestMappingEndpoint", "Data");
if (result == null) {
result = getActuatorDataFromOperation("org.springframework.boot:type=Endpoint,name=Mappings", "mappings");
}
if (result instanceof HashMap<?, ?>) {
return ((HashMap<?, ?>) result).get(rawKey);
}
return null;
}
public String getAutoConfigReport() throws Exception {
Object result = getActuatorDataFromAttribute("org.springframework.boot:type=Endpoint,name=autoConfigurationReportEndpoint", "Data");
if (result != null) {
@@ -318,15 +331,8 @@ public class SpringBootApp {
public String getHost() throws Exception {
String jmxConnect = this.vm.startLocalManagementAgent();
JMXConnector jmxConnector = null;
try {
JMXServiceURL serviceUrl = new JMXServiceURL(jmxConnect);
return serviceUrl.getHost();
}
finally {
if (jmxConnector != null) jmxConnector.close();
}
JMXServiceURL serviceUrl = new JMXServiceURL(jmxConnect);
return serviceUrl.getHost();
}
}