diff --git a/Bench4Q-Master/src/main/java/org/bench4q/master/domain/entity/Monitor.java b/Bench4Q-Master/src/main/java/org/bench4q/master/domain/entity/Monitor.java index e844b68c..7103cb2d 100644 --- a/Bench4Q-Master/src/main/java/org/bench4q/master/domain/entity/Monitor.java +++ b/Bench4Q-Master/src/main/java/org/bench4q/master/domain/entity/Monitor.java @@ -47,13 +47,7 @@ public class Monitor { private Set results; private Logger logger = Logger.getLogger(Monitor.class); private TestPlanFactory testPlanFactory; - private MonitorMessenger monitorMessenger; - @Autowired - private void setMonitorMessenger(MonitorMessenger monitorMessenger) { - this.monitorMessenger = monitorMessenger; - } - public Monitor() { this.results = new HashSet(); } @@ -111,7 +105,7 @@ public class Monitor { return ApplicationContextHelper.getContext().getBean( TestMonitorSampler.class); } - + @Transient public TestPlanFactory getTestPlanFactory() { return testPlanFactory; @@ -144,7 +138,7 @@ public class Monitor { } public void start(UUID testPlanId, String limitModel){ - monitorMessenger.startMonitor(hostName, port, testPlanId, limitModel); + this.getTestMonitorSampler().startMonitor(hostName, port, testPlanId, limitModel); } public List createFinishedResult() { diff --git a/Bench4Q-Master/src/main/java/org/bench4q/master/domain/valueobject/datastatistics/TestMonitorSampler.java b/Bench4Q-Master/src/main/java/org/bench4q/master/domain/valueobject/datastatistics/TestMonitorSampler.java index cfc0a4d2..4db96168 100644 --- a/Bench4Q-Master/src/main/java/org/bench4q/master/domain/valueobject/datastatistics/TestMonitorSampler.java +++ b/Bench4Q-Master/src/main/java/org/bench4q/master/domain/valueobject/datastatistics/TestMonitorSampler.java @@ -1,5 +1,7 @@ package org.bench4q.master.domain.valueobject.datastatistics; +import java.util.UUID; + import org.bench4q.master.infrastructure.communication.MonitorMessenger; import org.bench4q.share.models.monitor.MonitorMain; import org.springframework.beans.factory.annotation.Autowired; @@ -19,4 +21,7 @@ public class TestMonitorSampler { return this.monitorMessenger.monitorModel(hostName, port); } + public boolean startMonitor(String hostName, int port, UUID testPlanId, String limitModel){ + return this.monitorMessenger.startMonitor(hostName, port, testPlanId, limitModel); + } } diff --git a/Bench4Q-Monitor-Sigar/src/main/java/org/bench4q/monitor/model/LimitModel.java b/Bench4Q-Monitor-Sigar/src/main/java/org/bench4q/monitor/model/LimitModel.java index dcd37c4d..60a44556 100644 --- a/Bench4Q-Monitor-Sigar/src/main/java/org/bench4q/monitor/model/LimitModel.java +++ b/Bench4Q-Monitor-Sigar/src/main/java/org/bench4q/monitor/model/LimitModel.java @@ -5,13 +5,15 @@ import java.util.List; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElementWrapper; import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; @XmlRootElement public class LimitModel { - @XmlElementWrapper - @XmlElement + private List params; + @XmlElementWrapper(name = "limitParameterList") + @XmlElement(name = "limitParameter") public List getParams() { return params; } @@ -20,7 +22,9 @@ public class LimitModel { this.params = params; } + @XmlRootElement + @XmlType(name = "limitParameterModel") public static class ParameterModel { private String name; private double limit;