亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? twophasevotingadapter.java

?? JGRoups源碼
?? JAVA
字號:
package org.jgroups.blocks;import org.jgroups.ChannelException;/** * This adapter introduces simple two-phase voting on a specified decree. All * nodes in the group receive a decree in "prepare" phase where they expres * their opinion on the decree. If all nodes voted positively on decree, next * phase "commit" fixes changes that were made in "prepare" phase, otherwise  * changes are canceled in "abort" phase.  *  * @author Roman Rokytskyy (rrokytskyy@acm.org) * @author Robert Schaffar-Taurok (robert@fusion.at) * @version $Id: TwoPhaseVotingAdapter.java,v 1.4 2005/06/08 15:56:54 publicnmi Exp $ */public class TwoPhaseVotingAdapter {    private final VotingAdapter voteChannel;    /**     * Creats an instance of the class.     * @param voteChannel the channel that will be used for voting.     */    public TwoPhaseVotingAdapter(VotingAdapter voteChannel) {        this.voteChannel = voteChannel;    }    /**     * Wraps actual listener with the VoteChannelListener and adds to the     * voteChannel     */    public void addListener(TwoPhaseVotingListener listener) {        voteChannel.addVoteListener(new TwoPhaseVoteWrapper(listener));    }    /**     * Removes the listener from the voteChannel     */    public void removeListener(TwoPhaseVotingListener listener) {        voteChannel.removeVoteListener(new TwoPhaseVoteWrapper(listener));    }    /**     * Performs the two-phase voting on the decree. After the voting each     * group member remains in the same state as others.     */    public boolean vote(Object decree, long timeout) throws ChannelException {        return vote(decree, timeout, null);    }    /**     * Performs the two-phase voting on the decree. After the voting each     * group member remains in the same state as others.     */    public boolean vote(Object decree, long timeout, VoteResponseProcessor voteResponseProcessor) throws ChannelException {        // wrap real decree        TwoPhaseWrapper wrappedDecree = new TwoPhaseWrapper(decree);        // check the decree acceptance        try {            if (voteChannel.vote(wrappedDecree, timeout / 3, voteResponseProcessor)) {                wrappedDecree.commit();                // try to commit decree                if (!voteChannel.vote(wrappedDecree, timeout / 3, voteResponseProcessor)) {                    // strange, should fail during prepare... abort all                    wrappedDecree.abort();                    voteChannel.vote(wrappedDecree, timeout / 3, voteResponseProcessor);                    return false;                } else                        return true;            } else {                // somebody is not accepting the decree... abort                wrappedDecree.abort();                voteChannel.vote(wrappedDecree, timeout / 3, voteResponseProcessor);                return false;            }        } catch(ChannelException chex) {            wrappedDecree.abort();            voteChannel.vote(wrappedDecree, timeout / 3, voteResponseProcessor);            throw chex;        }    }         /**     * @return Returns the voteChannel.     */    public VotingAdapter getVoteChannel() {        return voteChannel;    }        public static class TwoPhaseVoteWrapper implements VotingListener {            private final TwoPhaseVotingListener listener;            public TwoPhaseVoteWrapper(TwoPhaseVotingListener listener) {            this.listener = listener;        }            public boolean vote(Object decree) throws VoteException {            if (!(decree instanceof TwoPhaseWrapper))                throw new VoteException("Not my type of decree. Ignore me.");                TwoPhaseWrapper wrapper = (TwoPhaseWrapper)decree;                // invoke the corresponding operation            if (wrapper.isPrepare())                return listener.prepare(wrapper.getDecree());            else            if (wrapper.isCommit())                return listener.commit(wrapper.getDecree());            else {                listener.abort(wrapper.getDecree());                return false;            }        }            /*             This wrapper is completely equal to the object it wraps.             Therefore the hashCode():int and equals(Object):boolean are         simply delegated to the wrapped code.             */            public int hashCode() {	return listener.hashCode(); }        public boolean equals(Object other) { return listener.equals(other); }    }    /**     * Wrapper of the decree to voting decree.     */    public static class TwoPhaseWrapper implements java.io.Serializable {        private static final int PREPARE = 0;        private static final int COMMIT = 1;        private static final int ABORT = 2;            public TwoPhaseWrapper(Object decree) {            setDecree(decree);            setType(PREPARE);        }            private Object decree;        private int type;            public Object getDecree(){ return decree; }        public void setDecree(Object decree){ this.decree = decree; }            private int getType() { return type; }        private void setType(int type) { this.type = type; }        private boolean isType(int type) { return this.type == type; }            public boolean isPrepare() { return isType(PREPARE); }        public boolean isCommit() { return isType(COMMIT); }        public boolean isAbort() { return isType(ABORT); }            public void commit() { setType(COMMIT); }        public void abort() { setType(ABORT); }            public String toString() { return decree.toString(); }    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品电影在线播放| 国产精品二三区| 亚洲自拍偷拍欧美| 成人久久视频在线观看| 欧美视频中文一区二区三区在线观看| 欧美在线免费观看视频| 欧美日本在线看| 精品国产凹凸成av人网站| 国产精品麻豆一区二区| 国产一区在线视频| 在线综合视频播放| 亚洲成人黄色小说| 欧美丝袜丝交足nylons| 亚洲女人的天堂| 色婷婷精品久久二区二区蜜臀av| 久久精品亚洲麻豆av一区二区 | 国产成人av电影| 2023国产精品视频| 久久不见久久见中文字幕免费| 欧美一区二区在线播放| 免费国产亚洲视频| 国产欧美精品一区二区色综合| 精品亚洲免费视频| 国产欧美日本一区视频| 91亚洲精品久久久蜜桃| 亚洲国产一区二区视频| 欧美疯狂性受xxxxx喷水图片| 免费看日韩a级影片| 国产亚洲精品资源在线26u| 成人av在线影院| 亚洲成人动漫精品| 精品成人在线观看| 91在线一区二区三区| 日韩精品一区第一页| 中文字幕精品一区二区三区精品| 亚洲电影欧美电影有声小说| 欧美性欧美巨大黑白大战| 经典三级视频一区| 欧美国产精品一区二区三区| 欧美视频精品在线| 成人精品鲁一区一区二区| 亚洲自拍偷拍图区| 综合av第一页| 久久久久久久网| 日韩午夜激情av| 激情综合一区二区三区| 一区二区三区中文在线观看| 日韩欧美一级片| 欧美日韩国产综合视频在线观看 | 日韩女优av电影| 欧美综合视频在线观看| 久久99精品久久久久久| 亚洲a一区二区| 亚洲最大成人网4388xx| 国产精品三级av在线播放| 久久久久久久久久久久久女国产乱| 欧美亚洲日本一区| 一本一道综合狠狠老| 成人精品视频一区二区三区尤物| 麻豆成人久久精品二区三区小说| 一区二区成人在线| 亚洲一区中文日韩| 亚洲综合激情另类小说区| 一区二区三区蜜桃网| 亚洲三级免费电影| 久久久久国产精品麻豆ai换脸| 91精品福利在线| 97久久超碰国产精品| 色综合天天在线| 欧美午夜片在线观看| 91麻豆精品国产自产在线观看一区| 欧美美女网站色| 欧美精品一区二区三区蜜桃| 久久综合狠狠综合久久综合88 | 99久久精品国产观看| 91蝌蚪porny| 久久婷婷成人综合色| 久久夜色精品一区| 久久久久97国产精华液好用吗| 国产精品家庭影院| 亚洲一区二区三区小说| 蜜桃91丨九色丨蝌蚪91桃色| 国产一区二三区| 福利91精品一区二区三区| 不卡视频免费播放| 欧美自拍偷拍午夜视频| 欧美日高清视频| 欧美一区二区三区思思人| wwwwww.欧美系列| 亚洲一区在线电影| www.欧美日韩国产在线| 欧美视频一二三区| 国产精品久久久久久久久果冻传媒| 无吗不卡中文字幕| 欧美在线观看一区二区| 亚洲国产精品ⅴa在线观看| 五月婷婷综合在线| 久久国产精品无码网站| 99久久婷婷国产| 久久综合av免费| 久久精品国产99国产| 欧美性生活影院| 日韩美女视频一区| 粉嫩aⅴ一区二区三区四区| 欧美变态凌虐bdsm| 看国产成人h片视频| 欧美放荡的少妇| 亚洲超碰97人人做人人爱| 欧美性色欧美a在线播放| 亚洲另类在线视频| 在线观看国产日韩| 亚洲一区在线观看免费观看电影高清| 95精品视频在线| 一区二区三区四区在线| 色呦呦网站一区| 视频一区中文字幕国产| 在线不卡a资源高清| 免费在线看成人av| 亚洲精品一区二区三区蜜桃下载| 国产真实乱子伦精品视频| 久久婷婷成人综合色| av福利精品导航| 亚洲精品视频自拍| 日韩美女一区二区三区| 国产成人av一区二区三区在线| 国产精品福利在线播放| 欧美sm极限捆绑bd| 久久国产三级精品| 中文字幕电影一区| 欧美日韩一级大片网址| 久久99精品国产91久久来源| 国产精品福利一区二区三区| 日韩精品综合一本久道在线视频| 久久91精品国产91久久小草| 欧美成人艳星乳罩| 91网站在线播放| 日本最新不卡在线| 中文字幕一区日韩精品欧美| 欧美乱妇20p| a级精品国产片在线观看| 男男gaygay亚洲| 亚洲高清视频的网址| 国产精品无遮挡| 日韩一级片在线观看| 91麻豆自制传媒国产之光| 国产一区欧美一区| 亚洲成在线观看| 亚洲精品欧美专区| 中文字幕+乱码+中文字幕一区| 欧美日韩午夜影院| 在线精品亚洲一区二区不卡| 成人国产精品免费| 国产成人在线观看| 国产乱码一区二区三区| 天天射综合影视| 亚洲mv大片欧洲mv大片精品| 日韩精彩视频在线观看| 国产女同互慰高潮91漫画| 精品国产乱码久久久久久浪潮 | 国产69精品久久久久毛片| 久久精品国产精品青草| 久久精品国内一区二区三区| 蜜臀久久久99精品久久久久久| 日韩高清在线一区| 青青草原综合久久大伊人精品优势| 亚洲成人免费视频| 日产精品久久久久久久性色| 国产乱码精品1区2区3区| 东方欧美亚洲色图在线| 成人看片黄a免费看在线| 色综合咪咪久久| 91麻豆国产自产在线观看| 欧美日韩在线三区| 欧美一二三区在线观看| 欧美激情综合网| 亚洲黄色小视频| 久久se精品一区精品二区| 国产酒店精品激情| 欧洲一区二区三区在线| 欧美精品一区二区三区久久久| 日本一区二区三区在线观看| 亚洲日本va午夜在线影院| 日韩va亚洲va欧美va久久| 国产 日韩 欧美大片| 在线91免费看| 国产精品夫妻自拍| 狠狠色伊人亚洲综合成人| 色婷婷激情综合| 国产日韩成人精品| 国产一区二区精品久久99| 在线观看成人小视频| 中文字幕高清不卡| 国产精品99久久久久久有的能看| 色久优优欧美色久优优| 国产精品美女久久福利网站| 美女网站色91| 欧美一级艳片视频免费观看| 亚洲国产视频网站| 精品视频在线看| 一区二区三区在线观看网站|