From ca09c67e85acb0ab6c85c87f0dd0c05b35262b12 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Wed, 28 May 2008 22:11:57 +0000 Subject: alle event classnames now have a VS prefix. --- sources/core/VSProcess.java | 2 +- sources/core/VSTask.java | 18 ++-- sources/core/VSTaskManager.java | 4 +- sources/events/VSRegisteredEvents.java | 4 +- .../events/implementations/ProcessCrashEvent.java | 30 ------- .../implementations/ProcessRecoverEvent.java | 31 ------- .../implementations/VSProcessCrashEvent.java | 30 +++++++ .../implementations/VSProcessRecoverEvent.java | 31 +++++++ sources/events/internal/MessageReceiveEvent.java | 66 --------------- sources/events/internal/ProtocolEvent.java | 99 ---------------------- sources/events/internal/ProtocolScheduleEvent.java | 85 ------------------- sources/events/internal/VSMessageReceiveEvent.java | 66 +++++++++++++++ sources/events/internal/VSProtocolEvent.java | 99 ++++++++++++++++++++++ .../events/internal/VSProtocolScheduleEvent.java | 85 +++++++++++++++++++ sources/protocols/VSAbstractProtocol.java | 2 +- sources/simulator/VSSimulator.java | 6 +- sources/simulator/VSSimulatorCanvas.java | 8 +- 17 files changed, 333 insertions(+), 333 deletions(-) delete mode 100644 sources/events/implementations/ProcessCrashEvent.java delete mode 100644 sources/events/implementations/ProcessRecoverEvent.java create mode 100644 sources/events/implementations/VSProcessCrashEvent.java create mode 100644 sources/events/implementations/VSProcessRecoverEvent.java delete mode 100644 sources/events/internal/MessageReceiveEvent.java delete mode 100644 sources/events/internal/ProtocolEvent.java delete mode 100644 sources/events/internal/ProtocolScheduleEvent.java create mode 100644 sources/events/internal/VSMessageReceiveEvent.java create mode 100644 sources/events/internal/VSProtocolEvent.java create mode 100644 sources/events/internal/VSProtocolScheduleEvent.java diff --git a/sources/core/VSProcess.java b/sources/core/VSProcess.java index c7663d7..7071ae2 100644 --- a/sources/core/VSProcess.java +++ b/sources/core/VSProcess.java @@ -350,7 +350,7 @@ public class VSProcess extends VSPrefs { taskManager.removeTask(randomCrashTask); if (crashTime >= getGlobalTime()) { - VSAbstractEvent event = new ProcessCrashEvent(); + VSAbstractEvent event = new VSProcessCrashEvent(); randomCrashTask = new VSTask(crashTime, this, event, VSTask.GLOBAL); taskManager.addTask(randomCrashTask); diff --git a/sources/core/VSTask.java b/sources/core/VSTask.java index e281399..0bc0d3f 100644 --- a/sources/core/VSTask.java +++ b/sources/core/VSTask.java @@ -109,8 +109,8 @@ public class VSTask implements Comparable { * * @return true, if it is a message receive event */ - public boolean isMessageReceiveEvent() { - return event instanceof MessageReceiveEvent; + public boolean isVSMessageReceiveEvent() { + return event instanceof VSMessageReceiveEvent; } /** @@ -118,8 +118,8 @@ public class VSTask implements Comparable { * * @return true, if it is a process recover event */ - public boolean isProcessRecoverEvent() { - return event instanceof ProcessRecoverEvent; + public boolean isVSProcessRecoverEvent() { + return event instanceof VSProcessRecoverEvent; } /** @@ -252,8 +252,8 @@ public class VSTask implements Comparable { return 1; /* If it's a ProtocolRecover, it should get handled very first */ - boolean a = event instanceof ProcessRecoverEvent; - boolean b = task.getEvent() instanceof ProcessRecoverEvent; + boolean a = event instanceof VSProcessRecoverEvent; + boolean b = task.getEvent() instanceof VSProcessRecoverEvent; if (a && b) return 0; @@ -264,9 +264,9 @@ public class VSTask implements Comparable { if (b) return 1; - /* If it's a ProtocolEvent, it should get handled first */ - a = event instanceof ProtocolEvent; - b = task.getEvent() instanceof ProtocolEvent; + /* If it's a VSProtocolEvent, it should get handled first */ + a = event instanceof VSProtocolEvent; + b = task.getEvent() instanceof VSProtocolEvent; if (a && b) return 0; diff --git a/sources/core/VSTaskManager.java b/sources/core/VSTaskManager.java index 2dc64da..189665a 100644 --- a/sources/core/VSTaskManager.java +++ b/sources/core/VSTaskManager.java @@ -88,7 +88,7 @@ public class VSTaskManager { globalTasks.poll(); redo = true; - if (process.isCrashed() && !task.isProcessRecoverEvent()) { + if (process.isCrashed() && !task.isVSProcessRecoverEvent()) { if (task.isProgrammed()) fullfilledProgrammedTasks.add(task); continue; @@ -143,7 +143,7 @@ public class VSTaskManager { tasks.poll(); redo = true; - if (process.isCrashed() && !task.isProcessRecoverEvent()) { + if (process.isCrashed() && !task.isVSProcessRecoverEvent()) { if (task.isProgrammed()) fullfilledProgrammedTasks.add(task); continue; diff --git a/sources/events/VSRegisteredEvents.java b/sources/events/VSRegisteredEvents.java index 05857be..c9fc79a 100644 --- a/sources/events/VSRegisteredEvents.java +++ b/sources/events/VSRegisteredEvents.java @@ -56,8 +56,8 @@ public final class VSRegisteredEvents { public static void init(VSPrefs prefs_) { prefs = prefs_; - registerEvent("events.implementations.ProcessCrashEvent", "Prozessabsturz", null); - registerEvent("events.implementations.ProcessRecoverEvent", "Prozesswiederbelebung", null); + registerEvent("events.implementations.VSProcessCrashEvent", "Prozessabsturz", null); + registerEvent("events.implementations.VSProcessRecoverEvent", "Prozesswiederbelebung", null); registerEvent("protocols.implementations.BerkelyTimeProtocol", "Berkeley Algorithmus zur internen Sync.", "Berkeley"); registerEvent("protocols.implementations.BroadcastSturmProtocol", "Broadcaststurm", null); registerEvent("protocols.implementations.DummyProtocol", "Beispiel/Dummy", null); diff --git a/sources/events/implementations/ProcessCrashEvent.java b/sources/events/implementations/ProcessCrashEvent.java deleted file mode 100644 index d0db00e..0000000 --- a/sources/events/implementations/ProcessCrashEvent.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * VS is (c) 2008 by Paul C. Buetow - * vs@dev.buetow.org - */ -package events.implementations; - -import events.VSAbstractEvent; - -/** - * The Class ProcessCrashEvent. - */ -public class ProcessCrashEvent extends VSAbstractEvent { - - /* (non-Javadoc) - * @see events.VSAbstractEvent#onInit() - */ - public void onInit() { - setClassname(getClass().toString()); - } - - /* (non-Javadoc) - * @see events.VSAbstractEvent#onStart() - */ - public void onStart() { - if (!process.isCrashed()) { - process.isCrashed(true); - logg(prefs.getString("lang.crashed")); - } - } -} diff --git a/sources/events/implementations/ProcessRecoverEvent.java b/sources/events/implementations/ProcessRecoverEvent.java deleted file mode 100644 index 6ba4276..0000000 --- a/sources/events/implementations/ProcessRecoverEvent.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * VS is (c) 2008 by Paul C. Buetow - * vs@dev.buetow.org - */ -package events.implementations; - -import events.VSAbstractEvent; - -/** - * The Class ProcessRecoverEvent. - */ -public class ProcessRecoverEvent extends VSAbstractEvent { - private static final long serialVersionUID = 1L; - - /* (non-Javadoc) - * @see events.VSAbstractEvent#onInit() - */ - public void onInit() { - setClassname(getClass().toString()); - } - - /* (non-Javadoc) - * @see events.VSAbstractEvent#onStart() - */ - public void onStart() { - if (process.isCrashed()) { - process.isCrashed(false); - logg(prefs.getString("lang.recovered")); - } - } -} diff --git a/sources/events/implementations/VSProcessCrashEvent.java b/sources/events/implementations/VSProcessCrashEvent.java new file mode 100644 index 0000000..637a2b1 --- /dev/null +++ b/sources/events/implementations/VSProcessCrashEvent.java @@ -0,0 +1,30 @@ +/* + * VS is (c) 2008 by Paul C. Buetow + * vs@dev.buetow.org + */ +package events.implementations; + +import events.VSAbstractEvent; + +/** + * The Class VSProcessCrashEvent. + */ +public class VSProcessCrashEvent extends VSAbstractEvent { + + /* (non-Javadoc) + * @see events.VSAbstractEvent#onInit() + */ + public void onInit() { + setClassname(getClass().toString()); + } + + /* (non-Javadoc) + * @see events.VSAbstractEvent#onStart() + */ + public void onStart() { + if (!process.isCrashed()) { + process.isCrashed(true); + logg(prefs.getString("lang.crashed")); + } + } +} diff --git a/sources/events/implementations/VSProcessRecoverEvent.java b/sources/events/implementations/VSProcessRecoverEvent.java new file mode 100644 index 0000000..25bab7a --- /dev/null +++ b/sources/events/implementations/VSProcessRecoverEvent.java @@ -0,0 +1,31 @@ +/* + * VS is (c) 2008 by Paul C. Buetow + * vs@dev.buetow.org + */ +package events.implementations; + +import events.VSAbstractEvent; + +/** + * The Class VSProcessRecoverEvent. + */ +public class VSProcessRecoverEvent extends VSAbstractEvent { + private static final long serialVersionUID = 1L; + + /* (non-Javadoc) + * @see events.VSAbstractEvent#onInit() + */ + public void onInit() { + setClassname(getClass().toString()); + } + + /* (non-Javadoc) + * @see events.VSAbstractEvent#onStart() + */ + public void onStart() { + if (process.isCrashed()) { + process.isCrashed(false); + logg(prefs.getString("lang.recovered")); + } + } +} diff --git a/sources/events/internal/MessageReceiveEvent.java b/sources/events/internal/MessageReceiveEvent.java deleted file mode 100644 index 60538df..0000000 --- a/sources/events/internal/MessageReceiveEvent.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * VS is (c) 2008 by Paul C. Buetow - * vs@dev.buetow.org - */ -package events.internal; - -import core.VSMessage; -import events.VSAbstractEvent; -import protocols.VSAbstractProtocol; - -/** - * The Class MessageReceiveEvent. - */ -public class MessageReceiveEvent extends VSAbstractEvent { - private static final long serialVersionUID = 1L; - - /** The message. */ - private VSMessage message; - - /** - * Instantiates a new message receive event. - * - * @param message the message - */ - public MessageReceiveEvent(VSMessage message) { - this.message = message; - } - - /* (non-Javadoc) - * @see events.VSAbstractEvent#onInit() - */ - public void onInit() { - setClassname(getClass().toString()); - } - - /* (non-Javadoc) - * @see events.VSAbstractEvent#onStart() - */ - public void onStart() { - String eventName = message.getName(); - String protocolClassname = message.getProtocolClassname(); - - process.updateLamportTime(message.getLamportTime()+1); - process.updateVectorTime(message.getVectorTime()); - - Object protocolObj = null; - - if (process.objectExists(protocolClassname)) - protocolObj = process.getObject(protocolClassname); - - StringBuffer buffer = new StringBuffer(); - buffer.append(prefs.getString("lang.message.recv")); - buffer.append("; "); - buffer.append(message);; - - if (protocolObj == null) { - logg(buffer.toString()); - - } else { - final VSAbstractProtocol protocol = (VSAbstractProtocol) protocolObj; - logg(buffer.toString()); - protocol.onMessageRecvStart(message); - } - - } -} diff --git a/sources/events/internal/ProtocolEvent.java b/sources/events/internal/ProtocolEvent.java deleted file mode 100644 index 4b9adc3..0000000 --- a/sources/events/internal/ProtocolEvent.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * VS is (c) 2008 by Paul C. Buetow - * vs@dev.buetow.org - */ -package events.internal; - -import events.*; -import protocols.VSAbstractProtocol; - -/** - * The Class ProtocolEvent. - */ -public class ProtocolEvent extends VSAbstractEvent { - private static final long serialVersionUID = 1L; - - /** The protocol classname. */ - private String protocolClassname; - - /** The event is a client protocol. */ - private boolean isClientProtocol; /* true = client, false = server */ - - /** The event is a protocol activation. */ - private boolean isProtocolActivation; /* true = activate, false = deactivate */ - - /* (non-Javadoc) - * @see events.VSAbstractEvent#onInit() - */ - public void onInit() { - setClassname(getClass().toString()); - } - - /** - * Checks if is client protocol. - * - * @param isClientProtocol the is client protocol - */ - public void isClientProtocol(boolean isClientProtocol) { - this.isClientProtocol = isClientProtocol; - } - - /** - * Checks if is client protocol. - * - * @return true, if is client protocol - */ - public boolean isClientProtocol() { - return isClientProtocol; - } - - /** - * Checks if is protocol activation. - * - * @param isProtocolActivation the is protocol activation - */ - public void isProtocolActivation(boolean isProtocolActivation) { - this.isProtocolActivation = isProtocolActivation; - } - - /** - * Checks if is protocol activation. - * - * @return true, if is protocol activation - */ - public boolean isProtocolActivation() { - return isProtocolActivation; - } - - /** - * Sets the protocol classname. - * - * @param protocolClassname the new protocol classname - */ - public void setProtocolClassname(String protocolClassname) { - this.protocolClassname = protocolClassname; - } - - /* (non-Javadoc) - * @see events.VSAbstractEvent#onStart() - */ - public void onStart() { - VSAbstractProtocol protocol = process.getProtocolObject(protocolClassname); - - if (isClientProtocol) - protocol.isClient(isProtocolActivation); - - else - protocol.isServer(isProtocolActivation); - - StringBuffer buffer = new StringBuffer(); - buffer.append(VSRegisteredEvents.getShortnameByClassname(protocolClassname)); - buffer.append(" "); - buffer.append(isClientProtocol - ? prefs.getString("lang.client") : prefs.getString("lang.server")); - buffer.append(" "); - buffer.append(isProtocolActivation - ? prefs.getString("lang.activated") : prefs.getString("lang.deactivated")); - logg(buffer.toString()); - } -} diff --git a/sources/events/internal/ProtocolScheduleEvent.java b/sources/events/internal/ProtocolScheduleEvent.java deleted file mode 100644 index bbb776c..0000000 --- a/sources/events/internal/ProtocolScheduleEvent.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * VS is (c) 2008 by Paul C. Buetow - * vs@dev.buetow.org - */ -package events.internal; - -import events.*; -import protocols.VSAbstractProtocol; - -/** - * The Class ProtocolScheduleEvent. - */ -public class ProtocolScheduleEvent extends VSAbstractEvent { - private static final long serialVersionUID = 1L; - - /** The event is a server protocol schedule. */ - private boolean isServerSchedule; /* true = server, false = client */ - - /** The reference to the protocol object to schedule. */ - private VSAbstractProtocol protocol; - - /** - * Create a ProtocolScheduleEvent object - * - * @param protocol the protocol - * @param isServerSchedule the event is a client protocol schedule if false, else server schedule - */ - public ProtocolScheduleEvent(VSAbstractProtocol protocol, boolean isServerSchedule) { - this.protocol = protocol; - this.isServerSchedule = isServerSchedule; - } - - /* (non-Javadoc) - * @see events.VSAbstractEvent#onInit() - */ - public void onInit() { - setClassname(getClass().toString()); - } - - /** - * Checks if is client protocol schedule. - * - * @param isServerSchedule the event is a client protocol schedule if false, else server schedule - */ - public void isServerSchedule(boolean isServerSchedule) { - this.isServerSchedule = isServerSchedule; - } - - /** - * Checks if is client protocol. - * - * @return false, if is client protocol schedule, else server protocol schedule - */ - public boolean isServerSchedule() { - return isServerSchedule; - } - - /** - * Sets the protocol - * - * @param protocol the protocol - */ - public void setProtocol(VSAbstractProtocol protocol) { - this.protocol = protocol; - } - - /** - * Gets the protocol - * - * @return the protocol - */ - public VSAbstractProtocol getProtocol() { - return protocol; - } - - /* (non-Javadoc) - * @see events.VSAbstractEvent#onStart() - */ - public void onStart() { - if (isServerSchedule) - protocol.onServerScheduleStart(); - else - protocol.onClientScheduleStart(); - } -} diff --git a/sources/events/internal/VSMessageReceiveEvent.java b/sources/events/internal/VSMessageReceiveEvent.java new file mode 100644 index 0000000..ff97010 --- /dev/null +++ b/sources/events/internal/VSMessageReceiveEvent.java @@ -0,0 +1,66 @@ +/* + * VS is (c) 2008 by Paul C. Buetow + * vs@dev.buetow.org + */ +package events.internal; + +import core.VSMessage; +import events.VSAbstractEvent; +import protocols.VSAbstractProtocol; + +/** + * The Class VSMessageReceiveEvent. + */ +public class VSMessageReceiveEvent extends VSAbstractEvent { + private static final long serialVersionUID = 1L; + + /** The message. */ + private VSMessage message; + + /** + * Instantiates a new message receive event. + * + * @param message the message + */ + public VSMessageReceiveEvent(VSMessage message) { + this.message = message; + } + + /* (non-Javadoc) + * @see events.VSAbstractEvent#onInit() + */ + public void onInit() { + setClassname(getClass().toString()); + } + + /* (non-Javadoc) + * @see events.VSAbstractEvent#onStart() + */ + public void onStart() { + String eventName = message.getName(); + String protocolClassname = message.getProtocolClassname(); + + process.updateLamportTime(message.getLamportTime()+1); + process.updateVectorTime(message.getVectorTime()); + + Object protocolObj = null; + + if (process.objectExists(protocolClassname)) + protocolObj = process.getObject(protocolClassname); + + StringBuffer buffer = new StringBuffer(); + buffer.append(prefs.getString("lang.message.recv")); + buffer.append("; "); + buffer.append(message);; + + if (protocolObj == null) { + logg(buffer.toString()); + + } else { + final VSAbstractProtocol protocol = (VSAbstractProtocol) protocolObj; + logg(buffer.toString()); + protocol.onMessageRecvStart(message); + } + + } +} diff --git a/sources/events/internal/VSProtocolEvent.java b/sources/events/internal/VSProtocolEvent.java new file mode 100644 index 0000000..d5051f3 --- /dev/null +++ b/sources/events/internal/VSProtocolEvent.java @@ -0,0 +1,99 @@ +/* + * VS is (c) 2008 by Paul C. Buetow + * vs@dev.buetow.org + */ +package events.internal; + +import events.*; +import protocols.VSAbstractProtocol; + +/** + * The Class VSProtocolEvent. + */ +public class VSProtocolEvent extends VSAbstractEvent { + private static final long serialVersionUID = 1L; + + /** The protocol classname. */ + private String protocolClassname; + + /** The event is a client protocol. */ + private boolean isClientProtocol; /* true = client, false = server */ + + /** The event is a protocol activation. */ + private boolean isProtocolActivation; /* true = activate, false = deactivate */ + + /* (non-Javadoc) + * @see events.VSAbstractEvent#onInit() + */ + public void onInit() { + setClassname(getClass().toString()); + } + + /** + * Checks if is client protocol. + * + * @param isClientProtocol the is client protocol + */ + public void isClientProtocol(boolean isClientProtocol) { + this.isClientProtocol = isClientProtocol; + } + + /** + * Checks if is client protocol. + * + * @return true, if is client protocol + */ + public boolean isClientProtocol() { + return isClientProtocol; + } + + /** + * Checks if is protocol activation. + * + * @param isProtocolActivation the is protocol activation + */ + public void isProtocolActivation(boolean isProtocolActivation) { + this.isProtocolActivation = isProtocolActivation; + } + + /** + * Checks if is protocol activation. + * + * @return true, if is protocol activation + */ + public boolean isProtocolActivation() { + return isProtocolActivation; + } + + /** + * Sets the protocol classname. + * + * @param protocolClassname the new protocol classname + */ + public void setProtocolClassname(String protocolClassname) { + this.protocolClassname = protocolClassname; + } + + /* (non-Javadoc) + * @see events.VSAbstractEvent#onStart() + */ + public void onStart() { + VSAbstractProtocol protocol = process.getProtocolObject(protocolClassname); + + if (isClientProtocol) + protocol.isClient(isProtocolActivation); + + else + protocol.isServer(isProtocolActivation); + + StringBuffer buffer = new StringBuffer(); + buffer.append(VSRegisteredEvents.getShortnameByClassname(protocolClassname)); + buffer.append(" "); + buffer.append(isClientProtocol + ? prefs.getString("lang.client") : prefs.getString("lang.server")); + buffer.append(" "); + buffer.append(isProtocolActivation + ? prefs.getString("lang.activated") : prefs.getString("lang.deactivated")); + logg(buffer.toString()); + } +} diff --git a/sources/events/internal/VSProtocolScheduleEvent.java b/sources/events/internal/VSProtocolScheduleEvent.java new file mode 100644 index 0000000..9b6e664 --- /dev/null +++ b/sources/events/internal/VSProtocolScheduleEvent.java @@ -0,0 +1,85 @@ +/* + * VS is (c) 2008 by Paul C. Buetow + * vs@dev.buetow.org + */ +package events.internal; + +import events.*; +import protocols.VSAbstractProtocol; + +/** + * The Class VSProtocolScheduleEvent. + */ +public class VSProtocolScheduleEvent extends VSAbstractEvent { + private static final long serialVersionUID = 1L; + + /** The event is a server protocol schedule. */ + private boolean isServerSchedule; /* true = server, false = client */ + + /** The reference to the protocol object to schedule. */ + private VSAbstractProtocol protocol; + + /** + * Create a VSProtocolScheduleEvent object + * + * @param protocol the protocol + * @param isServerSchedule the event is a client protocol schedule if false, else server schedule + */ + public VSProtocolScheduleEvent(VSAbstractProtocol protocol, boolean isServerSchedule) { + this.protocol = protocol; + this.isServerSchedule = isServerSchedule; + } + + /* (non-Javadoc) + * @see events.VSAbstractEvent#onInit() + */ + public void onInit() { + setClassname(getClass().toString()); + } + + /** + * Checks if is client protocol schedule. + * + * @param isServerSchedule the event is a client protocol schedule if false, else server schedule + */ + public void isServerSchedule(boolean isServerSchedule) { + this.isServerSchedule = isServerSchedule; + } + + /** + * Checks if is client protocol. + * + * @return false, if is client protocol schedule, else server protocol schedule + */ + public boolean isServerSchedule() { + return isServerSchedule; + } + + /** + * Sets the protocol + * + * @param protocol the protocol + */ + public void setProtocol(VSAbstractProtocol protocol) { + this.protocol = protocol; + } + + /** + * Gets the protocol + * + * @return the protocol + */ + public VSAbstractProtocol getProtocol() { + return protocol; + } + + /* (non-Javadoc) + * @see events.VSAbstractEvent#onStart() + */ + public void onStart() { + if (isServerSchedule) + protocol.onServerScheduleStart(); + else + protocol.onClientScheduleStart(); + } +} diff --git a/sources/protocols/VSAbstractProtocol.java b/sources/protocols/VSAbstractProtocol.java index 461fe01..1cb5281 100644 --- a/sources/protocols/VSAbstractProtocol.java +++ b/sources/protocols/VSAbstractProtocol.java @@ -218,7 +218,7 @@ abstract public class VSAbstractProtocol extends VSAbstractEvent { * @param time The process' local time to run the schedule at. */ public final void scheduleAt(long time) { - VSAbstractEvent scheduleEvent = new ProtocolScheduleEvent(this, currentContextIsServer); + VSAbstractEvent scheduleEvent = new VSProtocolScheduleEvent(this, currentContextIsServer); VSTask scheduleTask = new VSTask(time, process, scheduleEvent, VSTask.LOCAL); if (currentContextIsServer) serverSchedules.add(scheduleTask); diff --git a/sources/simulator/VSSimulator.java b/sources/simulator/VSSimulator.java index c9066ad..26f6731 100644 --- a/sources/simulator/VSSimulator.java +++ b/sources/simulator/VSSimulator.java @@ -475,7 +475,7 @@ public class VSSimulator extends JPanel { /** The shortname. */ private String shortname; - /* Those 3 values are for ProtocolEvent events */ + /* Those 3 values are for VSProtocolEvent events */ /** The is protocol activation. */ private boolean isProtocolActivation; @@ -582,7 +582,7 @@ public class VSSimulator extends JPanel { event.setShortname(shortname); if (isProtocolActivation || isProtocolDeactivation) { - ProtocolEvent protocolEvent = (ProtocolEvent) event; + VSProtocolEvent protocolEvent = (VSProtocolEvent) event; protocolEvent.setProtocolClassname(protocolClassname); protocolEvent.isProtocolActivation(isProtocolActivation); protocolEvent.isClientProtocol(isClientProtocol); @@ -959,7 +959,7 @@ public class VSSimulator extends JPanel { String serverRequest = prefs.getString("lang.serverrequest.start"); String protocol = prefs.getString("lang.protocol"); - String protocolEventClassname = "events.internal.ProtocolEvent"; + String protocolEventClassname = "events.internal.VSProtocolEvent"; eventClassnames = VSRegisteredEvents.getProtocolClassnames(); for (String eventClassname : eventClassnames) { diff --git a/sources/simulator/VSSimulatorCanvas.java b/sources/simulator/VSSimulatorCanvas.java index 0c71f82..f1df68a 100644 --- a/sources/simulator/VSSimulatorCanvas.java +++ b/sources/simulator/VSSimulatorCanvas.java @@ -1043,7 +1043,7 @@ public class VSSimulatorCanvas extends Canvas implements Runnable, MouseMotionLi if (receiverProcess.equals(sendingProcess)) { if (recvOwn) { deliverTime = sendingProcess.getGlobalTime(); - messageReceiveEvent = new MessageReceiveEvent(message); + messageReceiveEvent = new VSMessageReceiveEvent(message); task = new VSTask(deliverTime, receiverProcess, messageReceiveEvent, VSTask.GLOBAL); taskManager.addTask(task); } @@ -1061,7 +1061,7 @@ public class VSSimulatorCanvas extends Canvas implements Runnable, MouseMotionLi /* Only add a 'receiving message' task if the message will not get lost! */ if (outageTime == -1) { - messageReceiveEvent = new MessageReceiveEvent(message); + messageReceiveEvent = new VSMessageReceiveEvent(message); task = new VSTask(deliverTime, receiverProcess, messageReceiveEvent, VSTask.GLOBAL); taskManager.addTask(task); } @@ -1091,11 +1091,11 @@ public class VSSimulatorCanvas extends Canvas implements Runnable, MouseMotionLi editProcess(process); } else if (actionCommand.equals(prefs.getString("lang.process.crash"))) { - VSAbstractEvent event = new ProcessCrashEvent(); + VSAbstractEvent event = new VSProcessCrashEvent(); taskManager.addTask(new VSTask(process.getGlobalTime(), process, event, VSTask.GLOBAL)); } else if (actionCommand.equals(prefs.getString("lang.process.recover"))) { - VSAbstractEvent event = new ProcessRecoverEvent(); + VSAbstractEvent event = new VSProcessRecoverEvent(); taskManager.addTask(new VSTask(process.getGlobalTime(), process, event, VSTask.GLOBAL)); } else if (actionCommand.equals(prefs.getString("lang.process.remove"))) { -- cgit v1.2.3