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


Java CommandInterceptor类代码示例

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


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

示例1: createTransactionInterceptor

import org.activiti.engine.impl.interceptor.CommandInterceptor; //导入依赖的package包/类
@Override
protected CommandInterceptor createTransactionInterceptor() {
    if (transactionManager == null) {
        throw new ActivitiException("transactionManager is required property for SpringProcessEngineConfiguration, use " + StandaloneProcessEngineConfiguration.class.getName() + " otherwise");
    }

    return new SpringTransactionInterceptor(transactionManager);
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:9,代码来源:SpringProcessEngineConfiguration.java

示例2: getDefaultCommandInterceptors

import org.activiti.engine.impl.interceptor.CommandInterceptor; //导入依赖的package包/类
protected Collection<? extends CommandInterceptor> getDefaultCommandInterceptors() {
    List<CommandInterceptor> interceptors = new ArrayList<>();
    interceptors.add(new LogInterceptor());

    CommandInterceptor transactionInterceptor = createTransactionInterceptor();
    if (transactionInterceptor != null) {
        interceptors.add(transactionInterceptor);
    }

    interceptors.add(new CommandContextInterceptor(commandContextFactory, this));
    return interceptors;
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:13,代码来源:ProcessEngineConfigurationImpl.java

示例3: initInterceptorChain

import org.activiti.engine.impl.interceptor.CommandInterceptor; //导入依赖的package包/类
protected CommandInterceptor initInterceptorChain(List<CommandInterceptor> chain) {
    if (chain == null || chain.isEmpty()) {
        throw new ActivitiException("invalid command interceptor chain configuration: " + chain);
    }
    for (int i = 0; i < chain.size() - 1; i++) {
        chain.get(i).setNext(chain.get(i + 1));
    }
    return chain.get(0);
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:10,代码来源:ProcessEngineConfigurationImpl.java

示例4: createTransactionInterceptor

import org.activiti.engine.impl.interceptor.CommandInterceptor; //导入依赖的package包/类
@Override
protected CommandInterceptor createTransactionInterceptor() {
    if (transactionManager == null) {
        throw new ActivitiException("transactionManager is required property for JtaProcessEngineConfiguration, use " + StandaloneProcessEngineConfiguration.class.getName() + " otherwise");
    }

    return new JtaTransactionInterceptor(transactionManager);
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:9,代码来源:JtaProcessEngineConfiguration.java

示例5: getDefaultCommandInterceptorsTxRequired

import org.activiti.engine.impl.interceptor.CommandInterceptor; //导入依赖的package包/类
protected Collection< ? extends CommandInterceptor> getDefaultCommandInterceptorsTxRequired() {
  if (transactionManager==null) {
    throw new ActivitiException("transactionManager is required property for SpringProcessEngineConfiguration, use "+StandaloneProcessEngineConfiguration.class.getName()+" otherwise");
  }
  
  List<CommandInterceptor> defaultCommandInterceptorsTxRequired = new ArrayList<CommandInterceptor>();
  defaultCommandInterceptorsTxRequired.add(new LogInterceptor());
  defaultCommandInterceptorsTxRequired.add(new SpringTransactionInterceptor(transactionManager, TransactionTemplate.PROPAGATION_REQUIRED));
  CommandContextInterceptor commandContextInterceptor = new CommandContextInterceptor(commandContextFactory, this);
  defaultCommandInterceptorsTxRequired.add(commandContextInterceptor);
  return defaultCommandInterceptorsTxRequired;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:13,代码来源:SpringProcessEngineConfiguration.java

示例6: getDefaultCommandInterceptorsTxRequiresNew

import org.activiti.engine.impl.interceptor.CommandInterceptor; //导入依赖的package包/类
protected Collection< ? extends CommandInterceptor> getDefaultCommandInterceptorsTxRequiresNew() {
  List<CommandInterceptor> defaultCommandInterceptorsTxRequiresNew = new ArrayList<CommandInterceptor>();
  defaultCommandInterceptorsTxRequiresNew.add(new LogInterceptor());
  defaultCommandInterceptorsTxRequiresNew.add(new SpringTransactionInterceptor(transactionManager, TransactionTemplate.PROPAGATION_REQUIRES_NEW));
  CommandContextInterceptor commandContextInterceptor = new CommandContextInterceptor(commandContextFactory, this);
  defaultCommandInterceptorsTxRequiresNew.add(commandContextInterceptor);
  return defaultCommandInterceptorsTxRequiresNew;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:9,代码来源:SpringProcessEngineConfiguration.java

示例7: initCommandInterceptorsTxRequired

import org.activiti.engine.impl.interceptor.CommandInterceptor; //导入依赖的package包/类
protected void initCommandInterceptorsTxRequired() {
  if (commandInterceptorsTxRequired==null) {
    if (customPreCommandInterceptorsTxRequired!=null) {
      commandInterceptorsTxRequired = new ArrayList<CommandInterceptor>(customPreCommandInterceptorsTxRequired);
    } else {
      commandInterceptorsTxRequired = new ArrayList<CommandInterceptor>();
    }
    commandInterceptorsTxRequired.addAll(getDefaultCommandInterceptorsTxRequired());
    if (customPostCommandInterceptorsTxRequired!=null) {
      commandInterceptorsTxRequired.addAll(customPostCommandInterceptorsTxRequired);
    }
    commandInterceptorsTxRequired.add(actualCommandExecutor);
  }
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:15,代码来源:ProcessEngineConfigurationImpl.java

示例8: initCommandInterceptorsTxRequiresNew

import org.activiti.engine.impl.interceptor.CommandInterceptor; //导入依赖的package包/类
protected void initCommandInterceptorsTxRequiresNew() {
  if (commandInterceptorsTxRequiresNew==null) {
    if (customPreCommandInterceptorsTxRequiresNew!=null) {
      commandInterceptorsTxRequiresNew = new ArrayList<CommandInterceptor>(customPreCommandInterceptorsTxRequiresNew);
    } else {
      commandInterceptorsTxRequiresNew = new ArrayList<CommandInterceptor>();
    }
    commandInterceptorsTxRequiresNew.addAll(getDefaultCommandInterceptorsTxRequiresNew());
    if (customPostCommandInterceptorsTxRequiresNew!=null) {
      commandInterceptorsTxRequiresNew.addAll(customPostCommandInterceptorsTxRequiresNew);
    }
    commandInterceptorsTxRequiresNew.add(actualCommandExecutor);
  }
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:15,代码来源:ProcessEngineConfigurationImpl.java

示例9: initInterceptorChain

import org.activiti.engine.impl.interceptor.CommandInterceptor; //导入依赖的package包/类
protected CommandInterceptor initInterceptorChain(List<CommandInterceptor> chain) {
  if (chain==null || chain.isEmpty()) {
    throw new ActivitiException("invalid command interceptor chain configuration: "+chain);
  }
  for (int i = 0; i < chain.size()-1; i++) {
    chain.get(i).setNext( chain.get(i+1) );
  }
  return chain.get(0);
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:10,代码来源:ProcessEngineConfigurationImpl.java

示例10: getDefaultCommandInterceptorsTxRequired

import org.activiti.engine.impl.interceptor.CommandInterceptor; //导入依赖的package包/类
@Override
protected Collection< ? extends CommandInterceptor> getDefaultCommandInterceptorsTxRequired() {
  List<CommandInterceptor> defaultCommandInterceptorsTxRequired = new ArrayList<CommandInterceptor>();
  defaultCommandInterceptorsTxRequired.add(new LogInterceptor());
  defaultCommandInterceptorsTxRequired.add(new JtaTransactionInterceptor(transactionManager, false));
  defaultCommandInterceptorsTxRequired.add(new CommandContextInterceptor(commandContextFactory, this));
  return defaultCommandInterceptorsTxRequired;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:9,代码来源:JtaProcessEngineConfiguration.java

示例11: getDefaultCommandInterceptorsTxRequiresNew

import org.activiti.engine.impl.interceptor.CommandInterceptor; //导入依赖的package包/类
@Override
protected Collection< ? extends CommandInterceptor> getDefaultCommandInterceptorsTxRequiresNew() {
  List<CommandInterceptor> defaultCommandInterceptorsTxRequiresNew = new ArrayList<CommandInterceptor>();
  defaultCommandInterceptorsTxRequiresNew.add(new LogInterceptor());
  defaultCommandInterceptorsTxRequiresNew.add(new JtaTransactionInterceptor(transactionManager, true));
  defaultCommandInterceptorsTxRequiresNew.add(new CommandContextInterceptor(commandContextFactory, this));
  return defaultCommandInterceptorsTxRequiresNew;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:9,代码来源:JtaProcessEngineConfiguration.java

示例12: testCompetingSignalsWithRetry

import org.activiti.engine.impl.interceptor.CommandInterceptor; //导入依赖的package包/类
@Deployment(resources={"org/activiti/engine/test/concurrency/CompetingSignalsTest.testCompetingSignals.bpmn20.xml"})
public void testCompetingSignalsWithRetry() throws Exception {
  RuntimeServiceImpl runtimeServiceImpl = (RuntimeServiceImpl)runtimeService;        
  CommandExecutor before = runtimeServiceImpl.getCommandExecutor();
  try {
    CommandInterceptor retryInterceptor = new RetryInterceptor();
    retryInterceptor.setNext(before);
    runtimeServiceImpl.setCommandExecutor(retryInterceptor);
    
    ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("CompetingSignalsProcess");
    String processInstanceId = processInstance.getId();

    log.fine("test thread starts thread one");
    SignalThread threadOne = new SignalThread(processInstanceId);
    threadOne.startAndWaitUntilControlIsReturned();
    
    log.fine("test thread continues to start thread two");
    SignalThread threadTwo = new SignalThread(processInstanceId);
    threadTwo.startAndWaitUntilControlIsReturned();

    log.fine("test thread notifies thread 1");
    threadOne.proceedAndWaitTillDone();
    assertNull(threadOne.exception);

    log.fine("test thread notifies thread 2");
    threadTwo.proceedAndWaitTillDone();
    assertNull(threadTwo.exception);
  } finally {
    // reset the command executor
    runtimeServiceImpl.setCommandExecutor(before);
  }
  
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:34,代码来源:CompetingSignalsTest.java

示例13: getDefaultCommandInterceptorsTxRequired

import org.activiti.engine.impl.interceptor.CommandInterceptor; //导入依赖的package包/类
protected Collection< ? extends CommandInterceptor> getDefaultCommandInterceptorsTxRequired() {
  if (transactionManager==null) {
    throw new ActivitiException("transactionManager is required property for SpringProcessEngineConfiguration, use "+StandaloneProcessEngineConfiguration.class.getName()+" otherwise");
  }
  
  List<CommandInterceptor> defaultCommandInterceptorsTxRequired = new ArrayList<CommandInterceptor>();
  defaultCommandInterceptorsTxRequired.add(new LogInterceptor());
  defaultCommandInterceptorsTxRequired.add(new SpringTransactionInterceptor(transactionManager, TransactionTemplate.PROPAGATION_REQUIRED));
  CommandContextInterceptor commandContextInterceptor = new CommandContextInterceptor(commandContextFactory, this);
  commandContextInterceptor.setContextReusePossible(true);
  defaultCommandInterceptorsTxRequired.add(commandContextInterceptor);
  return defaultCommandInterceptorsTxRequired;
}
 
开发者ID:joshlong,项目名称:javaconfig-ftw,代码行数:14,代码来源:SpringProcessEngineConfiguration.java

示例14: getDefaultCommandInterceptorsTxRequiresNew

import org.activiti.engine.impl.interceptor.CommandInterceptor; //导入依赖的package包/类
protected Collection< ? extends CommandInterceptor> getDefaultCommandInterceptorsTxRequiresNew() {
  List<CommandInterceptor> defaultCommandInterceptorsTxRequiresNew = new ArrayList<CommandInterceptor>();
  defaultCommandInterceptorsTxRequiresNew.add(new LogInterceptor());
  defaultCommandInterceptorsTxRequiresNew.add(new SpringTransactionInterceptor(transactionManager, TransactionTemplate.PROPAGATION_REQUIRES_NEW));
  CommandContextInterceptor commandContextInterceptor = new CommandContextInterceptor(commandContextFactory, this);
  commandContextInterceptor.setContextReusePossible(false);
  defaultCommandInterceptorsTxRequiresNew.add(commandContextInterceptor);
  return defaultCommandInterceptorsTxRequiresNew;
}
 
开发者ID:joshlong,项目名称:javaconfig-ftw,代码行数:10,代码来源:SpringProcessEngineConfiguration.java

示例15: initCommandInterceptors

import org.activiti.engine.impl.interceptor.CommandInterceptor; //导入依赖的package包/类
protected void initCommandInterceptors() {
  if (commandInterceptors==null) {
    commandInterceptors = new ArrayList<CommandInterceptor>();
    if (customPreCommandInterceptors!=null) {
      commandInterceptors.addAll(customPreCommandInterceptors);
    }
    commandInterceptors.addAll(getDefaultCommandInterceptors());
    if (customPostCommandInterceptors!=null) {
      commandInterceptors.addAll(customPostCommandInterceptors);
    }
    commandInterceptors.add(commandInvoker);
  }
}
 
开发者ID:springvelocity,项目名称:xbpm5,代码行数:14,代码来源:ProcessEngineConfigurationImpl.java


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