protected void closeSessions(CommandInvocationContext commandInvocationContext) { for (Session session : sessionList) { try { session.close(); } catch (Throwable exception) { commandInvocationContext.trySetThrowable(exception); } } }
protected void fireCommandFailed(Throwable t) { for (CommandContextListener listener : commandContextListeners) { try { listener.onCommandFailed(this, t); } catch(Throwable ex) { LOG.exceptionWhileInvokingOnCommandFailed(t); } } }
public void execute(CommandContext commandContext) { // passed commandContext may be in an inconsistent state commandExecutor.execute(new Command<Void>() { @Override public Void execute(CommandContext commandContext) { Map<String, Long> report = reportMetrics(); boolean isRescheduleNow = shouldRescheduleNow(); new HistoryCleanupSchedulerCmd(isRescheduleNow, report, configuration, jobId).execute(commandContext); return null; } }); }
@Override protected Collection< ? extends CommandInterceptor> getDefaultCommandInterceptorsTxRequired() { List<CommandInterceptor> defaultCommandInterceptorsTxRequired = new ArrayList<CommandInterceptor>(); defaultCommandInterceptorsTxRequired.add(new LogInterceptor()); defaultCommandInterceptorsTxRequired.add(new ProcessApplicationContextInterceptor(this)); defaultCommandInterceptorsTxRequired.add(new JtaTransactionInterceptor(transactionManager, false)); defaultCommandInterceptorsTxRequired.add(new CommandContextInterceptor(commandContextFactory, this)); return defaultCommandInterceptorsTxRequired; }
protected void initCommandContextFactory() { if (commandContextFactory == null) { commandContextFactory = new CommandContextFactory(); commandContextFactory.setProcessEngineConfiguration(this); } }
public void bpmnStackTrace(String string) { logError( "006", string); }
public void debugExecutingAtomicOperation(CoreAtomicOperation<?> executionOperation, CoreExecution execution) { logDebug( "001", "Executing atomic operation {} on {}", executionOperation, execution); }
protected void fireCommandContextClose() { for (CommandContextListener listener : commandContextListeners) { listener.onCommandContextClose(this); } }
public long sum() { callback = new Command() { @Override public Object execute(CommandContext commandContext) { return commandContext.getMeterLogManager() .executeSelectSum(MetricsQueryImpl.this); } }; return (Long) commandExecutor.execute(this); }
@Override protected Collection< ? extends CommandInterceptor> getDefaultCommandInterceptorsTxRequiresNew() { List<CommandInterceptor> defaultCommandInterceptorsTxRequiresNew = new ArrayList<CommandInterceptor>(); defaultCommandInterceptorsTxRequiresNew.add(new LogInterceptor()); defaultCommandInterceptorsTxRequiresNew.add(new ProcessApplicationContextInterceptor(this)); defaultCommandInterceptorsTxRequiresNew.add(new JtaTransactionInterceptor(transactionManager, true)); defaultCommandInterceptorsTxRequiresNew.add(new CommandContextInterceptor(commandContextFactory, this, true)); return defaultCommandInterceptorsTxRequiresNew; }
protected void closeSessions(CommandInvocationContext commandInvocationContext) { for (Session session : sessionList) { try { session.close(); } catch (Throwable exception) { commandInvocationContext.trySetThrowable(exception); } } }
protected void fireCommandFailed(Throwable t) { for (CommandContextListener listener : commandContextListeners) { try { listener.onCommandFailed(this, t); } catch(Throwable ex) { LOG.exceptionWhileInvokingOnCommandFailed(t); } } }
public List<TaskCountByCandidateGroupResult> taskCountByCandidateGroup() { return commandExecutor.execute(new Command<List<TaskCountByCandidateGroupResult>>() { @Override public List<TaskCountByCandidateGroupResult> execute(CommandContext commandContext) { return createTaskCountByCandidateGroupReport(commandContext); } }); }
@Override protected Collection< ? extends CommandInterceptor> getDefaultCommandInterceptorsTxRequired() { List<CommandInterceptor> defaultCommandInterceptorsTxRequired = new ArrayList<CommandInterceptor>(); defaultCommandInterceptorsTxRequired.add(new LogInterceptor()); defaultCommandInterceptorsTxRequired.add(new ProcessApplicationContextInterceptor(this)); defaultCommandInterceptorsTxRequired.add(new JtaTransactionInterceptor(transactionManager, false)); defaultCommandInterceptorsTxRequired.add(new CommandContextInterceptor(commandContextFactory, this)); return defaultCommandInterceptorsTxRequired; }
public Set<String> getRegisteredDeployments() { return commandExecutor.execute(new Command<Set<String>>() { public Set<String> execute(CommandContext commandContext) { commandContext.getAuthorizationManager().checkCamundaAdmin(); Set<String> registeredDeployments = Context.getProcessEngineConfiguration().getRegisteredDeployments(); return new HashSet<String>(registeredDeployments); } }); }
@Override protected Collection< ? extends CommandInterceptor> getDefaultCommandInterceptorsTxRequiresNew() { List<CommandInterceptor> defaultCommandInterceptorsTxRequiresNew = new ArrayList<CommandInterceptor>(); defaultCommandInterceptorsTxRequiresNew.add(new LogInterceptor()); defaultCommandInterceptorsTxRequiresNew.add(new ProcessApplicationContextInterceptor(this)); defaultCommandInterceptorsTxRequiresNew.add(new JtaTransactionInterceptor(transactionManager, true)); defaultCommandInterceptorsTxRequiresNew.add(new CommandContextInterceptor(commandContextFactory, this, true)); return defaultCommandInterceptorsTxRequiresNew; }
public String databaseSchemaUpgrade(final Connection connection, final String catalog, final String schema) { return commandExecutor.execute(new Command<String>() { public String execute(CommandContext commandContext) { commandContext.getAuthorizationManager().checkCamundaAdmin(); DbSqlSessionFactory dbSqlSessionFactory = (DbSqlSessionFactory) commandContext.getSessionFactories().get(DbSqlSession.class); DbSqlSession dbSqlSession = new DbSqlSession(dbSqlSessionFactory, connection, catalog, schema); commandContext.getSessions().put(DbSqlSession.class, dbSqlSession); dbSqlSession.dbSchemaUpdate(); return ""; } }); }
@Override public T call() throws Exception { return next.execute(command); } },