diff options
| author | Paul Buetow <paul@buetow.org> | 2008-05-26 19:44:51 +0000 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2008-05-26 19:44:51 +0000 |
| commit | 8fd9c3e2980eb5720033584ac3cd2d156b5c9d63 (patch) | |
| tree | 1c7d183495319ac020134e71129d91d535bee417 /sources/protocols/VSAbstractProtocol.java | |
| parent | 99ae411186cb049bfd55887b2c521bbf0e8bc2be (diff) | |
new onClientSchedule and onServerSchedule abstract methods
Diffstat (limited to 'sources/protocols/VSAbstractProtocol.java')
| -rw-r--r-- | sources/protocols/VSAbstractProtocol.java | 52 |
1 files changed, 50 insertions, 2 deletions
diff --git a/sources/protocols/VSAbstractProtocol.java b/sources/protocols/VSAbstractProtocol.java index b726a2e..2c84d96 100644 --- a/sources/protocols/VSAbstractProtocol.java +++ b/sources/protocols/VSAbstractProtocol.java @@ -53,8 +53,28 @@ abstract public class VSAbstractProtocol extends VSAbstractEvent { */ public final void onStart() { if (isClient) { + currentContextIsServer = false; onClientStart(); + } + } + + /** + * Runs a client schedule + */ + public final void onClientScheduleStart() { + if (isClient) { currentContextIsServer = false; + onClientSchedule(); + } + } + + /** + * Runs a server schedule + */ + public final void onServerScheduleStart() { + if (isServer) { + currentContextIsServer = true; + onServerSchedule(); } } @@ -79,7 +99,7 @@ abstract public class VSAbstractProtocol extends VSAbstractEvent { } /** - * Checks if is server. + * Sets if is server. * * @param isServer the is server */ @@ -88,7 +108,16 @@ abstract public class VSAbstractProtocol extends VSAbstractEvent { } /** - * Checks if is client. + * Checks if is server. + * + * @param isServer the is server + */ + public final boolean isServer() { + return isServer; + } + + /** + * Sets if is client. * * @param isClient the is client */ @@ -97,6 +126,15 @@ abstract public class VSAbstractProtocol extends VSAbstractEvent { } /** + * Checks if is client. + * + * @param isClient the is client + */ + public final boolean isClient() { + return isClient; + } + + /** * Reset. */ public void reset() { @@ -124,6 +162,11 @@ abstract public class VSAbstractProtocol extends VSAbstractEvent { abstract protected void onClientReset(); /** + * On client schedule. + */ + abstract protected void onClientSchedule(); + + /** * On client recv. * * @param message the message @@ -143,6 +186,11 @@ abstract public class VSAbstractProtocol extends VSAbstractEvent { abstract protected void onServerRecv(VSMessage message); /** + * On server schedule. + */ + abstract protected void onServerSchedule(); + + /** * Gets the num processes. * * @return the num processes |
