From b8f2687296ad47626412e2a54f4916f7fabc4d6d Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Thu, 29 May 2008 13:55:34 +0000 Subject: Only relevant message delivering works. --- sources/core/VSMessage.java | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'sources/core/VSMessage.java') 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() */ -- cgit v1.2.3