diff options
| author | Paul Buetow <paul@buetow.org> | 2008-05-29 19:57:35 +0000 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2008-05-29 19:57:35 +0000 |
| commit | 42dc4e028067a15939cd2e46be4b7a8203e0dab7 (patch) | |
| tree | b366989eaa86c626eeaeeef284ffc44ce570a49f /sources/events/internal | |
| parent | 1467a9832da9294a4419d5ab7db573ba3ab649c6 (diff) | |
added some mor javadoc.
Diffstat (limited to 'sources/events/internal')
| -rw-r--r-- | sources/events/internal/VSMessageReceiveEvent.java | 10 | ||||
| -rw-r--r-- | sources/events/internal/VSProtocolEvent.java | 42 | ||||
| -rw-r--r-- | sources/events/internal/VSProtocolScheduleEvent.java | 27 |
3 files changed, 51 insertions, 28 deletions
diff --git a/sources/events/internal/VSMessageReceiveEvent.java b/sources/events/internal/VSMessageReceiveEvent.java index 0012775..6a12bba 100644 --- a/sources/events/internal/VSMessageReceiveEvent.java +++ b/sources/events/internal/VSMessageReceiveEvent.java @@ -9,9 +9,13 @@ import events.VSAbstractEvent; import protocols.VSAbstractProtocol; /** - * The Class VSMessageReceiveEvent. + * The Class VSMessageReceiveEvent. This event is used if a process receives + * a message. + * + * @author Paul C. Buetow */ public class VSMessageReceiveEvent extends VSAbstractEvent { + /** The serioal version uid */ private static final long serialVersionUID = 1L; /** The message. */ @@ -38,8 +42,8 @@ public class VSMessageReceiveEvent extends VSAbstractEvent { */ public boolean onStart() { boolean returnValue = true; - boolean onlyRelevantMessages = process.getPrefs(). - getBoolean("sim.messages.relevant"); + boolean onlyRelevantMessages = process.getPrefs().getBoolean( + "sim.messages.relevant"); String eventName = message.getName(); String protocolClassname = message.getProtocolClassname(); diff --git a/sources/events/internal/VSProtocolEvent.java b/sources/events/internal/VSProtocolEvent.java index 8b65c79..2720fe7 100644 --- a/sources/events/internal/VSProtocolEvent.java +++ b/sources/events/internal/VSProtocolEvent.java @@ -8,19 +8,26 @@ import events.*; import protocols.VSAbstractProtocol; /** - * The Class VSProtocolEvent. + * The Class VSProtocolEvent. This event is used if a protocol (server or + * client part) of a process gets enabled or disabled. An object of this class + * can be for 4 different purporses! Activation of the client protocol, + * deactivation of the client protocol, activation of the server protocol, + * deactivation of the server protocol. + * + * @author Paul C. Buetow */ public class VSProtocolEvent extends VSAbstractEvent { + /** The serial version uid */ private static final long serialVersionUID = 1L; /** The protocol classname. */ private String protocolClassname; - /** The event is a client protocol. */ - private boolean isClientProtocol; /* true = client, false = server */ + /** The event is a client protocol if true. Else it is a server protocol */ + private boolean isClientProtocol; - /** The event is a protocol activation. */ - private boolean isProtocolActivation; /* true = activate, false = deactivate */ + /** The event is a protocol activation if true. Else it is a deactivation */ + private boolean isProtocolActivation; /* (non-Javadoc) * @see events.VSAbstractEvent#onInit() @@ -30,36 +37,40 @@ public class VSProtocolEvent extends VSAbstractEvent { } /** - * Checks if is client protocol. + * Sets if it is a client protocol activation/deactivation. * - * @param isClientProtocol the is client protocol + * @param isClientProtocol the event is client protocol if true. the event + * is a server protocol if false. */ public void isClientProtocol(boolean isClientProtocol) { this.isClientProtocol = isClientProtocol; } /** - * Checks if is client protocol. + * Checks if it is a client protocol activation/deactivation. * - * @return true, if is client protocol + * @return the event is client protocol if true. the event + * is a server protocol if false. */ public boolean isClientProtocol() { return isClientProtocol; } /** - * Checks if is protocol activation. + * Sets if it is protocol activation. * - * @param isProtocolActivation the is protocol activation + * @param isProtocolActivation true, if it is a protocol activation. false, + * if it is a protocol deactivation. */ public void isProtocolActivation(boolean isProtocolActivation) { this.isProtocolActivation = isProtocolActivation; } /** - * Checks if is protocol activation. + * Checks if it is protocol activation. * - * @return true, if is protocol activation + * @return true, if it is a protocol activation. false, if it is a protocol + * deactivation. */ public boolean isProtocolActivation() { return isProtocolActivation; @@ -78,12 +89,11 @@ public class VSProtocolEvent extends VSAbstractEvent { * @see events.VSAbstractEvent#onStart() */ public boolean onStart() { - VSAbstractProtocol protocol = process.getProtocolObject( - protocolClassname); + VSAbstractProtocol protocol = + process.getProtocolObject(protocolClassname); if (isClientProtocol) protocol.isClient(isProtocolActivation); - else protocol.isServer(isProtocolActivation); diff --git a/sources/events/internal/VSProtocolScheduleEvent.java b/sources/events/internal/VSProtocolScheduleEvent.java index 9c72124..abe1380 100644 --- a/sources/events/internal/VSProtocolScheduleEvent.java +++ b/sources/events/internal/VSProtocolScheduleEvent.java @@ -8,9 +8,14 @@ import events.*; import protocols.VSAbstractProtocol; /** - * The Class VSProtocolScheduleEvent. + * The Class VSProtocolScheduleEvent. This event is used if a protocol (which + * is a subclass of VSAbstractProtocol) reschedules itself to run again on a + * specific time. + * + * @author Paul C. Buetow */ public class VSProtocolScheduleEvent extends VSAbstractEvent { + /** The serial version uid */ private static final long serialVersionUID = 1L; /** The event is a server protocol schedule. */ @@ -23,9 +28,11 @@ public class VSProtocolScheduleEvent extends VSAbstractEvent { * Create a VSProtocolScheduleEvent object * * @param protocol the protocol - * @param isServerSchedule the event is a client protocol schedule if false, else server schedule + * @param isServerSchedule the event is a client protocol schedule if + * false, else server schedule */ - public VSProtocolScheduleEvent(VSAbstractProtocol protocol, boolean isServerSchedule) { + public VSProtocolScheduleEvent(VSAbstractProtocol protocol, + boolean isServerSchedule) { this.protocol = protocol; this.isServerSchedule = isServerSchedule; } @@ -38,25 +45,27 @@ public class VSProtocolScheduleEvent extends VSAbstractEvent { } /** - * Checks if is client protocol schedule. + * Sets if it is client protocol schedule. * - * @param isServerSchedule the event is a client protocol schedule if false, else server schedule + * @param isServerSchedule false, if the event is a client protocol + * schedule. true, if server. */ public void isServerSchedule(boolean isServerSchedule) { this.isServerSchedule = isServerSchedule; } /** - * Checks if is client protocol. + * Sets if it is client protocol schedule. * - * @return false, if is client protocol schedule, else server protocol schedule + * @return false, if the event is a client protocol schedule. true, if + * server. */ public boolean isServerSchedule() { return isServerSchedule; } /** - * Sets the protocol + * Sets the protocol. * * @param protocol the protocol */ @@ -65,7 +74,7 @@ public class VSProtocolScheduleEvent extends VSAbstractEvent { } /** - * Gets the protocol + * Gets the protocol. * * @return the protocol */ |
