summaryrefslogtreecommitdiff
path: root/sources/protocols/implementations/OnePhaseCommitProtocol.java
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2008-05-27 17:23:45 +0000
committerPaul Buetow <paul@buetow.org>2008-05-27 17:23:45 +0000
commit97a3a4f07cdc8437f73f4270b237e85c7739a6be (patch)
tree32154e63775f1fa145d176301840e3150b8eb001 /sources/protocols/implementations/OnePhaseCommitProtocol.java
parent39e9eb74c011ee5351ac1796e5df529a70aa8945 (diff)
client and server variables are now separate in the editor.
Diffstat (limited to 'sources/protocols/implementations/OnePhaseCommitProtocol.java')
-rw-r--r--sources/protocols/implementations/OnePhaseCommitProtocol.java31
1 files changed, 18 insertions, 13 deletions
diff --git a/sources/protocols/implementations/OnePhaseCommitProtocol.java b/sources/protocols/implementations/OnePhaseCommitProtocol.java
index c22c47d..53c8ce6 100644
--- a/sources/protocols/implementations/OnePhaseCommitProtocol.java
+++ b/sources/protocols/implementations/OnePhaseCommitProtocol.java
@@ -27,7 +27,12 @@ public class OnePhaseCommitProtocol extends VSAbstractProtocol {
*/
public OnePhaseCommitProtocol() {
setClassname(getClass().toString());
+ }
+ /* (non-Javadoc)
+ * @see events.VSAbstractProtocol#onClientInit()
+ */
+ public void onClientInit() {
/* Can be changed via GUI variables editor of each process */
Vector<Integer> vec = new Vector<Integer>();
vec.add(2);
@@ -38,15 +43,9 @@ public class OnePhaseCommitProtocol extends VSAbstractProtocol {
}
/* (non-Javadoc)
- * @see events.VSAbstractEvent#onInit()
- */
- protected void onInit() {
- }
-
- /* (non-Javadoc)
* @see protocols.VSAbstractProtocol#onClientReset()
*/
- protected void onClientReset() {
+ public void onClientReset() {
if (pids != null) {
pids.clear();
pids.addAll(getVector("pids"));
@@ -56,7 +55,7 @@ public class OnePhaseCommitProtocol extends VSAbstractProtocol {
/* (non-Javadoc)
* @see protocols.VSAbstractProtocol#onClientStart()
*/
- protected void onClientStart() {
+ public void onClientStart() {
if (pids == null) {
pids = new ArrayList<Integer>();
pids.addAll(getVector("pids"));
@@ -75,7 +74,7 @@ public class OnePhaseCommitProtocol extends VSAbstractProtocol {
/* (non-Javadoc)
* @see protocols.VSAbstractProtocol#onClientRecv(core.VSMessage)
*/
- protected void onClientRecv(VSMessage recvMessage) {
+ public void onClientRecv(VSMessage recvMessage) {
if (pids.size() == 0)
return;
@@ -96,21 +95,27 @@ public class OnePhaseCommitProtocol extends VSAbstractProtocol {
/* (non-Javadoc)
* @see protocols.VSAbstractProtocol#onClientSchedule()
*/
- protected void onClientSchedule() {
+ public void onClientSchedule() {
onClientStart();
}
/* (non-Javadoc)
+ * @see events.VSAbstractProtocol#onServerInit()
+ */
+ public void onServerInit() {
+ }
+
+ /* (non-Javadoc)
* @see protocols.VSAbstractProtocol#onServerReset()
*/
- protected void onServerReset() {
+ public void onServerReset() {
ackSent = false;
}
/* (non-Javadoc)
* @see protocols.VSAbstractProtocol#onServerRecv(core.VSMessage)
*/
- protected void onServerRecv(VSMessage recvMessage) {
+ public void onServerRecv(VSMessage recvMessage) {
if (ackSent)
return;
@@ -125,7 +130,7 @@ public class OnePhaseCommitProtocol extends VSAbstractProtocol {
/* (non-Javadoc)
* @see protocols.VSAbstractProtocol#onServerSchedule()
*/
- protected void onServerSchedule() {
+ public void onServerSchedule() {
}
/* (non-Javadoc)