Examples of CommandInvoker


Examples of cn.shenyanchao.ut.command.invoker.CommandInvoker

        CompilationUnitBuilder compilationUnitBuilder = null;
        String testJavaFileName = JavaParserUtils.findTestJavaFileName(sourceCU, javaFile, testDir);
        boolean testExist = FileChecker.isTestJavaClassExist(new File(testJavaFileName));
        if (!testExist) {
            CommandInvoker invoker = new CommandInvoker(new NewTestCommand(new NewTestReceiver(sourceCU, javaFile)));
            compilationUnitBuilder = invoker.action();
        } else if (testExist) {
            CompilationUnit testCU = JavaParserFactory.getCompilationUnit(new File(testJavaFileName), sourceEncode);
            CommandInvoker invoker = new CommandInvoker(new ExistTestCommand(new ExistTestReceiver(sourceCU, javaFile,
                    testCU)));
            compilationUnitBuilder = invoker.action();
        }

        if (null != compilationUnitBuilder){
            CompilationUnit testCU = compilationUnitBuilder.build();
            //写入测试代码文件
View Full Code Here

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

    }
  }

  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.CommandInvoker

    }
  }

  protected void initCommandInvoker() {
    if (commandInvoker==null) {
      commandInvoker = new CommandInvoker();
    }
  }
View Full Code Here

Examples of org.crsh.shell.impl.command.spi.CommandInvoker

  }


  public final void execute(String s) throws IOException, CommandException {
    InvocationContext<?> context = peekContext();
    CommandInvoker invoker = context.resolve(s);
    invoker.open(context);
    invoker.flush();
    invoker.close();
  }
View Full Code Here

Examples of org.crsh.shell.impl.command.spi.CommandInvoker

                        ReplResponse.Response shellResponse = (ReplResponse.Response)response;
                        Exception ex = new Exception("Was not expecting response " + shellResponse.response);
                        throw new CommandException(ErrorKind.EVALUATION, "Failure when evaluating '" + request + "'  in script " + name, ex);
                      } else if (response instanceof ReplResponse.Invoke) {
                        ReplResponse.Invoke invokeResponse = (ReplResponse.Invoke)response;
                        CommandInvoker invoker =  invokeResponse.invoker;
                        invoker.invoke(consumer);
                      }
                    }

                    //
                    try {
View Full Code Here

Examples of org.crsh.shell.impl.command.spi.CommandInvoker

    for (PipeLineFactory current = this;current != null;current = current.next) {
      Command<?> command = session.getCommand(current.name);
      if (command == null) {
        throw new CommandNotFoundException(current.name);
      }
      CommandInvoker commandInvoker = command.resolveInvoker(current.rest);
      if (commandInvoker == null) {
        throw new CommandNotFoundException(current.name);
      }
      pipes.add(commandInvoker);
    }
View Full Code Here

Examples of org.crsh.shell.impl.command.spi.CommandInvoker

  private CommandContext open(final int index, final CommandContext last) throws IOException, CommandException {
    if (index < invokers.length) {

      //
      final CommandInvoker invoker = invokers[index];
      CommandContext next = open(index + 1, last);

      //
      Class produced = invoker.getProducedType();
      Class<?> consumed = invoker.getConsumedType();
      CommandInvokerAdapter filterContext = new CommandInvokerAdapter(invoker, consumed, produced);
      try {
        filterContext.open(next);
      }
      catch (Exception e) {
View Full Code Here

Examples of org.crsh.shell.impl.command.spi.CommandInvoker

  }

  public final void execute(String s) throws Exception {
    InvocationContext<?> context = peekContext();
    try {
      CommandInvoker invoker = context.resolve(s);
      invoker.invoke(context);
    }
    catch (CommandException e) {
      Throwable cause = e.getCause();
      if (cause instanceof Exception) {
        throw (Exception)cause;
View Full Code Here

Examples of xbird.client.command.CommandInvoker

        String[] cmdArg = command.getArgs();
        String baseCol = command.getBaseCollection();

        DbCollection contextCol = DbCollection.getCollection(baseCol);
        Session session = new Session(contextCol);
        CommandInvoker invoker = new CommandInvoker(session);

        _runningThreads.put(rc, Thread.currentThread());
        try {
            boolean status = invoker.executeCommand(cmdArg);
            rc.setResult(status);
        } catch (CommandException ce) {
            LOG.error("command failed: " + Arrays.toString(cmdArg), ce);
            rc.setFault(ce);
        } finally {
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.