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


Java JobExecutor.shutdown方法代码示例

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


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

示例1: waitForJobExecutorToProcessAllJobs

import org.activiti.engine.impl.jobexecutor.JobExecutor; //导入方法依赖的package包/类
public static void waitForJobExecutorToProcessAllJobs(ProcessEngineConfigurationImpl processEngineConfiguration, long maxMillisToWait, long intervalMillis) {
  JobExecutor jobExecutor = processEngineConfiguration.getJobExecutor();
  jobExecutor.start();

  try {
    Timer timer = new Timer();
    InteruptTask task = new InteruptTask(Thread.currentThread());
    timer.schedule(task, maxMillisToWait);
    boolean areJobsAvailable = true;
    try {
      while (areJobsAvailable && !task.isTimeLimitExceeded()) {
        Thread.sleep(intervalMillis);
        areJobsAvailable = areJobsAvailable(processEngineConfiguration);
      }
    } catch (InterruptedException e) {
    } finally {
      timer.cancel();
    }
    if (areJobsAvailable) {
      throw new ActivitiException("time limit of " + maxMillisToWait + " was exceeded");
    }

  } finally {
    jobExecutor.shutdown();
  }
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:27,代码来源:TestHelper.java

示例2: waitForJobExecutorToProcessAllJobs

import org.activiti.engine.impl.jobexecutor.JobExecutor; //导入方法依赖的package包/类
public void waitForJobExecutorToProcessAllJobs(long maxMillisToWait, long intervalMillis) {
  JobExecutor jobExecutor = processEngineConfiguration.getJobExecutor();
  jobExecutor.start();

  try {
    Timer timer = new Timer();
    InteruptTask task = new InteruptTask(Thread.currentThread());
    timer.schedule(task, maxMillisToWait);
    boolean areJobsAvailable = true;
    try {
      while (areJobsAvailable && !task.isTimeLimitExceeded()) {
        Thread.sleep(intervalMillis);
        areJobsAvailable = areJobsAvailable();
      }
    } catch (InterruptedException e) {
    } finally {
      timer.cancel();
    }
    if (areJobsAvailable) {
      throw new ActivitiException("time limit of " + maxMillisToWait + " was exceeded");
    }

  } finally {
    jobExecutor.shutdown();
  }
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:27,代码来源:AbstractActivitiTestCase.java

示例3: moveByMinutes

import org.activiti.engine.impl.jobexecutor.JobExecutor; //导入方法依赖的package包/类
private void moveByMinutes(int minutes) throws Exception {
  ClockUtil.setCurrentTime(new Date(ClockUtil.getCurrentTime().getTime() + ((minutes * 60 * 1000) + 5000)));
  JobExecutor jobExecutor = processEngineConfiguration.getJobExecutor();
  jobExecutor.start();
  Thread.sleep(1000);

  jobExecutor.shutdown();
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:9,代码来源:StartTimerEventTest.java

示例4: moveByHours

import org.activiti.engine.impl.jobexecutor.JobExecutor; //导入方法依赖的package包/类
private void moveByHours(int hours) throws Exception {
  ClockUtil.setCurrentTime(new Date(ClockUtil.getCurrentTime().getTime() + ((hours * 60 * 1000 * 60) + 5000)));
  JobExecutor jobExecutor = processEngineConfiguration.getJobExecutor();
  jobExecutor.start();
  Thread.sleep(1000);
  jobExecutor.shutdown();
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:8,代码来源:BoundaryTimerNonInterruptingEventTest.java

示例5: waitForJobExecutorToProcessAllJobs

import org.activiti.engine.impl.jobexecutor.JobExecutor; //导入方法依赖的package包/类
public void waitForJobExecutorToProcessAllJobs(long maxMillisToWait, long intervalMillis) {
  JobExecutor jobExecutor = processEngineConfiguration.getJobExecutor();
  jobExecutor.start();

  try {
    Timer timer = new Timer();
    InteruptTask task = new InteruptTask(Thread.currentThread());
    timer.schedule(task, maxMillisToWait);
    boolean areJobsAvailable = true;
    try {
      while (areJobsAvailable && !task.isTimeLimitExceeded()) {
        Thread.sleep(intervalMillis);
        try {
          areJobsAvailable = areJobsAvailable();
        } catch(Throwable t) {
          // Ignore, possible that exception occurs due to locking/updating of table on MSSQL when
          // isolation level doesn't allow READ of the table
        }
      }
    } catch (InterruptedException e) {
      // ignore
    } finally {
      timer.cancel();
    }
    if (areJobsAvailable) {
      throw new ActivitiException("time limit of " + maxMillisToWait + " was exceeded");
    }

  } finally {
    jobExecutor.shutdown();
  }
}
 
开发者ID:springvelocity,项目名称:xbpm5,代码行数:33,代码来源:AbstractActivitiTestCase.java


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