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


Java MessageAddedNotification类代码示例

本文整理汇总了Java中org.activiti.engine.impl.jobexecutor.MessageAddedNotification的典型用法代码示例。如果您正苦于以下问题:Java MessageAddedNotification类的具体用法?Java MessageAddedNotification怎么用?Java MessageAddedNotification使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


MessageAddedNotification类属于org.activiti.engine.impl.jobexecutor包,在下文中一共展示了MessageAddedNotification类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: schedule

import org.activiti.engine.impl.jobexecutor.MessageAddedNotification; //导入依赖的package包/类
public void schedule(TimerEntity timer) {
  Date duedate = timer.getDuedate();
  if (duedate==null) {
    throw new ActivitiException("duedate is null");
  }
  
  CommandContext commandContext = Context.getCommandContext();
  
  commandContext
    .getDbSqlSession()
    .insert(timer);
  
  // Check if this timer fires before the next time the job executor will check for new timers to fire.
  // This is highly unlikely because normally waitTimeInMillis is 5000 (5 seconds)
  // and timers are usually set further in the future
  
  JobExecutor jobExecutor = Context.getProcessEngineConfiguration().getJobExecutor();
  int waitTimeInMillis = jobExecutor.getWaitTimeInMillis();
  if (duedate.getTime() < (ClockUtil.getCurrentTime().getTime()+waitTimeInMillis)) {
    // then notify the job executor.
    commandContext
      .getTransactionContext()
      .addTransactionListener(TransactionState.COMMITTED, new MessageAddedNotification(jobExecutor));
  }
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:26,代码来源:JobManager.java

示例2: execute

import org.activiti.engine.impl.jobexecutor.MessageAddedNotification; //导入依赖的package包/类
public Object execute(CommandContext commandContext) {
  JobEntity job = Context
    .getCommandContext()
    .getJobManager()
    .findJobById(jobId);
  job.setRetries(job.getRetries() - 1);
  job.setLockOwner(null);
  job.setLockExpirationTime(null);
  
  if(exception != null) {
    job.setExceptionMessage(exception.getMessage());
    job.setExceptionStacktrace(getExceptionStacktrace());
  }
  
  JobExecutor jobExecutor = Context.getProcessEngineConfiguration().getJobExecutor();
  MessageAddedNotification messageAddedNotification = new MessageAddedNotification(jobExecutor);
  TransactionContext transactionContext = commandContext.getTransactionContext();
  transactionContext.addTransactionListener(TransactionState.COMMITTED, messageAddedNotification);
  
  return null;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:22,代码来源:DecrementJobRetriesCmd.java

示例3: execute

import org.activiti.engine.impl.jobexecutor.MessageAddedNotification; //导入依赖的package包/类
public Object execute(CommandContext commandContext) {
  JobEntity job = Context
    .getCommandContext()
    .getJobEntityManager()
    .findJobById(jobId);
  job.setRetries(job.getRetries() - 1);
  job.setLockOwner(null);
  job.setLockExpirationTime(null);
  
  if(exception != null) {
    job.setExceptionMessage(exception.getMessage());
    job.setExceptionStacktrace(getExceptionStacktrace());
  }
  
  JobExecutor jobExecutor = Context.getProcessEngineConfiguration().getJobExecutor();
  MessageAddedNotification messageAddedNotification = new MessageAddedNotification(jobExecutor);
  TransactionContext transactionContext = commandContext.getTransactionContext();
  transactionContext.addTransactionListener(TransactionState.COMMITTED, messageAddedNotification);
  
  return null;
}
 
开发者ID:springvelocity,项目名称:xbpm5,代码行数:22,代码来源:DecrementJobRetriesCmd.java

示例4: send

import org.activiti.engine.impl.jobexecutor.MessageAddedNotification; //导入依赖的package包/类
public void send(MessageEntity message) {
  CommandContext commandContext = Context.getCommandContext();
  
  commandContext
    .getDbSqlSession()
    .insert(message);
  
  
  JobExecutor jobExecutor = Context.getProcessEngineConfiguration().getJobExecutor();
  commandContext
    .getTransactionContext()
    .addTransactionListener(TransactionState.COMMITTED, new MessageAddedNotification(jobExecutor));
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:14,代码来源:JobManager.java


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