当前位置: 首页>>代码示例>>Java>>正文


Java Request.getMessageInfo方法代码示例

本文整理汇总了Java中org.objectweb.proactive.core.body.request.Request.getMessageInfo方法的典型用法代码示例。如果您正苦于以下问题:Java Request.getMessageInfo方法的具体用法?Java Request.getMessageInfo怎么用?Java Request.getMessageInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.objectweb.proactive.core.body.request.Request的用法示例。


在下文中一共展示了Request.getMessageInfo方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onServeRequestBefore

import org.objectweb.proactive.core.body.request.Request; //导入方法依赖的package包/类
@Override
public int onServeRequestBefore(Request request) {
    // checkpoint if needed
    while (this.haveToCheckpoint()) {
        this.checkpoint(request);
    }

    // update the last served request index only if needed
    if (FTManagerCIC.isOCEnable) {
        MessageInfo mi = request.getMessageInfo();
        if (mi != null) {
            long requestIndex = ((MessageInfoCIC) (mi)).positionInHistory;
            if (this.lastServedRequestIndex.getValue() < requestIndex) {
                this.lastServedRequestIndex.setValue(requestIndex);
            }
        }
    }
    return 0;
}
 
开发者ID:mnip91,项目名称:proactive-component-monitoring,代码行数:20,代码来源:FTManagerCIC.java

示例2: filterQueue

import org.objectweb.proactive.core.body.request.Request; //导入方法依赖的package包/类
private void filterQueue(BlockingRequestQueue queue, CheckpointInfoCIC cic) {
    CircularArrayList<Request> internalQueue = ((BlockingRequestQueueImpl) queue).getInternalQueue();
    ListIterator<Request> itQueue = internalQueue.listIterator();
    while (itQueue.hasNext()) {
        Request current = (itQueue.next());
        MessageInfoCIC mi = (MessageInfoCIC) current.getMessageInfo();
        if (mi == null) {
            // is request an awaited or a non ft ?
            if (current instanceof AwaitedRequest) {
                // current is an awaited request that is not updated
                this.awaitedRequests.add((AwaitedRequest) current);
            }
        } else if (mi.isOrphanFor <= cic.checkpointIndex) {
            // current is an orpahn request
            // System.out.println("" + this.ownerID + " is filtering some orphan requests ...");
            AwaitedRequest ar = new AwaitedRequest(current.getSourceBodyID());
            itQueue.set(ar);
            this.awaitedRequests.add(ar);
        }
    }
}
 
开发者ID:mnip91,项目名称:proactive-component-monitoring,代码行数:22,代码来源:FTManagerCIC.java

示例3: onReceiveRequest

import org.objectweb.proactive.core.body.request.Request; //导入方法依赖的package包/类
/**
 * Message can be ignored if its index is l.t. lastestReceivedIndex[sender]
 * @see org.objectweb.proactive.core.body.ft.protocols.FTManager#onReceiveRequest(org.objectweb.proactive.core.body.request.Request)
 */
@Override
public int onReceiveRequest(Request request) {
    // if the message is sent from a non ft object
    if (request.getMessageInfo() == null) {
        request.setFTManager(this);
        return 0;
    }
    if (this.alreadyReceived(request)) {
        // this message has already been received. Ignore it
        request.setIgnoreIt(true);
        return IGNORED_MSG;
    }
    request.setFTManager(this);
    return 0;
}
 
开发者ID:mnip91,项目名称:proactive-component-monitoring,代码行数:20,代码来源:FTManagerPMLRB.java

示例4: onDeliverRequest

import org.objectweb.proactive.core.body.request.Request; //导入方法依赖的package包/类
@Override
public synchronized int onDeliverRequest(Request request) {
    int currentCheckpointIndex = this.checkpointIndex;

    //System.out.println(""+ this.ownerID + " receive " + request);
    if (this.isSignificant(request)) {
        //System.out.println(""+ this.ownerID + " receive significant " + request);
        MessageInfoCIC mi = (MessageInfoCIC) request.getMessageInfo();

        // history closure
        this.updateHistory(mi.historyIndex);
        //is there any corresponding awaited request ?
        if (!(this.updateAwaitedRequests(request))) {
            if (FTManagerCIC.isOCEnable || this.completingCheckpoint) {
                synchronized (historyLock) {
                    // if no, an awaited request is added to history
                    history.add(request.getSourceBodyID());
                }

                // inc the historized index
                this.deliveredRequestsCounter++;
                // manage local vector clock only if needed
                if (FTManagerCIC.isOCEnable) {
                    // set the position in history of the request
                    mi.positionInHistory = this.deliveredRequestsCounter;
                    // update local vector clock
                    this.updateLocalVectorClock(mi.vectorClock);
                }
            }
        } else {
            //this request must be then ignored...
            request.setIgnoreIt(true);
        }

        // udpate checkpoint index
        int ckptIndex = mi.checkpointIndex;
        if (ckptIndex > currentCheckpointIndex) {
            this.nextMax = Math.max(this.nextMax, ckptIndex);
            // mark the request that is orphan; it will be changed in awaited req in next ckpt
            // oprhan du indexCkpt+1 a mi.ckptIndex compris
            mi.isOrphanFor = (char) ckptIndex;
            //System.out.println("" + this.ownerID + " will have orphans in checkpoint " + ckptIndex);
        }
    }
    return currentCheckpointIndex;
}
 
开发者ID:mnip91,项目名称:proactive-component-monitoring,代码行数:47,代码来源:FTManagerCIC.java


注:本文中的org.objectweb.proactive.core.body.request.Request.getMessageInfo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。