From afed274c10a93957f82a009824cafe8d83aa68a8 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Fri, 15 Aug 2008 04:09:42 +0000 Subject: new branches --- VS-Sim-Javadoc/protocols/VSAbstractProtocol.html | 1019 ++++++++++++++++++++++ 1 file changed, 1019 insertions(+) create mode 100644 VS-Sim-Javadoc/protocols/VSAbstractProtocol.html (limited to 'VS-Sim-Javadoc/protocols/VSAbstractProtocol.html') diff --git a/VS-Sim-Javadoc/protocols/VSAbstractProtocol.html b/VS-Sim-Javadoc/protocols/VSAbstractProtocol.html new file mode 100644 index 0000000..d39f021 --- /dev/null +++ b/VS-Sim-Javadoc/protocols/VSAbstractProtocol.html @@ -0,0 +1,1019 @@ + + + + + + +VSAbstractProtocol + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +protocols +
+Class VSAbstractProtocol

+
+java.lang.Object
+  extended by prefs.VSPrefs
+      extended by prefs.VSSerializablePrefs
+          extended by events.VSAbstractEvent
+              extended by protocols.VSAbstractProtocol
+
+
+
All Implemented Interfaces:
VSSerializable
+
+
+
Direct Known Subclasses:
VSBasicMulticastProtocol, VSBerkelyTimeProtocol, VSBroadcastProtocol, VSDummyProtocol, VSExternalTimeSyncProtocol, VSInternalTimeSyncProtocol, VSOnePhaseCommitProtocol, VSPingPongProtocol, VSReliableMulticastProtocol, VSTwoPhaseCommitProtocol
+
+
+
+
public abstract class VSAbstractProtocol
extends VSAbstractEvent
+ + +

+The class VSAbstractProtocol, this class defined the basic framework of a + protocol. +

+ +

+

+
Author:
+
Paul C. Buetow
+
+
+ +

+ + + + + + + + + + + + + + + +
+Field Summary
+protected static booleanHAS_ON_CLIENT_START + +
+          The protocol has an onClientStart method
+protected static booleanHAS_ON_SERVER_START + +
+          The protocol has an onServerStart method
+ + + + + + + +
Fields inherited from class events.VSAbstractEvent
prefs, process
+ + + + + + + +
Fields inherited from class prefs.VSPrefs
BOOLEAN_PREFIX, COLOR_PREFIX, FLOAT_PREFIX, id, INTEGER_PREFIX, LONG_PREFIX, STRING_PREFIX, VECTOR_PREFIX
+  + + + + + + + + + + +
+Constructor Summary
VSAbstractProtocol(boolean hasOnServerStart) + +
+          A simple constructor.
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ voidcurrentContextIsServer(boolean currentContextIsServer) + +
+          Sets if the current context is server.
+ voiddeserialize(VSSerialize serialize, + java.io.ObjectInputStream objectInputStream) + +
+          Deserializes
+ intgetNumProcesses() + +
+          Gets the num processes.
+ booleanhasOnServerStart() + +
+          Checks how the protocol will start
+ booleanisClient() + +
+          Checks if is client.
+ voidisClient(boolean isClient) + +
+          Sets if is client.
+ booleanisRelevantMessage(VSMessage message) + +
+          Check's if its a relevant message.
+ booleanisServer() + +
+          Checks if is server.
+ voidisServer(boolean isServer) + +
+          Sets if is server.
+abstract  voidonClientInit() + +
+          On client init.
+abstract  voidonClientRecv(VSMessage message) + +
+          On client recv.
+abstract  voidonClientReset() + +
+          On client reset.
+abstract  voidonClientSchedule() + +
+          On client schedule.
+ voidonClientScheduleStart() + +
+          Runs a client schedule
+ voidonClientStart() + +
+          On client start.
+ voidonInit() + +
+          Every event has its own initialize method.
+ voidonMessageRecvStart(VSMessage message) + +
+          On message recv.
+abstract  voidonServerInit() + +
+          On server init.
+abstract  voidonServerRecv(VSMessage message) + +
+          On server recv.
+abstract  voidonServerReset() + +
+          On server reset.
+abstract  voidonServerSchedule() + +
+          On server schedule.
+ voidonServerScheduleStart() + +
+          Runs a server schedule
+ voidonServerStart() + +
+          On server start.
+ voidonStart() + +
+          Every event can get started.
+ voidremoveSchedules() + +
+          Removes all schedules of the protocol (server or client)
+ voidreset() + +
+          Resets the protocol.
+ voidscheduleAt(long time) + +
+          Reschedules the protocol for a new time and runs onClientSchedule or + onServerSchedule
+ voidsendMessage(VSMessage message) + +
+          Sends a message.
+ voidserialize(VSSerialize serialize, + java.io.ObjectOutputStream objectOutputStream) + +
+          Serializes
+ java.lang.StringtoString() + +
+           
+ + + + + + + +
Methods inherited from class events.VSAbstractEvent
equals, getClassname, getCopy, getCopy, getName, getProcess, getShortname, init, init, log, setClassname, setShortname
+ + + + + + + +
Methods inherited from class prefs.VSPrefs
clear, copyBooleans, copyColors, copyFloats, copyIntegers, copyLongs, copyStrings, deserialize_, getAllFullKeys, getBoolean, getBooleanKeySet, getBooleanObj, getColor, getColorKeySet, getDescription, getFloat, getFloatKeySet, getFloatObj, getID, getInteger, getIntegerKeySet, getIntegerObj, getLong, getLongKeySet, getLongObj, getObject, getRestriction, getString, getStringKeySet, getUnit, getVector, getVectorKeySet, initBoolean, initBoolean, initBoolean, initColor, initColor, initDescription, initFloat, initFloat, initFloat, initFloat, initInteger, initInteger, initInteger, initInteger, initInteger, initInteger, initLong, initLong, initLong, initLong, initRestriction, initString, initString, initUnit, initVector, initVector, initVector, isEmpty, objectExists, removeObject, serialize_, setBoolean, setBoolean, setColor, setFloat, setFloat, setInteger, setInteger, setLong, setLong, setObject, setString, setVector
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
+  +

