From 8b076ed54b692381a3c1410b704bdad33ad5ca0b Mon Sep 17 00:00:00 2001 From: Martin Date: Thu, 26 Dec 2019 15:27:44 +0100 Subject: Refactor handle (#75) * Refactor passing messages to handler * Add RMIMessage skeleton * Handle RMI message in RMI module --- .../cloudatlas/agent/messages/TimerSchedulerMessage.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/TimerSchedulerMessage.java') diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/TimerSchedulerMessage.java b/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/TimerSchedulerMessage.java index 333b381..8566d67 100644 --- a/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/TimerSchedulerMessage.java +++ b/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/TimerSchedulerMessage.java @@ -1,6 +1,8 @@ package pl.edu.mimuw.cloudatlas.agent.messages; import pl.edu.mimuw.cloudatlas.agent.modules.TimerScheduledTask; +import pl.edu.mimuw.cloudatlas.agent.modules.Module; +import pl.edu.mimuw.cloudatlas.agent.modules.ModuleType; public class TimerSchedulerMessage extends AgentMessage { private String requestId; @@ -9,13 +11,12 @@ public class TimerSchedulerMessage extends AgentMessage { private TimerScheduledTask task; public TimerSchedulerMessage(String messageId, - AgentModule destinationModule, long timestamp, String requestId, long delay, long baseTime, TimerScheduledTask task) { - super(messageId, destinationModule, timestamp); + super(messageId, ModuleType.TIMER_SCHEDULER, timestamp); this.requestId = requestId; this.delay = delay; this.baseTime = baseTime; @@ -48,10 +49,9 @@ public class TimerSchedulerMessage extends AgentMessage { public String getRequestId() { return requestId; } - public void setRequestId(String requestId) { this.requestId = requestId; } - - @Override - public AgentModule getCorrectMessageType() { - return AgentModule.TIMER_SCHEDULER; + public void callMe(Module module) throws InterruptedException, Module.InvalidMessageType { + module.handleTyped(this); } + + public void setRequestId(String requestId) { this.requestId = requestId; } } -- cgit v1.2.3