com.evolveum.midpoint.task.api.Task.isAsynchronous()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(1.3k)|赞(0)|评价(0)|浏览(92)

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

Task.isAsynchronous介绍

[英]Returns true if the task is asynchronous. The asynchronous task is not executing in foreground. Therefore any thread that is not explicitly allocated for the task can be discarded. E.g. if a GUI thread detects that the task is asynchronous it knows that there is no point in waiting for the task result. It can just display appropriate message to the user (e.g. "please come back later") and return control back to the web container. Usually, asynchronous means the same as persistent. However, there can are lightweight tasks that are asynchronous but not stored in repository.
[中]如果任务是异步的,则返回true。异步任务未在前台执行。因此,任何没有明确分配给任务的线程都可以被丢弃。例如,如果GUI线程检测到任务是异步的,它就知道等待任务结果没有意义。它可以向用户显示适当的消息(例如“请稍后再来”),并将控制权返回到web容器。通常,异步与持久的意思相同。然而,也可能有一些轻量级任务是异步的,但不存储在存储库中。

代码示例

代码示例来源:origin: Evolveum/midpoint

if (!task.isAsynchronous()) {
  result.recordSuccess();

代码示例来源:origin: Evolveum/midpoint

AssertJUnit.assertNotNull(task);
assertNotNull(task.getOid());
AssertJUnit.assertTrue(task.isAsynchronous());
AssertJUnit.assertEquals(TaskExecutionStatus.RUNNABLE, task.getExecutionStatus());

相关文章

微信公众号

最新文章

更多