From 230ddbf8753db60f1baa517e4d9a4d08885fac04 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 26 May 2008 20:25:30 +0000 Subject: 1 phase comit protocol works --- sources/events/internal/ProtocolScheduleEvent.java | 33 ++++++++++++++-------- 1 file changed, 22 insertions(+), 11 deletions(-) (limited to 'sources/events/internal/ProtocolScheduleEvent.java') 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(); } } -- cgit v1.2.3