diff options
| author | Paul Buetow <paul@buetow.org> | 2008-05-29 13:55:34 +0000 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2008-05-29 13:55:34 +0000 |
| commit | b8f2687296ad47626412e2a54f4916f7fabc4d6d (patch) | |
| tree | 247757bbb960ddceb5adefe89df2fd8115107bfc /sources/core/VSMessage.java | |
| parent | cd2024527c84e3e0fd22072a16ac1ff18e6d406d (diff) | |
Only relevant message delivering works.
Diffstat (limited to 'sources/core/VSMessage.java')
| -rw-r--r-- | sources/core/VSMessage.java | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/sources/core/VSMessage.java b/sources/core/VSMessage.java index 663abbc..25dbf27 100644 --- a/sources/core/VSMessage.java +++ b/sources/core/VSMessage.java @@ -18,6 +18,17 @@ public class VSMessage extends VSPrefs { /** The serial version uid */ private static final long serialVersionUID = 1L; + /** The constant IS_SERVER_MESSAGE. */ + public static final boolean IS_SERVER_MESSAGE = true; + + /** The constant IS_CLIENT_MESSAGE. */ + public static final boolean IS_CLIENT_MESSAGE = false; + + /** true, if the message has been sent from a server. false, if the message + * has been sent from a client. + */ + private boolean isServerMessage; + /** Each message belongs to a specific protocol. This variable defined the * class name of the protocol being used. */ @@ -61,10 +72,13 @@ public class VSMessage extends VSPrefs { * * @param process The sending process of this message. * @param protocolClassname The classname of the protocol this message. + * @param isServerMessage Sets if the message has been sent by a server. */ - public void init(VSProcess process, String protocolClassname) { + public void init(VSProcess process, String protocolClassname, + boolean isServerMessage) { this.sendingProcess = process; this.protocolClassname = protocolClassname; + this.isServerMessage = isServerMessage; this.prefs = process.getPrefs(); lamportTime = sendingProcess.getLamportTime(); @@ -125,6 +139,16 @@ public class VSMessage extends VSPrefs { return vectorTime; } + /** + * Checks if the message has been sent by a server or a client. + * + * @return true, if the message has been sent by a server. false, if the + * message has been sent by a clien. + */ + public boolean isServerMessage() { + return isServerMessage; + } + /* (non-Javadoc) * @see prefs.VSPrefs#toString() */ |
