本文整理汇总了Java中akka.actor.Cancellable.isCancelled方法的典型用法代码示例。如果您正苦于以下问题:Java Cancellable.isCancelled方法的具体用法?Java Cancellable.isCancelled怎么用?Java Cancellable.isCancelled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类akka.actor.Cancellable
的用法示例。
在下文中一共展示了Cancellable.isCancelled方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onSelectOwner
import akka.actor.Cancellable; //导入方法依赖的package包/类
private void onSelectOwner(final SelectOwner selectOwner) {
LOG.debug("{}: onSelectOwner: {}", persistenceId(), selectOwner);
String currentOwner = getCurrentOwner(selectOwner.getEntityPath());
if (Strings.isNullOrEmpty(currentOwner)) {
writeNewOwner(selectOwner.getEntityPath(), newOwner(currentOwner, selectOwner.getAllCandidates(),
selectOwner.getOwnerSelectionStrategy()));
Cancellable cancellable = entityToScheduledOwnershipTask.get(selectOwner.getEntityPath());
if (cancellable != null) {
if (!cancellable.isCancelled()) {
cancellable.cancel();
}
entityToScheduledOwnershipTask.remove(selectOwner.getEntityPath());
}
}
}
示例2: cancelOwnerSelectionTask
import akka.actor.Cancellable; //导入方法依赖的package包/类
private void cancelOwnerSelectionTask(final YangInstanceIdentifier entityPath) {
final Cancellable lastScheduledTask = entityToScheduledOwnershipTask.get(entityPath);
if (lastScheduledTask != null && !lastScheduledTask.isCancelled()) {
lastScheduledTask.cancel();
}
}