diff options
Diffstat (limited to 'sources/protocols/implementations/VSOnePhaseCommitProtocol.java')
| -rw-r--r-- | sources/protocols/implementations/VSOnePhaseCommitProtocol.java | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/sources/protocols/implementations/VSOnePhaseCommitProtocol.java b/sources/protocols/implementations/VSOnePhaseCommitProtocol.java index ab888cb..18c20a5 100644 --- a/sources/protocols/implementations/VSOnePhaseCommitProtocol.java +++ b/sources/protocols/implementations/VSOnePhaseCommitProtocol.java @@ -1,23 +1,23 @@ /* * Copyright (c) 2008 Paul C. Buetow, vs@dev.buetow.org - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * All icons of the icons/ folder are under a Creative Commons - * Attribution-Noncommercial-Share Alike License a CC-by-nc-sa. - * + * + * All icons of the icons/ folder are under a Creative Commons + * Attribution-Noncommercial-Share Alike License a CC-by-nc-sa. + * * The icon's homepage is http://code.google.com/p/ultimate-gnome/ */ @@ -30,14 +30,15 @@ import protocols.VSAbstractProtocol; import core.VSMessage; /** - * The class VSOnePhaseCommitProtocol. + * The class VSOnePhaseCommitProtocol, an implementation of the one phase + * commit protocol. + * + * @author Paul C. Buetow */ public class VSOnePhaseCommitProtocol extends VSAbstractProtocol { + /** The serial version uid */ private static final long serialVersionUID = 1L; - /* Client variables, coordinator */ - private ArrayList<Integer> pids; - /* Server variables */ private boolean ackSent; @@ -83,7 +84,8 @@ public class VSOnePhaseCommitProtocol extends VSAbstractProtocol { if (pids.size() != 0) { long timeout = getLong("timeout") + process.getTime(); - scheduleAt(timeout); /* Will run onServerSchedule() at the specified local time */ + /* Will run onServerSchedule() at the specified local time */ + scheduleAt(timeout); VSMessage message = new VSMessage(); message.setBoolean("wantAck", true); @@ -108,7 +110,8 @@ public class VSOnePhaseCommitProtocol extends VSAbstractProtocol { logg("ACK von Prozess " + pid + " erhalten!"); if (pids.size() == 0) - logg("ACKs von allen beteiligten Prozessen erhalten! Festgeschrieben!"); + logg("ACKs von allen beteiligten Prozessen erhalten! " + + "Festgeschrieben!"); } } @@ -119,6 +122,10 @@ public class VSOnePhaseCommitProtocol extends VSAbstractProtocol { onServerStart(); } + + /* Client variables, coordinator */ + private ArrayList<Integer> pids; + /* (non-Javadoc) * @see events.VSAbstractProtocol#onClientInit() */ |
