This commit is contained in:
jackdaw@loafle.com 2017-04-14 11:00:45 +09:00
parent 57beece37a
commit 696921c48d

View File

@ -1,6 +1,7 @@
package com.loafle.overflow.crawler.jmx; package com.loafle.overflow.crawler.jmx;
import com.loafle.overflow.crawler.Crawler; import com.loafle.overflow.crawler.Crawler;
import com.loafle.overflow.crawler.config.Config;
import javax.management.*; import javax.management.*;
import javax.management.openmbean.CompositeData; import javax.management.openmbean.CompositeData;
@ -36,7 +37,7 @@ public class JmxCrawler extends Crawler{
private List<Object> result = new ArrayList<>(); private List<Object> result = new ArrayList<>();
@Override @Override
public Object getInternal(Map<String, Object> map) throws Exception { public Object getInternal(Config config) throws Exception {
MBeanReceiver m = new MBeanReceiver() { MBeanReceiver m = new MBeanReceiver() {
@Override @Override
@ -47,20 +48,20 @@ public class JmxCrawler extends Crawler{
} }
}; };
String jmxUrl = (String) map.get("jmxUrl"); // String jmxUrl = (String) map.get("jmxUrl");
String username = (String)map.get("username"); // String username = (String)map.get("username");
String password = (String)map.get("password"); // String password = (String)map.get("password");
Boolean isSSL = (Boolean)map.get("ssl"); // Boolean isSSL = (Boolean)map.get("ssl");
//
JmxCrawler jmxCrawler = new JmxCrawler( // JmxCrawler jmxCrawler = new JmxCrawler(
jmxUrl, // jmxUrl,
username, // username,
password, // password,
isSSL, // isSSL,
m // m
); // );
//
jmxCrawler.doCrawler(); // jmxCrawler.doCrawler();
return result; return result;
} }