summaryrefslogtreecommitdiff
path: root/sources/events/VSRegisteredEvents.java
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2008-05-24 16:47:25 +0000
committerPaul Buetow <paul@buetow.org>2008-05-24 16:47:25 +0000
commit9f0d5c8015f4504bc8400cbb4247f38d9df62768 (patch)
tree5e5256f3ffe7810df3f873dbfeca86484b0629b6 /sources/events/VSRegisteredEvents.java
parent7040b1acc44805ab7208fa3975242c656cbc95a2 (diff)
new protocol editor works.
Diffstat (limited to 'sources/events/VSRegisteredEvents.java')
-rw-r--r--sources/events/VSRegisteredEvents.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/sources/events/VSRegisteredEvents.java b/sources/events/VSRegisteredEvents.java
index 79fd31c..2643d6f 100644
--- a/sources/events/VSRegisteredEvents.java
+++ b/sources/events/VSRegisteredEvents.java
@@ -10,6 +10,7 @@ public final class VSRegisteredEvents {
private static HashMap<String,String> eventClassnames;
private static HashMap<String,String> eventShortnames;
private static HashMap<String,String> eventNames;
+ private static ArrayList<String> editableProtocolsClassnames;
private static VSPrefs prefs;
public static void init(VSPrefs prefs_) {
@@ -17,6 +18,7 @@ public final class VSRegisteredEvents {
eventNames = new HashMap<String, String>();
eventShortnames = new HashMap<String, String>();
eventClassnames = new HashMap<String, String>();
+ editableProtocolsClassnames = new ArrayList<String>();
registerEvent("events.implementations.ProcessCrashEvent", "Prozessabsturz", null);
registerEvent("events.implementations.ProcessRecoverEvent", "Prozesswiederbelebung", null);
@@ -26,6 +28,22 @@ public final class VSRegisteredEvents {
registerEvent("protocols.implementations.ExternalTimeSyncProtocol", "Christians Methode zur externen Sync.", "Christians");
registerEvent("protocols.implementations.InternalTimeSyncProtocol", "Interne Synchronisation", "Interne Sync.");
registerEvent("protocols.implementations.PingPongProtocol", "Ping Pong", null);
+
+ /* 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 object = classLoader.newInstance(protocolClassname);
+ if (object instanceof protocols.VSProtocol) {
+ protocols.VSProtocol protocol = (protocols.VSProtocol) object;
+ if (!protocol.isEmpty())
+ editableProtocolsClassnames.add(protocolClassname);
+ }
+ }
+ }
+
+ public static ArrayList<String> getEditableProtocolsClassnames() {
+ return editableProtocolsClassnames;
}
public static Vector<String> getProtocolNames() {