+ + + + + + + + +
+Field Detail
+ +

+HAS_ON_SERVER_START

+
+protected static final boolean HAS_ON_SERVER_START
+
+
The protocol has an onServerStart method +

+

+
See Also:
Constant Field Values
+
+
+ +

+HAS_ON_CLIENT_START

+
+protected static final boolean HAS_ON_CLIENT_START
+
+
The protocol has an onClientStart method +

+

+
See Also:
Constant Field Values
+
+ + + + + + + + +
+Constructor Detail
+ +

+VSAbstractProtocol

+
+public VSAbstractProtocol(boolean hasOnServerStart)
+
+
A simple constructor. +

+

+
Parameters:
hasOnServerStart - true, if the protocol uses an onServerStart + method. false, if the protocol uses an onClientStart method instead.
+
+ + + + + + + + +
+Method Detail
+ +

+sendMessage

+
+public void sendMessage(VSMessage message)
+
+
Sends a message. +

+

+
Parameters:
message - the message to send
+
+
+
+ +

+onStart

+
+public final void onStart()
+
+
Description copied from class: VSAbstractEvent
+
Every event can get started. This method get's executed if the event + takes place. +

+

+
Specified by:
onStart in class VSAbstractEvent
+
+
+
+
+
+
+ +

+onInit

+
+public final void onInit()
+
+
Description copied from class: VSAbstractEvent
+
Every event has its own initialize method. +

+

+
Specified by:
onInit in class VSAbstractEvent
+
+
+
+
+
+
+ +

+onClientScheduleStart

+
+public final void onClientScheduleStart()
+
+
Runs a client schedule +

+

+
+
+
+
+ +

+onServerScheduleStart

+
+public final void onServerScheduleStart()
+
+
Runs a server schedule +

+

+
+
+
+
+ +

+onMessageRecvStart

+
+public final void onMessageRecvStart(VSMessage message)
+
+
On message recv. +

+

+
Parameters:
message - the message
+
+
+
+ +

+isRelevantMessage

+
+public final boolean isRelevantMessage(VSMessage message)
+
+
Check's if its a relevant message. +

+

+
Parameters:
message - the message to check +
Returns:
true, if it's a relevant meessage. false if the protocol + is wrong or if the server recv a server message/the client recv a + client message. Clients should only recv server messages and servers + should only recv client messages.
+
+
+
+ +

