summaryrefslogtreecommitdiff
path: root/sources/events/internal
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2008-05-26 20:25:30 +0000
committerPaul Buetow <paul@buetow.org>2008-05-26 20:25:30 +0000
commit230ddbf8753db60f1baa517e4d9a4d08885fac04 (patch)
treedd2f9f4016ce8162768552cfb52d15a31372a4f6 /sources/events/internal
parent065bbc74eda368148851f0a8e8d9e4a016e48e28 (diff)
1 phase comit protocol works
Diffstat (limited to 'sources/events/internal')
-rw-r--r--sources/events/internal/MessageReceiveEvent.java2
-rw-r--r--sources/events/internal/ProtocolScheduleEvent.java33
2 files changed, 23 insertions, 12 deletions
diff --git a/sources/events/internal/MessageReceiveEvent.java b/sources/events/internal/MessageReceiveEvent.java
index 300c4b3..f86b05f 100644
--- a/sources/events/internal/MessageReceiveEvent.java
+++ b/sources/events/internal/MessageReceiveEvent.java
@@ -59,7 +59,7 @@ public class MessageReceiveEvent extends VSAbstractEvent {
} else {
final VSAbstractProtocol protocol = (VSAbstractProtocol) protocolObj;
logg(buffer.toString());
- protocol.onMessageRecv(message);
+ protocol.onMessageRecvStart(message);
}
}
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();
}
}