summaryrefslogtreecommitdiff
path: root/sources/events
diff options
context:
space:
mode:
authorPaul Buetow (centauri) <puppet@mx.buetow.org>2015-05-23 21:59:43 +0100
committerPaul Buetow (centauri) <puppet@mx.buetow.org>2015-05-23 21:59:43 +0100
commit9fc2fc3ccdedf1b7e48f8dfb618ca6cb6a2a662e (patch)
tree0fa92fe4e75cb53ffbf7eb56b5455eb9457bb06c /sources/events
parentf7873669a43421331e14b8921ebdaa8af4393bd5 (diff)
parent32749241efc1f5f70056d74a90237388f57ea350 (diff)
Merge remote-tracking branch 'remotes/github/packages' into packagespackages
Diffstat (limited to 'sources/events')
-rw-r--r--sources/events/VSAbstractEvent.java266
-rw-r--r--sources/events/VSCopyableEvent.java40
-rw-r--r--sources/events/VSRegisteredEvents.java409
-rw-r--r--sources/events/implementations/VSProcessCrashEvent.java69
-rw-r--r--sources/events/implementations/VSProcessRecoverEvent.java70
-rw-r--r--sources/events/internal/VSAbstractInternalEvent.java84
-rw-r--r--sources/events/internal/VSMessageReceiveEvent.java112
-rw-r--r--sources/events/internal/VSProtocolEvent.java199
-rw-r--r--sources/events/internal/VSProtocolScheduleEvent.java151
9 files changed, 0 insertions, 1400 deletions
diff --git a/sources/events/VSAbstractEvent.java b/sources/events/VSAbstractEvent.java
deleted file mode 100644
index ac9a61f..0000000
--- a/sources/events/VSAbstractEvent.java
+++ /dev/null
@@ -1,266 +0,0 @@
-/*
- * VS-Simulator (http://vs-sim.buetow.org)
- * Copyright (c) 2008 - 2009 by Dipl.-Inform. (FH) Paul C. Buetow
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * All icons of the icons/ folder are under a Creative Commons
- * Attribution-Noncommercial-Share Alike License a CC-by-nc-sa.
- *
- * The icon's homepage is http://code.google.com/p/ultimate-gnome/
- */
-
-package events;
-
-import java.io.*;
-
-import core.VSAbstractProcess;
-import core.VSInternalProcess;
-import exceptions.*;
-import prefs.*;
-import serialize.*;
-
-/**
- * The class VSAbstractEvent. This abstract class defines the basic framework
- * of each event. an event is used to fullfill a specific task. An event object
- * will get stored in a VSTask object.
- *
- * @author Paul C. Buetow
- */
-abstract public class VSAbstractEvent extends VSSerializablePrefs {
- /** The serial version uid */
- private static final long serialVersionUID = 1L;
-
- /** The prefs. */
- public VSPrefs prefs;
-
- /** The process. */
- public VSAbstractProcess process;
-
- /** The event shortname. */
- private String eventShortname;
-
- /** The event classname. */
- private String eventClassname;
-
- /**
- * Creates a copy of the event and using a new process.
- *
- * @param theProcess The new process
- * @return The copy
- */
- final public VSAbstractEvent getCopy(VSInternalProcess theProcess)
- throws VSEventNotCopyableException {
-
- if (theProcess == null)
- theProcess = (VSInternalProcess) process;
-
- if (!(this instanceof VSCopyableEvent))
- throw new VSEventNotCopyableException(
- eventShortname + " (" + eventClassname + ")");
-
- VSAbstractEvent copy =
- VSRegisteredEvents.createEventInstanceByClassname(
- eventClassname, theProcess);
-
- ((VSCopyableEvent) this).initCopy(copy);
- copy.setShortname(eventShortname);
-
- return copy;
- }
-
- /**
- * Creates a copy of the event.
- *
- * @return The copy
- */
- final public VSAbstractEvent getCopy() throws VSEventNotCopyableException {
- return getCopy(null);
- }
-
- /**
- * Inits the event.
- *
- * @param process the process
- */
- public void init(VSInternalProcess process) {
- if (this.process == null) {
- this.process = process;
- this.prefs = process.getPrefs();
- init();
- }
- }
-
- /**
- * Inits the event without setting the processes and prefs variables
- * of the object.
- */
- public void init() {
- onInit();
- }
-
- /**
- * Sets the classname.
- *
- * @param eventClassname the new classname
- */
- public final void setClassname(String eventClassname) {
- if (eventClassname.startsWith("class "))
- eventClassname = eventClassname.substring(6);
-
- this.eventClassname = eventClassname;
- }
-
- /**
- * Gets the classname.
- *
- * @return the classname
- */
- public String getClassname() {
- return eventClassname;
- }
-
- /**
- * Gets the name.
- *
- * @return the name
- */
- public String getName() {
- return VSRegisteredEvents.getNameByClassname(eventClassname);
- }
-
- /**
- * Sets the shortname.
- *
- * @param eventShortname the new shortname
- */
- public void setShortname(String eventShortname) {
- this.eventShortname = eventShortname;
- }
-
- /**
- * Gets the shortname.
- *
- * @return the shortname
- */
- public String getShortname() {
- if (eventShortname == null)
- return VSRegisteredEvents.getShortnameByClassname(eventClassname);
-
- return eventShortname;
- }
-
- /**
- * Gets the process.
- *
- * @return the process
- */
- public VSAbstractProcess getProcess() {
- return process;
- }
-
- /**
- * Logg a specific message.
- *
- * @param message the loging message
- */
- public void log(String message) {
- process.log(/*toString() + "; " + */message);
- }
-
- /**
- * Checks if the event equals to another event..
- *
- * @param event the event to compare against.
- *
- * @return true, if the events are the same (have the same event id)
- */
- public boolean equals(VSAbstractEvent event) {
- return super.getID() == event.getID();
- }
-
- /**
- * Every event has its own initialize method.
- */
- abstract public void onInit();
-
- /**
- * Every event can get started. This method get's executed if the event
- * takes place.
- */
- abstract public void onStart();
-
- /**
- * Every event has to be able to set its own shortname
- *
- * @param shortName The saved short name. May be overwritten due wrong lang
- *
- * @return The event's shortname
- */
- abstract protected String createShortname(String savedShortname);
-
- /* (non-Javadoc)
- * @see serialize.VSSerializable#serialize(serialize.VSSerialize,
- * java.io.ObjectOutputStream)
- */
- public synchronized void serialize(VSSerialize serialize,
- ObjectOutputStream objectOutputStream)
- throws IOException {
- super.serialize(serialize, objectOutputStream);
-
- if (VSSerialize.DEBUG)
- System.out.println("Serializing: VSAbstractEvent; id="+getID());
-
- /** For later backwards compatibility, to add more stuff */
- objectOutputStream.writeObject(new Boolean(false));
-
- objectOutputStream.writeObject(new Integer(super.getID()));
- objectOutputStream.writeObject(eventShortname);
- objectOutputStream.writeObject(eventClassname);
-
- /** For later backwards compatibility, to add more stuff */
- objectOutputStream.writeObject(new Boolean(false));
- }
-
- /* (non-Javadoc)
- * @see serialize.VSSerializable#deserialize(serialize.VSSerialize,
- * java.io.ObjectInputStream)
- */
- @SuppressWarnings("unchecked")
- public synchronized void deserialize(VSSerialize serialize,
- ObjectInputStream objectInputStream)
- throws IOException, ClassNotFoundException {
- super.deserialize(serialize, objectInputStream);
-
- if (VSSerialize.DEBUG)
- System.out.print("Deserializing: VSAbstractEvent ");
-
- /** For later backwards compatibility, to add more stuff */
- objectInputStream.readObject();
-
- int id = ((Integer) objectInputStream.readObject()).intValue();
- String savedEventShortname = (String) objectInputStream.readObject();
- this.eventClassname = (String) objectInputStream.readObject();
- this.eventShortname = createShortname(savedEventShortname);
-
- if (VSSerialize.DEBUG)
- System.out.println(eventClassname);
-
- serialize.setObject(id, "event", this);
-
- /** For later backwards compatibility, to add more stuff */
- objectInputStream.readObject();
- }
-}
diff --git a/sources/events/VSCopyableEvent.java b/sources/events/VSCopyableEvent.java
deleted file mode 100644
index 0ad6b24..0000000
--- a/sources/events/VSCopyableEvent.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2008 Paul C. Buetow, vs@dev.buetow.org
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * All icons of the icons/ folder are under a Creative Commons
- * Attribution-Noncommercial-Share Alike License a CC-by-nc-sa.
- *
- * The icon's homepage is http://code.google.com/p/ultimate-gnome/
- */
-
-package events;
-
-
-/**
- * The interface VSCopyableEvent, all events which implement this class
- * are copyable.
- *
- * @author Paul C. Buetow
- */
-public interface VSCopyableEvent {
- /**
- * Fills a copy of this event with its values
- *
- * @param copy The copy
- */
- public void initCopy(VSAbstractEvent copy);
-}
diff --git a/sources/events/VSRegisteredEvents.java b/sources/events/VSRegisteredEvents.java
deleted file mode 100644
index 9d022d9..0000000
--- a/sources/events/VSRegisteredEvents.java
+++ /dev/null
@@ -1,409 +0,0 @@
-/*
- * Copyright (c) 2008 Paul C. Buetow, vs@dev.buetow.org
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * All icons of the icons/ folder are under a Creative Commons
- * Attribution-Noncommercial-Share Alike License a CC-by-nc-sa.
- *
- * The icon's homepage is http://code.google.com/p/ultimate-gnome/
- */
-
-package events;
-
-import java.util.*;
-
-import prefs.*;
-import core.*;
-import utils.*;
-
-/**
- * The class VSRegisteredEvents. This class is responsible to manage all
- * events. It manages the event classnames, the event shortnames and the event
- * names. It also checks if a protocol (which is an event as well) has
- * variables which are editable through the GUI of the simulator.
- *
- * @author Paul C. Buetow
- */
-public final class VSRegisteredEvents {
- /** The serial version uid */
- private static final long serialVersionUID = 1L;
-
- /** The event classnames by eventnames. */
- private static HashMap<String,String> eventClassnamesByNames =
- new HashMap<String,String>();
-
- /** The event shortnames by classnames. */
- private static HashMap<String,String> eventShortnamesByClassnames =
- new HashMap<String,String>();
-
- /** The event names by classnames. */
- private static HashMap<String,String> eventNamesByClassnames =
- new HashMap<String,String>();
-
- /** The event classnames by shortnames. */
- private static HashMap<String,String> eventClassnamesByShortnames =
- new HashMap<String,String>();
-
- /** The editable protocols classnames. */
- private static ArrayList<String> editableProtocolsClassnames =
- new ArrayList<String>();
-
- private static HashMap<String,ArrayList<String>> clientVariables =
- new HashMap<String,ArrayList<String>>();
-
- private static HashMap<String,ArrayList<String>> serverVariables =
- new HashMap<String,ArrayList<String>>();
-
- private static HashMap<String,Boolean> isOnServerStartProtocol =
- new HashMap<String,Boolean>();
-
- /** The prefs. */
- private static VSPrefs prefs;
-
- /**
- * Registers available events.
- *
- * @param prefs_ the prefs_
- */
- public static void init(VSPrefs prefs_) {
- prefs = prefs_;
-
- /*
- registerEvent("events.implementations.VSProcessCrashEvent",
- "Prozessabsturz");
- registerEvent("events.implementations.VSProcessRecoverEvent",
- "Prozesswiederbelebung");
- registerEvent("protocols.implementations.VSBasicMulticastProtocol",
- "Basic Multicast", "Basic Multicast");
- registerEvent("protocols.implementations.VSBerkelyTimeProtocol",
- "Berkeley Algorithmus zur internen Sync.", "Berkeley");
- registerEvent("protocols.implementations.VSBroadcastProtocol",
- "Broadcast");
- registerEvent("protocols.implementations.VSDummyProtocol",
- "Beispiel/Dummy");
- registerEvent("protocols.implementations.VSExternalTimeSyncProtocol",
- "Christians Methode zur externen Sync.", "Christians");
- registerEvent("protocols.implementations.VSInternalTimeSyncProtocol",
- "Interne Synchronisation", "Interne Sync.");
- registerEvent("protocols.implementations.VSOnePhaseCommitProtocol",
- "Ein-Phasen Commit", "1-Phasen Commit");
- registerEvent("protocols.implementations.VSPingPongProtocol",
- "Ping Pong");
- registerEvent("protocols.implementations.VSReliableMulticastProtocol",
- "Reliable Multicast", "Reliable Multicast");
- registerEvent("protocols.implementations.VSTwoPhaseCommitProtocol",
- "Zwei-Phasen Commit", "2-Phasen Commit");
- */
-
- /* Using the NEW way. The old way above (specifying protocol names
- in this file still works as well */
-
- registerEvent("events.implementations.VSProcessCrashEvent");
- registerEvent("events.implementations.VSProcessRecoverEvent");
- registerEvent("protocols.implementations.VSBasicMulticastProtocol");
- registerEvent("protocols.implementations.VSBerkelyTimeProtocol");
- registerEvent("protocols.implementations.VSBroadcastProtocol");
- registerEvent("protocols.implementations.VSDummyProtocol");
- registerEvent("protocols.implementations.VSExternalTimeSyncProtocol");
- registerEvent("protocols.implementations.VSInternalTimeSyncProtocol");
- registerEvent("protocols.implementations.VSOnePhaseCommitProtocol");
- registerEvent("protocols.implementations.VSPingPongProtocol");
- registerEvent("protocols.implementations.VSReliableMulticastProtocol");
- registerEvent("protocols.implementations.VSTwoPhaseCommitProtocol");
-
- /* Make dummy objects of each protocol, to see if they contain VSPrefs
- values to edit */
- Vector<String> protocolClassnames = getProtocolClassnames();
- VSClassLoader classLoader = new VSClassLoader();
-
- for (String protocolClassname : protocolClassnames) {
- Object serverObject = classLoader.newInstance(protocolClassname);
- Object clientObject = classLoader.newInstance(protocolClassname);
-
- if (clientObject instanceof protocols.VSAbstractProtocol &&
- serverObject instanceof protocols.VSAbstractProtocol) {
-
- protocols.VSAbstractProtocol serverProtocol =
- (protocols.VSAbstractProtocol) serverObject;
- protocols.VSAbstractProtocol clientProtocol =
- (protocols.VSAbstractProtocol) clientObject;
-
- serverProtocol.onServerInit();
- clientProtocol.onClientInit();
-
- if (!serverProtocol.isEmpty() || !clientProtocol.isEmpty())
- editableProtocolsClassnames.add(protocolClassname);
-
- if (!serverProtocol.isEmpty()) {
- ArrayList<String> variables = new ArrayList<String>();
- variables.addAll(serverProtocol.getAllFullKeys());
- serverVariables.put(protocolClassname, variables);
- }
-
- if (!clientProtocol.isEmpty()) {
- ArrayList<String> variables = new ArrayList<String>();
- variables.addAll(clientProtocol.getAllFullKeys());
- clientVariables.put(protocolClassname, variables);
- }
-
- if (serverProtocol.hasOnServerStart())
- isOnServerStartProtocol.put(protocolClassname,
- new Boolean(true));
- }
- }
- }
-
- /**
- * Gets the editable protocols classnames.
- *
- * @return the editable protocols classnames
- */
- public static ArrayList<String> getEditableProtocolsClassnames() {
- return editableProtocolsClassnames;
- }
-
- /**
- * Gets the protocols server variable names.
- *
- * @return The variable names
- */
- public static ArrayList<String> getProtocolServerVariables(
- String protocolClassname) {
- return serverVariables.get(protocolClassname);
- }
-
- /**
- * Gets the protocols server variable names.
- *
- * @return The variable names
- */
- public static ArrayList<String> getProtocolClientVariables(
- String protocolClassname) {
- return clientVariables.get(protocolClassname);
- }
-
- /**
- * Gets the protocol names.
- *
- * @return the protocol names
- */
- public static Vector<String> getProtocolNames() {
- Set<String> set = eventClassnamesByNames.keySet();
- Vector<String> vector = new Vector<String>();
-
- for (String eventName : set)
- if (getClassnameByEventname(eventName).startsWith(
- "protocols.implementations"))
- vector.add(eventName);
-
- Collections.sort(vector);
-
- return vector;
- }
-
- /**
- * Gets the protocol classnames.
- *
- * @return the protocol classnames
- */
- public static Vector<String> getProtocolClassnames() {
- ArrayList<String> shortnames = new ArrayList<String>();
- shortnames.addAll(eventClassnamesByShortnames.keySet());
- Collections.sort(shortnames);
- Vector<String> vector = new Vector<String>();
-
- for (String eventShortname : shortnames) {
- String eventClassname = getClassnameByShortname(eventShortname);
- if (eventClassname.startsWith("protocols.implementations"))
- vector.add(eventClassname);
- }
-
- return vector;
- }
-
- /**
- * Gets the non protocol names.
- *
- * @return the non protocol names
- */
- public static Vector<String> getNonProtocolNames() {
- Set<String> set = eventClassnamesByNames.keySet();
- Vector<String> vector = new Vector<String>();
-
- for (String eventName : set)
- if (getClassnameByEventname(eventName).startsWith(
- "events.implementations"))
- vector.add(eventName);
-
- Collections.sort(vector);
-
- return vector;
- }
-
- /**
- * Gets the non protocol classnames.
- *
- * @return the non protocol classnames
- */
- public static Vector<String> getNonProtocolClassnames() {
- Set<String> set = eventNamesByClassnames.keySet();
- Vector<String> vector = new Vector<String>();
-
- for (String eventClassname : set)
- if (eventClassname.startsWith("events.implementations"))
- vector.add(eventClassname);
-
- Collections.sort(vector);
-
- return vector;
- }
-
- /**
- * Gets the classname.
- *
- * @param eventName the event name
- *
- * @return the classname
- */
- public static String getClassnameByEventname(String eventName) {
- return eventClassnamesByNames.get(eventName);
- }
-
- /**
- * Gets the name.
- *
- * @param eventClassname the event classname
- *
- * @return the name
- */
- public static String getNameByClassname(String eventClassname) {
- return eventNamesByClassnames.get(eventClassname);
- }
-
- /**
- * Gets the shortname.
- *
- * @param eventClassname the event classname
- *
- * @return the shortname
- */
- public static String getShortnameByClassname(String eventClassname) {
- return eventShortnamesByClassnames.get(eventClassname);
- }
-
- /**
- * Gets the classname.
- *
- * @param eventShortname the event shortname
- *
- * @return the shortname
- */
- public static String getClassnameByShortname(String eventShortname) {
- return eventClassnamesByShortnames.get(eventShortname);
- }
-
- /**
- * Checks if the protocol uses onServerStart or onClientStart
- *
- * @param protocolClassname the protocol's classname
- *
- * @return true if onServerStart, false if onClientStart
- */
- public static boolean isOnServerStartProtocol(String protocolClassname) {
- if (isOnServerStartProtocol.containsKey(protocolClassname)) {
- Boolean bool = isOnServerStartProtocol.get(protocolClassname);
- return bool.booleanValue();
- }
-
- return false;
- }
-
- /**
- * Creates the event instance by classname.
- *
- * @param eventClassname the event classname
- * @param process the process
- *
- * @return An instance of the event classname, if exists. Else null.
- */
- public static VSAbstractEvent createEventInstanceByClassname(
- String eventClassname, VSInternalProcess process) {
- Object protocolObj = new VSClassLoader().newInstance(eventClassname);
-
- if (protocolObj instanceof VSAbstractEvent) {
- VSAbstractEvent event = (VSAbstractEvent) protocolObj;
- event.init(process);
- return event;
- }
-
- return null;
- }
-
- /**
- * Creates the event instance by name.
- *
- * @param eventName the event name
- * @param process the process
- *
- * @return An instance of the event, if exists. Else null.
- */
- public static VSAbstractEvent createEventInstanceByName(String eventName,
- VSInternalProcess process) {
- return createEventInstanceByClassname(
- eventClassnamesByNames.get(eventName), process);
- }
-
- /**
- * Registers an event. Use the language settings of VSPrefs.
- *
- * @param eventClassname the event classname
- */
- private static void registerEvent(String eventClassname) {
- String eventName =
- prefs.getString("lang.en." + eventClassname);
- String eventShortname =
- prefs.getString("lang.en." + eventClassname + ".short");
- registerEvent(eventClassname, eventName, eventShortname);
- }
-
- /**
- * Registers an event.
- *
- * @param eventClassname the event classname
- * @param eventName the event name
- */
- private static void registerEvent(String eventClassname, String eventName) {
- registerEvent(eventClassname, eventName, null);
- }
-
- /**
- * Registers an event.
- *
- * @param eventClassname the event classname
- * @param eventName the event name
- * @param eventShortname the event shortname
- */
- private static void registerEvent(String eventClassname, String eventName,
- String eventShortname) {
- if (eventShortname == null)
- eventShortname = eventName;
-
- eventNamesByClassnames.put(eventClassname, eventName);
- eventShortnamesByClassnames.put(eventClassname, eventShortname);
- eventClassnamesByNames.put(eventName, eventClassname);
- eventClassnamesByShortnames.put(eventShortname, eventClassname);
- }
-}
diff --git a/sources/events/implementations/VSProcessCrashEvent.java b/sources/events/implementations/VSProcessCrashEvent.java
deleted file mode 100644
index 382906b..0000000
--- a/sources/events/implementations/VSProcessCrashEvent.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * VS-Simulator (http://vs-sim.buetow.org)
- * Copyright (c) 2008 - 2009 by Dipl.-Inform. (FH) Paul C. Buetow
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * All icons of the icons/ folder are under a Creative Commons
- * Attribution-Noncommercial-Share Alike License a CC-by-nc-sa.
- *
- * The icon's homepage is http://code.google.com/p/ultimate-gnome/
- */
-
-package events.implementations;
-
-import events.*;
-import simulator.*;
-
-/**
- * The class VSProcessCrashEvent. This event makes a process to crash.
- *
- * @author Paul C. Buetow
- */
-public class VSProcessCrashEvent extends VSAbstractEvent
- implements VSCopyableEvent {
- /** The serial version uid */
- private static final long serialVersionUID = 1L;
-
- /* (non-Javadoc)
- * @see events.VSCopyableEvent#initCopy(events.VSAbstractEvent)
- */
- public void initCopy(VSAbstractEvent copy) {
- }
-
- /* (non-Javadoc)
- * @see events.VSAbstractEvent#onInit()
- */
- public void onInit() {
- setClassname(getClass().toString());
- }
-
- /* (non-Javadoc)
- * @see events.VSAbstractEvent#createShortname()()
- */
- protected String createShortname(String savedShortname) {
- return VSMain.prefs.getString("lang.en.process.crash");
- }
-
- /* (non-Javadoc)
- * @see events.VSAbstractEvent#onStart()
- */
- public void onStart() {
- if (!process.isCrashed()) {
- process.isCrashed(true);
- log(prefs.getString("lang.en.crashed"));
- }
- }
-}
diff --git a/sources/events/implementations/VSProcessRecoverEvent.java b/sources/events/implementations/VSProcessRecoverEvent.java
deleted file mode 100644
index e7c87db..0000000
--- a/sources/events/implementations/VSProcessRecoverEvent.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * VS-Simulator (http://vs-sim.buetow.org)
- * Copyright (c) 2008 - 2009 by Dipl.-Inform. (FH) Paul C. Buetow
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * All icons of the icons/ folder are under a Creative Commons
- * Attribution-Noncommercial-Share Alike License a CC-by-nc-sa.
- *
- * The icon's homepage is http://code.google.com/p/ultimate-gnome/
- */
-
-package events.implementations;
-
-import events.*;
-import simulator.*;
-
-/**
- * The class VSProcessRecoverEvent. This event makes a process to recover if
- * it is crashed.
- *
- * @author Paul C. Buetow
- */
-public class VSProcessRecoverEvent extends VSAbstractEvent
- implements VSCopyableEvent {
- /** The serial version uid */
- private static final long serialVersionUID = 1L;
-
- /* (non-Javadoc)
- * @see events.VSCopyableEvent#initCopy(events.VSAbstractEvent)
- */
- public void initCopy(VSAbstractEvent copy) {
- }
-
- /* (non-Javadoc)
- * @see events.VSAbstractEvent#onInit()
- */
- public void onInit() {
- setClassname(getClass().toString());
- }
-
- /* (non-Javadoc)
- * @see events.VSAbstractEvent#createShortname()()
- */
- protected String createShortname(String savedShortname) {
- return VSMain.prefs.getString("lang.en.process.recover");
- }
-
- /* (non-Javadoc)
- * @see events.VSAbstractEvent#onStart()
- */
- public void onStart() {
- if (process.isCrashed()) {
- process.isCrashed(false);
- log(prefs.getString("lang.en.recovered"));
- }
- }
-}
diff --git a/sources/events/internal/VSAbstractInternalEvent.java b/sources/events/internal/VSAbstractInternalEvent.java
deleted file mode 100644
index ae0e2b8..0000000
--- a/sources/events/internal/VSAbstractInternalEvent.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * VS-Simulator (http://vs-sim.buetow.org)
- * Copyright (c) 2008 - 2009 by Dipl.-Inform. (FH) Paul C. Buetow
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * All icons of the icons/ folder are under a Creative Commons
- * Attribution-Noncommercial-Share Alike License a CC-by-nc-sa.
- *
- * The icon's homepage is http://code.google.com/p/ultimate-gnome/
- */
-
-package events.internal;
-
-import java.io.*;
-
-import events.VSAbstractEvent;
-import serialize.VSSerialize;
-
-/**
- * The class VSAbstractInternalEvent, this class if for destinguishing between
- * internal and non-internal events. Internal usage only.
- *
- * @author Paul C. Buetow
- */
-abstract public class VSAbstractInternalEvent extends VSAbstractEvent {
- /** The serial version uid */
- private static final long serialVersionUID = 1L;
-
- /* (non-Javadoc)
- * @see events.VSAbstractEvent#createShortname()()
- */
- protected String createShortname(String savedShortname) {
- return savedShortname;
- }
-
- /* (non-Javadoc)
- * @see serialize.VSSerializable#serialize(serialize.VSSerialize,
- * java.io.ObjectOutputStream)
- */
- public synchronized void serialize(VSSerialize serialize,
- ObjectOutputStream objectOutputStream)
- throws IOException {
- super.serialize(serialize, objectOutputStream);
-
- /** For later backwards compatibility, to add more stuff */
- objectOutputStream.writeObject(new Boolean(false));
-
- /** For later backwards compatibility, to add more stuff */
- objectOutputStream.writeObject(new Boolean(false));
- }
-
- /* (non-Javadoc)
- * @see serialize.VSSerializable#deserialize(serialize.VSSerialize,
- * java.io.ObjectInputStream)
- */
- @SuppressWarnings("unchecked")
- public synchronized void deserialize(VSSerialize serialize,
- ObjectInputStream objectInputStream)
- throws IOException, ClassNotFoundException {
- super.deserialize(serialize, objectInputStream);
-
- if (VSSerialize.DEBUG)
- System.out.println("Deserializing: VSAbstractInternalEvent");
-
- /** For later backwards compatibility, to add more stuff */
- objectInputStream.readObject();
-
- /** For later backwards compatibility, to add more stuff */
- objectInputStream.readObject();
- }
-}
diff --git a/sources/events/internal/VSMessageReceiveEvent.java b/sources/events/internal/VSMessageReceiveEvent.java
deleted file mode 100644
index ab8c929..0000000
--- a/sources/events/internal/VSMessageReceiveEvent.java
+++ /dev/null
@@ -1,112 +0,0 @@