Examples of CommandConfig


Examples of org.activiti.engine.impl.interceptor.CommandConfig

    this.jobId = jobId;
    this.exception = exception;
  }
 
  public void execute(CommandContext commandContext) {
    CommandConfig commandConfig = commandExecutor.getDefaultConfig().transactionRequiresNew();
    FailedJobCommandFactory failedJobCommandFactory = commandContext.getFailedJobCommandFactory();
    Command<Object> cmd = failedJobCommandFactory.getCommand(jobId, exception);

    log.trace("Using FailedJobCommandFactory '" + failedJobCommandFactory.getClass() + "' and command of type '" + cmd.getClass() + "'");
    commandExecutor.execute(commandConfig, cmd);
View Full Code Here

Examples of org.activiti.engine.impl.interceptor.CommandConfig

  public void testRetryInterceptor() {
    RetryInterceptor retryInterceptor = new RetryInterceptor();
    retryInterceptor.setNext(new CommandInvoker());
    try {
      retryInterceptor.execute(new CommandConfig(), new CommandThrowingOptimisticLockingException());
      fail("ActivitiException expected.");
    } catch (ActivitiException e) {
      assertTrue(e.getMessage().contains(retryInterceptor.getNumOfRetries()+" retries failed"));
    }
  }
View Full Code Here

Examples of org.activiti.engine.impl.interceptor.CommandConfig

      log.error(outputMessage.toString());
     
      log.info("dropping and recreating db");
     
      CommandExecutor commandExecutor = ((ProcessEngineImpl)processEngine).getProcessEngineConfiguration().getCommandExecutor();
      CommandConfig config = new CommandConfig().transactionNotSupported();
      commandExecutor.execute(config, new Command<Object>() {
        public Object execute(CommandContext commandContext) {
          DbSqlSession session = commandContext.getSession(DbSqlSession.class);
          session.dbSchemaDrop();
          session.dbSchemaCreate();
View Full Code Here

Examples of org.activiti.engine.impl.interceptor.CommandConfig

  public Map<String, String> getProperties() {
    return commandExecutor.execute(new GetPropertiesCmd());
  }

  public String databaseSchemaUpgrade(final Connection connection, final String catalog, final String schema) {
    CommandConfig config = commandExecutor.getDefaultConfig().transactionNotSupported();
    return commandExecutor.execute(config, new Command<String>(){
      public String execute(CommandContext commandContext) {
        DbSqlSessionFactory dbSqlSessionFactory = (DbSqlSessionFactory) commandContext.getSessionFactories().get(DbSqlSession.class);
        DbSqlSession dbSqlSession = new DbSqlSession(dbSqlSessionFactory, connection, catalog, schema);
        commandContext.getSessions().put(DbSqlSession.class, dbSqlSession);
View Full Code Here

Examples of org.activiti.engine.impl.interceptor.CommandConfig

    initCommandExecutor();
  }

  protected void initDefaultCommandConfig() {
    if (defaultCommandConfig==null) {
      defaultCommandConfig = new CommandConfig();
    }
  }
View Full Code Here

Examples of org.activiti.engine.impl.interceptor.CommandConfig

    }
  }

  private void initSchemaCommandConfig() {
    if (schemaCommandConfig==null) {
      schemaCommandConfig = new CommandConfig().transactionNotSupported();
    }
  }
View Full Code Here

Examples of org.activiti.engine.impl.interceptor.CommandConfig

public class DbSchemaUpdate {

  public static void main(String[] args) {
    ProcessEngineImpl processEngine = (ProcessEngineImpl) ProcessEngines.getDefaultProcessEngine();
    CommandExecutor commandExecutor = processEngine.getProcessEngineConfiguration().getCommandExecutor();
    CommandConfig config = new CommandConfig().transactionNotSupported();
    commandExecutor.execute(config, new Command<Object>() {
      public Object execute(CommandContext commandContext) {
        commandContext
          .getSession(DbSqlSession.class)
          .dbSchemaUpdate();
View Full Code Here

Examples of org.activiti.engine.impl.interceptor.CommandConfig

public class DbSchemaDrop {

  public static void main(String[] args) {
    ProcessEngineImpl processEngine = (ProcessEngineImpl) ProcessEngines.getDefaultProcessEngine();
    CommandExecutor commandExecutor = processEngine.getProcessEngineConfiguration().getCommandExecutor();
    CommandConfig config = new CommandConfig().transactionNotSupported();
    commandExecutor.execute(config, new Command<Object>() {
      public Object execute(CommandContext commandContext) {
        commandContext
          .getSession(DbSqlSession.class)
          .dbSchemaDrop();
View Full Code Here

Examples of org.apache.beehive.netui.util.config.bean.CommandConfig

        CatalogFactory catalogFactory = getInstance();
        assert catalogFactory != null;
        Catalog catalog = new CatalogBase();
        List chainConfigs = catalogConfig.getCommands();
        for(int i = 0; i < chainConfigs.size(); i++) {
            CommandConfig commandConfig = (CommandConfig)chainConfigs.get(i);
            assert commandConfig != null;

            if(commandConfig instanceof ChainConfig) {
                ChainConfig chainConfig = (ChainConfig)commandConfig;
                Chain chain = new ChainBase();

                List commandConfigs = chainConfig.getCommands();
                for(int j = 0; j < commandConfigs.size(); j++) {
                    CommandConfig chainCommandConfig = (CommandConfig)commandConfigs.get(j);
                    Command command = createCommand(chainCommandConfig);
                    chain.addCommand(command);
                }
                catalog.addCommand(chainConfig.getName(), chain);
            }
View Full Code Here

Examples of org.apache.beehive.netui.util.config.bean.CommandConfig

                        NodeList commandList = element.getElementsByTagName("command");
                        if(commandList != null) {
                            for(int j = 0; j < commandList.getLength(); j++) {
                                Element commandElement = (Element)commandList.item(j);
                                CommandConfig commandConfig = parseCommand(commandElement);
                                chainConfig.addCommand(commandConfig);
                            }
                        }
                        catalogConfig.addCommand(chainConfig);
                    }
                    else if(node.getNodeName().equals("command")) {
                        Element element = (Element)node;
                        CommandConfig commandConfig = parseCommand(element);
                        catalogConfig.addCommand(commandConfig);
                    }
                }
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.