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


Java CommitTransactionReply.isSerializedType方法代码示例

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


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

示例1: handleMessage

import org.opendaylight.controller.cluster.datastore.messages.CommitTransactionReply; //导入方法依赖的package包/类
boolean handleMessage(Object message, EntityOwnershipShard shard) {
    boolean handled = true;
    if (CommitTransactionReply.isSerializedType(message)) {
        // Successful reply from a local commit.
        inflightCommitSucceeded(shard);
    } else if (message instanceof akka.actor.Status.Failure) {
        // Failure reply from a local commit.
        inflightCommitFailure(((Failure) message).cause(), shard);
    } else if (COMMIT_RETRY_MESSAGE.equals(message)) {
        retryInflightCommit(shard);
    } else {
        handled = false;
    }

    return handled;
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:17,代码来源:EntityOwnershipShardCommitCoordinator.java

示例2: isSerializedReplyType

import org.opendaylight.controller.cluster.datastore.messages.CommitTransactionReply; //导入方法依赖的package包/类
@Override
public boolean isSerializedReplyType(final Object reply) {
    return CommitTransactionReply.isSerializedType(reply);
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:5,代码来源:ThreePhaseCommitCohortProxy.java

示例3: verifyCohortFutures

import org.opendaylight.controller.cluster.datastore.messages.CommitTransactionReply; //导入方法依赖的package包/类
@SuppressWarnings("checkstyle:IllegalCatch")
protected void verifyCohortFutures(final AbstractThreePhaseCommitCohort<?> proxy,
        final Object... expReplies) {
    assertEquals("getReadyOperationFutures size", expReplies.length,
            proxy.getCohortFutures().size());

    List<Object> futureResults = new ArrayList<>();
    for (Future<?> future : proxy.getCohortFutures()) {
        assertNotNull("Ready operation Future is null", future);
        try {
            futureResults.add(Await.result(future, Duration.create(5, TimeUnit.SECONDS)));
        } catch (Exception e) {
            futureResults.add(e);
        }
    }

    for (Object expReply : expReplies) {
        boolean found = false;
        Iterator<?> iter = futureResults.iterator();
        while (iter.hasNext()) {
            Object actual = iter.next();
            if (CommitTransactionReply.isSerializedType(expReply)
                    && CommitTransactionReply.isSerializedType(actual)) {
                found = true;
            } else if (expReply instanceof ActorSelection && Objects.equals(expReply, actual)) {
                found = true;
            } else if (expReply instanceof Class && ((Class<?>) expReply).isInstance(actual)) {
                found = true;
            }

            if (found) {
                iter.remove();
                break;
            }
        }

        if (!found) {
            fail(String.format("No cohort Future response found for %s. Actual: %s", expReply, futureResults));
        }
    }
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:42,代码来源:AbstractTransactionProxyTest.java


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