+currentContextIsServer

+
+public final void currentContextIsServer(boolean currentContextIsServer)
+
+
Sets if the current context is server. +

+

+
Parameters:
currentContextIsServer - the context.
+
+
+
+ +

+hasOnServerStart

+
+public final boolean hasOnServerStart()
+
+
Checks how the protocol will start +

+

+ +
Returns:
true, if this protocol uses onServerStart instead of + onClientStart
+
+
+
+ +

+isServer

+
+public final void isServer(boolean isServer)
+
+
Sets if is server. +

+

+
Parameters:
isServer - the is server
+
+
+
+ +

+isServer

+
+public final boolean isServer()
+
+
Checks if is server. +

+

+ +
Returns:
true, if the protocol has activated the server part
+
+
+
+ +

+isClient

+
+public final void isClient(boolean isClient)
+
+
Sets if is client. +

+

+
Parameters:
isClient - the is client
+
+
+
+ +

+isClient

+
+public final boolean isClient()
+
+
Checks if is client. +

+

+ +
Returns:
true, if the protocol has activated the client part
+
+
+
+ +

+reset

+
+public void reset()
+
+
Resets the protocol. +

+

+
+
+
+
+ +

+scheduleAt

+
+public final void scheduleAt(long time)
+
+
Reschedules the protocol for a new time and runs onClientSchedule or + onServerSchedule +

+

+
Parameters:
time - The process' local time to run the schedule at.
+
+
+
+ +

+removeSchedules

+
+public final void removeSchedules()
+
+
Removes all schedules of the protocol (server or client) +

+

+
+
+
+
+ +

+onClientInit

+
+public abstract void onClientInit()
+
+
On client init. +

+

+
+
+
+
+ +

+onClientStart

+
+public void onClientStart()
+
+
On client start. +

+

+
+
+
+
+ +

+onClientReset

+
+public abstract void onClientReset()
+
+
On client reset. +

+

+
+
+
+
+ +

+onClientSchedule

+
+public abstract void onClientSchedule()
+
+
On client schedule. +

+

+
+
+
+
+ +

+onClientRecv

+
+public abstract void onClientRecv(VSMessage message)
+
+
On client recv. +

+

+
Parameters:
message - the message
+
+
+
+ +

+onServerInit

+
+public abstract void onServerInit()
+
+
On server init. +

+

+
+
+
+
+ +

+onServerStart

+
+public void onServerStart()
+
+
On server start. +

+

+
+
+
+
+ +

+onServerReset

+
+public abstract void onServerReset()
+
+
On server reset. +

+

+
+
+
+
+ +

+onServerRecv

+
+public abstract void onServerRecv(VSMessage message)
+
+
On server recv. +

+

+
Parameters:
message - the message
+
+
+
+ +

+onServerSchedule

+
+public abstract void onServerSchedule()
+
+
On server schedule. +

+

+
+
+
+
+ +

+getNumProcesses

+
+public final int getNumProcesses()
+
+
Gets the num processes. +

+

+ +
Returns:
the num processes
+
+
+
+ +

+toString

+
+public java.lang.String toString()
+
+
+
Overrides:
toString in class VSPrefs
+
+
+
+
+
+
+ +

+serialize

+
+public void serialize(VSSerialize serialize,
+                      java.io.ObjectOutputStream objectOutputStream)
+               throws java.io.IOException
+
+
Description copied from interface: VSSerializable
+
Serializes +

+

+
Specified by:
serialize in interface VSSerializable
Overrides:
serialize in class VSAbstractEvent
+
+
+
Parameters:
serialize - The serialize object
objectOutputStream - The object output stream +
Throws: +
java.io.IOException
+
+
+
+ +

+deserialize

+
+public void deserialize(VSSerialize serialize,
+                        java.io.ObjectInputStream objectInputStream)
+                 throws java.io.IOException,
+                        java.lang.ClassNotFoundException
+
+
Description copied from interface: VSSerializable
+
Deserializes +

+

+
Specified by:
deserialize in interface VSSerializable
Overrides:
deserialize in class VSAbstractEvent
+
+
+
Parameters:
serialize - The serialize object
objectInputStream - The object input stream +
Throws: +
java.io.IOException +
java.lang.ClassNotFoundException
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + -- cgit v1.2.3