本文整理汇总了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);
}
示例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;
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
}
示例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);
}
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
}
示例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;
}
示例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;
}
示例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);
}
}