diff options
| author | Paul Buetow <paul@buetow.org> | 2008-05-26 20:25:30 +0000 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2008-05-26 20:25:30 +0000 |
| commit | 230ddbf8753db60f1baa517e4d9a4d08885fac04 (patch) | |
| tree | dd2f9f4016ce8162768552cfb52d15a31372a4f6 /sources/events/internal/ProtocolScheduleEvent.java | |
| parent | 065bbc74eda368148851f0a8e8d9e4a016e48e28 (diff) | |
1 phase comit protocol works
Diffstat (limited to 'sources/events/internal/ProtocolScheduleEvent.java')
| -rw-r--r-- | sources/events/internal/ProtocolScheduleEvent.java | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/sources/events/internal/ProtocolScheduleEvent.java b/sources/events/internal/ProtocolScheduleEvent.java index 42f8836..12fbd7b 100644 --- a/sources/events/internal/ProtocolScheduleEvent.java +++ b/sources/events/internal/ProtocolScheduleEvent.java @@ -13,12 +13,23 @@ import protocols.VSAbstractProtocol; public class ProtocolScheduleEvent extends VSAbstractEvent { private static final long serialVersionUID = 1L; - /** The event is a client protocol schedule. */ - private boolean isClientSchedule; /* true = client, false = server */ + /** The event is a server protocol schedule. */ + private boolean isServerSchedule; /* true = server, false = client */ /** The reference to the protocol object to schedule. */ private VSAbstractProtocol protocol; + /** + * Create a ProtocolScheduleEvent object + * + * @param protocol the protocol + * @param isServerSchedule the event is a client protocol schedule if false, else server schedule + */ + public ProtocolScheduleEvent(VSAbstractProtocol protocol, boolean isServerSchedule) { + this.protocol = protocol; + this.isServerSchedule = isServerSchedule; + } + /* (non-Javadoc) * @see events.VSAbstractEvent#onInit() */ @@ -29,19 +40,19 @@ public class ProtocolScheduleEvent extends VSAbstractEvent { /** * Checks if is client protocol schedule. * - * @param isClientSchedule the event is a client protocol schedule if true, else server schedule + * @param isServerSchedule the event is a client protocol schedule if false, else server schedule */ - public void isClientSchedule(boolean isClientSchedule) { - this.isClientSchedule = isClientSchedule; + public void isServerSchedule(boolean isServerSchedule) { + this.isServerSchedule = isServerSchedule; } /** * Checks if is client protocol. * - * @return true, if is client protocol schedule, else server protocol schedule + * @return false, if is client protocol schedule, else server protocol schedule */ - public boolean isClientSchedule() { - return isClientSchedule; + public boolean isServerSchedule() { + return isServerSchedule; } /** @@ -66,9 +77,9 @@ public class ProtocolScheduleEvent extends VSAbstractEvent { * @see events.VSAbstractEvent#onStart() */ public void onStart() { - if (isClientSchedule) - protocol.onClientScheduleStart(); - else + if (isServerSchedule) protocol.onServerScheduleStart(); + else + protocol.onClientScheduleStart(); } } |
