本文整理汇总了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;
}
示例2: isSerializedReplyType
import org.opendaylight.controller.cluster.datastore.messages.CommitTransactionReply; //导入方法依赖的package包/类
@Override
public boolean isSerializedReplyType(final Object reply) {
return CommitTransactionReply.isSerializedType(reply);
}
示例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));
}
}
}