Skip to content

Commit

Permalink
Merge pull request #13 from newbrough/bugfix/config-allenabled
Browse files Browse the repository at this point in the history
Bugfix/config allenabled
  • Loading branch information
newbrough committed May 31, 2016
2 parents 2b2fd52 + cf99680 commit 1cfd943
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
8 changes: 6 additions & 2 deletions gumshoe-probes/src/main/java/com/dell/gumshoe/Probe.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,13 @@ protected static String[] getList(Properties p, String key) {
return out;
}

protected static String getMBeanName(Configuration p) {
return p.getProperty("mean.name");
}

protected static String getMBeanName(Configuration p, Class clazz) {
final String packageName = clazz==null ? null : clazz.getPackage().getName();
final String className = clazz==null ? null : clazz.getSimpleName();
final String packageName = clazz.getPackage().getName();
final String className = clazz.getSimpleName();
return p.getProperty("mbean.name", packageName + ":type=" + className);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public void initialize(Configuration cfg) throws Exception {

// jmx enabled if explicit name, explicit property, or some reporting enabled
final boolean jmxEnabled =
getMBeanName(cfg, null)!=null || cfg.isTrue("mbean", reportEnabled);
getMBeanName(cfg)!=null || cfg.isTrue("mbean", reportEnabled);
final String mbeanName = jmxEnabled ? getMBeanName(cfg, getClass()) : null;

final boolean enabled = cfg.isTrue("enabled", reportEnabled || jmxEnabled);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public void initialize(Configuration cfg) throws Exception {

// jmx enabled if explicit name, explicit property, or some reporting enabled
final boolean jmxEnabled =
getMBeanName(cfg, null)!=null || cfg.isTrue("mbean", reportEnabled);
getMBeanName(cfg)!=null || cfg.isTrue("mbean", reportEnabled);
final String mbeanName = jmxEnabled ? getMBeanName(cfg, getClass()) : null;

final boolean enabled = cfg.isTrue("enabled", reportEnabled || jmxEnabled);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public void initialize(Configuration cfg) throws Exception {

// jmx enabled if explicit name, explicit property, or some reporting enabled
final boolean jmxEnabled =
getMBeanName(cfg, null)!=null || cfg.isTrue("mbean", reportEnabled);
getMBeanName(cfg)!=null || cfg.isTrue("mbean", reportEnabled);
final String mbeanName = jmxEnabled ? getMBeanName(cfg, getClass()) : null;

final boolean enabled = cfg.isTrue("enabled", reportEnabled || jmxEnabled);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public void done() {
if(report!=null) {
final Date time = parser.getReportTime();
final String reportTime = hms.format(time);
relayStats(parser.getFilename(), parser.getReportType(), reportTime, report);
relayStats(parser.getFilename(), reportTime, parser.getReportType(), report);
}
} catch(Exception ex) {
notifyError("Parse error reading file");
Expand Down

0 comments on commit 1cfd943

Please sign in to comment.