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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? simplereplicamanager.java

?? 中間件開發(fā)詳細(xì)說明:清華大學(xué)J2EE教程講義(ppt)-Tsinghua University J2EE tutorial lectures (ppt) [上載源碼成為會(huì)員下載此源碼] [成為VIP會(huì)
?? JAVA
?? 第 1 頁 / 共 3 頁
字號(hào):
            break;        // a file was delivered to this site, it is to be used for execution        // of a DataGridlet        case DataGridTags.FILE_DELIVERY:            file = (File) ev.get_data();            receiveFileDelivery(file);            break;        default:            System.out.println(super.get_name()                    + ".processOtherEvent(): Warning - unknown tag = "                    + ev.get_tag());            result = false;            break;        }        return result;    }    //------------------PROCESS USER REQUESTS----------------------------    /**     * Processes the request for adding a master file to the resource.     * Firstly, the file is added to the storage.     * <ul>     * <li>if there are no errors, a request for registration is sent to the     * Replica Catalogue. The request is saved in an array, to be furher     * processed when the Replica Catalogue returns a unique ID of this file     * (see the {@link #processMasterAddResult(Sim_event)} method).     * <br>     * <li>if an error occurs while adding the file to the storage, sends an     * error message back to the sender.     * </ul>     *     * @param ev    the event sent by the sender to be processed     */    private void processAddMasterFile(Sim_event ev) {        if (ev == null) {            return;        }        Object[] pack = (Object[]) ev.get_data();        if (pack == null) {            return;        }        File file = (File) pack[0]; // get the file        file.setMasterCopy(true); // set the file into a master copy        int sentFrom = ((Integer) pack[1]).intValue(); // get sender ID        /******     // DEBUG         System.out.println(super.get_name() + ".addMasterFile(): " +         file.getName() + " from " + GridSim.getEntityName(sentFrom));         *******/        Object[] data = new Object[3];        data[0] = file.getName();        int msg = addFile(file); // add the file        if (msg == DataGridTags.FILE_ADD_SUCCESSFUL) {            registerMasterFile(file);            data[1] = new Integer(sentFrom);            masterFilesWaitingForAddACK_.add(data);        } else {            data[1] = new Integer(-1); // no sender id            data[2] = new Integer(msg); // the result of adding a master file            sim_schedule(outputPort_, 0, DataGridTags.FILE_ADD_MASTER_RESULT,                    new IO_data(data, DataGridTags.PKT_SIZE, sentFrom));        }    }    /**     * Processes the request for adding a replica to the resource. Firstly, the     * file is added to the storage.     * <ul>     * <li>if there are no errors, a request for registration is sent to the     * Replica Catalogue. The request is saved in an array, to be furher     * processed when the Replica Catalogue returns the result of the     * registration (see the {@link #processCatalogueAddResult(Sim_event)}     * method).     * <br>     * <li>if an error occurs while adding the file to the storage, sends an     * error message to the user.     * </ul>     *     * @param ev    the event sent by the sender to be processed     */    private void processAddReplica(Sim_event ev) {        if (ev == null) {            return;        }        Object[] data = (Object[]) ev.get_data();        if (data == null) {            return;        }        File file = (File) data[0]; // get file        file.setMasterCopy(false); // set file as a replica        int req_source = ((Integer) data[1]).intValue(); // get sender id        int msg = addFile(file); // add file        if (msg == DataGridTags.FILE_ADD_SUCCESSFUL) {            registerFile(file); // register file to RC            data[0] = file.getName();            filesWaitingForAddACK_.add(data);        } else { // if an error occured, the notify the sender            sendResult(file.getName(), DataGridTags.FILE_ADD_REPLICA_RESULT,                    msg, req_source);        }    }    /**     * Deletes a master file from the storage     * @param ev    a Sim_event object     */    private void processDeleteMasterFile(Sim_event ev) {        processDelete(ev, true);    }    /**     * Deletes a replica file from the storage     * @param ev    a Sim_event object     */    private void processDeleteReplica(Sim_event ev) {        processDelete(ev, false);    }    /**     * Processes the request for deleting a file (either a master or a replica)     * from the resource. Firstly, it checks if it is possible to delete.     * The file is not deleted from the storage until the change is registered     * with the Replica Catalogue. When the result from the delete test is     * known, there are two possibilities     * <ul>     * <li>if there are no errors, a request for removing the registration is     * sent to the Replica Catalogue. The request is saved in an array, to be     * furher processed when the Replica Catalogue returns the result of the     * operation (see the {@link #processCatalogueDeleteResult(Sim_event)}     * method).     * <br>     * <li>if an error occurs while deleting the file from the storage, send an     * error message to the user.     * </ul>     *     * @param ev        the event sent by the sender to be processed     * @param isMaster  is the file to be deleted a master file or a replica     */    private void processDelete(Sim_event ev, boolean isMaster) {        if (ev == null) {            return;        }        Object[] data = (Object[]) ev.get_data();        if (data == null) {            return;        }        String filename = (String) data[0];        int req_source = ((Integer) data[1]).intValue();        int tag = -1;        // check if this file can be deleted (do not delete is right now)        int msg = deleteFileFromStorage(filename, isMaster, true);        if (msg == DataGridTags.FILE_DELETE_SUCCESSFUL) {            if (isMaster == true) // if it is a master file            {                masterFilesWaitingForDeleteACK_.add(data);                tag = DataGridTags.CTLG_DELETE_MASTER;            } else // if it is a replica            {                filesWaitingForDeleteACK_.add(data);                tag = DataGridTags.CTLG_DELETE_REPLICA;            }            // deregister this file from RC            super.deregisterDeletedFile(filename, tag);        } else // if an error occured, notify user        {            tag = DataGridTags.FILE_DELETE_REPLICA_RESULT;            if (isMaster == true) {                tag = DataGridTags.FILE_DELETE_MASTER_RESULT;            }            sendResult(filename, tag, msg, req_source);        }    }    /**     * Sends a file to the user that requested it.     * @param ev    the event sent by the user to be processed     */    private void processFileRequest(Sim_event ev) {        if (ev == null) {            return;        }        Object[] data = (Object[]) ev.get_data();        if (data == null) {            return;        }        String filename = (String) data[0]; // get file name        int req_source = ((Integer) data[1]).intValue(); // get sender        int ToS = 0; // a priority number for sending over the network        if (data.length == 3) {            ToS = ((Integer) data[2]).intValue(); // get ToS        }        File file = getFile(filename); // get the file        int size = 0;        if (file != null) {            size = file.getSizeInByte();        } else { // if file is not found            size = DataGridTags.PKT_SIZE;        }        super.sim_schedule(outputPort_, 0, DataGridTags.FILE_DELIVERY,                new IO_data(file, size, req_source, ToS));    }    //  -------------------PROCESS CATALOGUE RESPONSES/RESULTS-------------    /**     * If the addition to the Replica Catalogue is not successful, the file is     * deleted from the resource. The message is forwarded to the user that     * requested the addition of the replica.     *     * @param ev    the event sent by the Replica Catalogue     */    private void processCatalogueAddResult(Sim_event ev) {        if (ev == null) {            return;        }        Object[] pack = (Object[]) ev.get_data();        if (pack == null) {            return;        }        String filename = (String) pack[0]; // replica name        int msg = ((Integer) pack[1]).intValue(); // a message: error or not        /*******  // DEBUG         System.out.println(super.get_name() + ".processCatalogueAddResult(): " +         "received result of " + filename);         ******/        // find the event in the waiting list        Object[] dataTemp = searchEvent(filename, this.filesWaitingForAddACK_);        if (dataTemp != null) {            // if the addition was not successful, delete the file            if (msg != DataGridTags.CTLG_ADD_REPLICA_SUCCESSFUL) {                this.deleteFileFromStorage(filename, false, false);            } else {                msg = DataGridTags.FILE_ADD_SUCCESSFUL;            }            // delete this event from the waiting list            filesWaitingForAddACK_.remove(dataTemp);            // send message (error/success) to the user            sendResult(filename, DataGridTags.FILE_ADD_REPLICA_RESULT, msg,                    ((Integer) dataTemp[1]).intValue());        }    }    /**     * This method is very similar to     * {@link #processCatalogueAddResult(Sim_event)}. The only     * difference is that Replica Catalogue returns a uniqueID, i.e. a unique     * number that prevents having the same name represent different files. This     * uniqueId is added to the initial name. That means that the file is known     * by the new name also on the local resource.     * <br>     * <b>Example: </b> if the name of the file is "researchResults" and the     * uniqueID sent by the Replica Catalogue is 17, then the file is renamed to     * "researchResults17".     *     * @param ev    a Sim_event object     */    private void processMasterAddResult(Sim_event ev) {        if (ev == null) {            return;        }        Object[] data = (Object[]) ev.get_data();        if (data == null) {            return;        }        String filename = (String) data[0]; // get file name        int registrationID = ((Integer) data[1]).intValue(); // get unique ID        int msg = ((Integer) data[2]).intValue(); // get result        // if registration is successful        if (msg == DataGridTags.CTLG_ADD_MASTER_SUCCESSFUL) {            setID(filename, registrationID); // set the id of this file        }        // search this request from the waiting list        Object[] dataTemp = searchEvent(filename, masterFilesWaitingForAddACK_);        if (dataTemp != null) {            // if the addition was not successful, delete the file            if (msg != DataGridTags.CTLG_ADD_MASTER_SUCCESSFUL) {                this.deleteFileFromStorage(filename, true, false);            } else {                msg = DataGridTags.FILE_ADD_SUCCESSFUL;            }            // delete this event from the waiting list            masterFilesWaitingForAddACK_.remove(dataTemp);            // send back the result to sender            int senderID = ((Integer) dataTemp[1]).intValue();            Object pack[] = new Object[3];            pack[0] = filename; // file name            pack[1] = new Integer(registrationID); // unique id            pack[2] = new Integer(msg); // message            sim_schedule(outputPort_, 0, DataGridTags.FILE_ADD_MASTER_RESULT,                    new IO_data(pack, DataGridTags.PKT_SIZE, senderID));        }    }    /**     * Manages the response of the Replica Catalogue to a delete master request.     * @param ev    a Sim_event object     */    private void processMasterDeleteResult(Sim_event ev) {        processDeleteResult(ev, true);    }    /**     * Manages the response of the Replica Catalogue to a delete master request.     * @param ev    a Sim_event object     */    private void processCatalogueDeleteResult(Sim_event ev) {        processDeleteResult(ev, false);

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久久久久久97黄色工厂| 一区二区在线观看视频在线观看| 中文字幕成人av| 另类小说图片综合网| 国产**成人网毛片九色 | 洋洋成人永久网站入口| 美脚の诱脚舐め脚责91 | 在线一区二区观看| 国产精品免费久久久久| 91蜜桃免费观看视频| 亚洲美女免费在线| 欧美妇女性影城| 九九热在线视频观看这里只有精品| 久久综合视频网| zzijzzij亚洲日本少妇熟睡| 一区二区三区四区不卡视频| 在线成人午夜影院| 国产剧情一区二区| 亚洲综合一区二区| 精品久久久久久久久久久久包黑料 | 日韩国产精品91| 国产精品久久久久久久久搜平片 | 国产91高潮流白浆在线麻豆| 国产精品麻豆视频| 日韩一级二级三级| 一本色道久久综合精品竹菊| 美女一区二区久久| 亚洲人成影院在线观看| 欧美精品一区二区在线观看| 色视频欧美一区二区三区| 国产在线一区观看| 婷婷成人激情在线网| 中文字幕一区二区三区在线播放 | 日本丶国产丶欧美色综合| 蓝色福利精品导航| 欧美aⅴ一区二区三区视频| 亚洲欧美另类小说| 亚洲日本护士毛茸茸| 国产精品视频九色porn| 精品对白一区国产伦| 91精品国产综合久久久蜜臀粉嫩| 色综合激情久久| 91美女片黄在线| av一区二区三区四区| 成人黄色免费短视频| 国产成人在线网站| 国产成人精品www牛牛影视| 国产在线播精品第三| 国产精品自拍网站| 国产一区二区女| 成年人网站91| 色94色欧美sute亚洲线路一ni| 91视频91自| 精品国产伦理网| 日韩视频免费观看高清完整版 | 国产传媒欧美日韩成人| 国产乱人伦偷精品视频免下载 | 蜜臀av一区二区| 国产传媒欧美日韩成人| 97se亚洲国产综合在线| 欧美少妇bbb| 久久久亚洲高清| 亚洲精品你懂的| 精品一区二区三区免费| 国产成人免费在线| 欧美日韩视频在线观看一区二区三区| 91精品国产手机| 国产精品视频第一区| 日韩精品福利网| av午夜一区麻豆| 日韩一卡二卡三卡四卡| 日韩理论片在线| 久久99国产精品久久| 欧美亚洲另类激情小说| 欧美激情中文不卡| 免费欧美在线视频| 欧美亚洲高清一区| 欧美激情在线观看视频免费| 奇米影视在线99精品| 欧美又粗又大又爽| 国产精品剧情在线亚洲| 狠狠久久亚洲欧美| 91精品国产综合久久香蕉的特点| 中文字幕亚洲电影| 成人激情黄色小说| 久久蜜桃香蕉精品一区二区三区| 亚洲欧美日韩国产另类专区| 成人性色生活片免费看爆迷你毛片| 欧美一级在线观看| 日本免费在线视频不卡一不卡二| 色哟哟一区二区三区| 综合中文字幕亚洲| 91在线小视频| 亚洲图片欧美激情| 国内外成人在线| 91精品国产入口在线| 日本成人在线不卡视频| 欧美日韩精品欧美日韩精品| 午夜欧美一区二区三区在线播放| 欧美影院午夜播放| 人妖欧美一区二区| 久久久影视传媒| 99国产麻豆精品| 亚洲图片欧美色图| 91麻豆精品国产91久久久久久久久| 日产国产欧美视频一区精品 | 欧美日韩色一区| 男女男精品网站| 国产精品私人影院| 欧美综合天天夜夜久久| 久久99国产乱子伦精品免费| 国产精品久久看| 在线观看欧美黄色| 麻豆91精品91久久久的内涵| 欧美国产欧美亚州国产日韩mv天天看完整 | 亚洲乱码国产乱码精品精的特点| 欧美少妇一区二区| 国产精品一卡二卡在线观看| 亚洲一区二区免费视频| 精品久久久久99| 欧美亚洲国产怡红院影院| 久久精品国产亚洲5555| 亚洲同性同志一二三专区| 欧美高清激情brazzers| 99久久精品国产一区二区三区 | 国产一区二区在线观看免费| 一区二区三区日韩精品视频| 精品国产亚洲一区二区三区在线观看| 成人在线综合网| 国产一区二区精品久久99| 日韩国产欧美一区二区三区| 亚洲综合自拍偷拍| 国产精品麻豆欧美日韩ww| 久久久国产午夜精品 | 日韩欧美在线一区二区三区| 在线一区二区三区四区| 91一区在线观看| 99久久99久久精品免费观看| 国产成人高清视频| 美女网站色91| 国内精品嫩模私拍在线| 久热成人在线视频| 韩国精品久久久| 国产精品99久久久久久似苏梦涵 | 亚洲伊人伊色伊影伊综合网 | 久久综合久久99| 精品国产乱码久久久久久免费| 欧美高清www午色夜在线视频| 欧美日韩国产bt| 日韩一区二区中文字幕| 精品国产乱码久久久久久老虎 | 91精品国产一区二区三区香蕉| 欧洲一区在线观看| 91精品国产福利在线观看| 日韩一区二区三区视频| 久久亚洲影视婷婷| 中文字幕欧美一| 亚洲成人免费电影| 麻豆成人av在线| 99精品在线观看视频| 4438x成人网最大色成网站| 日韩亚洲欧美在线| 日韩毛片一二三区| 麻豆精品一二三| 99久久久久久99| 91精品久久久久久久91蜜桃| 成人黄色大片在线观看| 极品少妇xxxx精品少妇偷拍| 国产iv一区二区三区| 色综合色综合色综合色综合色综合 | 久久婷婷国产综合精品青草 | 欧美一级片在线看| 国产日韩欧美精品综合| 伊人婷婷欧美激情| 精品在线一区二区| 在线中文字幕一区| 国产日韩av一区| 视频一区国产视频| 99久久er热在这里只有精品66| 欧美一区欧美二区| 日本一区二区三级电影在线观看| 亚洲男人的天堂一区二区| 久久99久久精品欧美| 在线免费观看日本一区| 亚洲国产精品ⅴa在线观看| 丝袜亚洲另类欧美综合| 欧美综合视频在线观看| 国产精品盗摄一区二区三区| 久久精品国产一区二区三| 91黄色免费观看| 综合在线观看色| 91亚洲精品一区二区乱码| 日本一区二区三区视频视频| 精品影视av免费| xf在线a精品一区二区视频网站| 天天影视网天天综合色在线播放| 色久综合一二码| 一区二区三区不卡视频| 日本精品一区二区三区高清 | 久久综合中文字幕|