com.google.common.util.concurrent.AbstractFuture.interruptTask()方法的使用及代码示例

x33g5p2x  于11个月前 转载在 其他  
字(5.5k)|赞(0)|评价(0)|浏览(27)

本文整理了Java中com.google.common.util.concurrent.AbstractFuture.interruptTask()方法的一些代码示例,展示了AbstractFuture.interruptTask()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AbstractFuture.interruptTask()方法的具体详情如下:
包路径:com.google.common.util.concurrent.AbstractFuture
类名称:AbstractFuture
方法名:interruptTask

AbstractFuture.interruptTask介绍

[英]Subclasses can override this method to implement interruption of the future's computation. The method is invoked automatically by a successful call to #cancel(boolean).

The default implementation does nothing.

This method is likely to be deprecated. Prefer to override #afterDone, checking #wasInterrupted to decide whether to interrupt your task.
[中]子类可以重写此方法以实现未来计算的中断。该方法通过成功调用#cancel(布尔值)自动调用。
默认实现不执行任何操作。
此方法可能会被弃用。更愿意覆盖“完成后”,检查“已中断”,以决定是否中断任务。

代码示例

代码示例来源:origin: google/guava

abstractFuture.interruptTask();

代码示例来源:origin: google/j2objc

abstractFuture.interruptTask();

代码示例来源:origin: wildfly/wildfly

abstractFuture.interruptTask();

代码示例来源:origin: Nextdoor/bender

@Override
public boolean cancel(boolean mayInterruptIfRunning) {
 if (!sync.cancel(mayInterruptIfRunning)) {
  return false;
 }
 executionList.execute();
 if (mayInterruptIfRunning) {
  interruptTask();
 }
 return true;
}

代码示例来源:origin: com.google.guava/guava-jdk5

@Override
public boolean cancel(boolean mayInterruptIfRunning) {
 if (!sync.cancel(mayInterruptIfRunning)) {
  return false;
 }
 executionList.execute();
 if (mayInterruptIfRunning) {
  interruptTask();
 }
 return true;
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/com.google.guava

@Override
public boolean cancel(boolean mayInterruptIfRunning) {
 if (!sync.cancel(mayInterruptIfRunning)) {
  return false;
 }
 executionList.execute();
 if (mayInterruptIfRunning) {
  interruptTask();
 }
 return true;
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

@Override
public boolean cancel(boolean mayInterruptIfRunning) {
 if (!sync.cancel(mayInterruptIfRunning)) {
  return false;
 }
 executionList.execute();
 if (mayInterruptIfRunning) {
  interruptTask();
 }
 return true;
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

@Override
public boolean cancel(boolean mayInterruptIfRunning) {
 if (!sync.cancel(mayInterruptIfRunning)) {
  return false;
 }
 executionList.execute();
 if (mayInterruptIfRunning) {
  interruptTask();
 }
 return true;
}

代码示例来源:origin: org.sonatype.sisu/sisu-guava

@Override
public boolean cancel(boolean mayInterruptIfRunning) {
 if (!sync.cancel()) {
  return false;
 }
 executionList.execute();
 if (mayInterruptIfRunning) {
  interruptTask();
 }
 return true;
}

代码示例来源:origin: org.hudsonci.lib.guava/guava

@Override
public boolean cancel(boolean mayInterruptIfRunning) {
 if (!sync.cancel(mayInterruptIfRunning)) {
  return false;
 }
 executionList.execute();
 if (mayInterruptIfRunning) {
  interruptTask();
 }
 return true;
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-analytics

@Override
public boolean cancel(boolean mayInterruptIfRunning) {
 if (!sync.cancel(mayInterruptIfRunning)) {
  return false;
 }
 executionList.execute();
 if (mayInterruptIfRunning) {
  interruptTask();
 }
 return true;
}

代码示例来源:origin: io.cloudsoft.jclouds/jclouds-compute

@Override
protected void interruptTask() {
 logger.debug("<< cancelled(%s)", commandRunner.getStatement().getInstanceName());
 ExecResponse returnVal = commandRunner.refreshAndRunAction("stop");
 CancellationException e = new CancellationException(String.format(
      "cancelled %s on node: %s; stop command had exit status: %s", getCommandRunner().getStatement()
          .getInstanceName(), getCommandRunner().getNode().getId(), returnVal));
 eventBus.post(new StatementOnNodeFailure(getCommandRunner().getStatement(), getCommandRunner().getNode(), e));
 super.interruptTask();
}

代码示例来源:origin: org.apache.jclouds/jclouds-compute

@Override
protected void interruptTask() {
 logger.debug("<< cancelled(%s)", commandRunner.getStatement().getInstanceName());
 ExecResponse returnVal = commandRunner.refreshAndRunAction("stop");
 CancellationException e = new CancellationException(String.format(
      "cancelled %s on node: %s; stop command had exit status: %s", getCommandRunner().getStatement()
          .getInstanceName(), getCommandRunner().getNode().getId(), returnVal));
 eventBus.post(new StatementOnNodeFailure(getCommandRunner().getStatement(), getCommandRunner().getNode(), e));
 super.interruptTask();
}

代码示例来源:origin: jclouds/legacy-jclouds

@Override
protected void interruptTask() {
 logger.debug("<< cancelled(%s)", commandRunner.getStatement().getInstanceName());
 ExecResponse returnVal = commandRunner.refreshAndRunAction("stop");
 CancellationException e = new CancellationException(String.format(
      "cancelled %s on node: %s; stop command had exit status: %s", getCommandRunner().getStatement()
          .getInstanceName(), getCommandRunner().getNode().getId(), returnVal));
 eventBus.post(new StatementOnNodeFailure(getCommandRunner().getStatement(), getCommandRunner().getNode(), e));
 super.interruptTask();
}

代码示例来源:origin: org.jboss.eap/wildfly-client-all

abstractFuture.interruptTask();

代码示例来源:origin: org.kill-bill.billing/killbill-platform-osgi-bundles-logger

abstractFuture.interruptTask();

代码示例来源:origin: apache/jclouds

@Override
protected void interruptTask() {
 logger.debug("<< cancelled(%s)", commandRunner.getStatement().getInstanceName());
 ExecResponse returnVal = commandRunner.refreshAndRunAction("stop");
 CancellationException e = new CancellationException(String.format(
      "cancelled %s on node: %s; stop command had exit status: %s", getCommandRunner().getStatement()
          .getInstanceName(), getCommandRunner().getNode().getId(), returnVal));
 eventBus.post(new StatementOnNodeFailure(getCommandRunner().getStatement(), getCommandRunner().getNode(), e));
 super.interruptTask();
}

代码示例来源:origin: com.diffplug.guava/guava-concurrent

interruptTask();

相关文章