Examples of CommandFactory


Examples of com.cisco.telnet.server.domain.command.CommandFactory

  public TelnetTaskProcessor(Socket connection) {
    this.connection = connection;
    this.socketReader = new SocketReader(connection);
    this.socketWriter = new SocketWriter(connection);
    this.commandFactory = new CommandFactory();
    this.connectionIdleTimeoutInMs = DEFAULT_CONNECTION_IDLE_TIMEOUT;
  }
View Full Code Here

Examples of com.codahale.shore.CommandFactory

      return "shoretest";
    }
  };
 
  private static Runnable parse(String... args) {
    return new CommandFactory(config).getCommand(args);
  }
View Full Code Here

Examples of com.griddynamics.gridkit.coherence.patterns.command.benchmark.commands.CommandFactory

  {
    try
    {
      final Random rnd = new Random(System.currentTimeMillis());
     
      final CommandFactory commandFactory = CommandBenchmarkDispatcher.getCommandFactory(benchmarkParams.getCommand());
     
      final SpeedLimit speedLimit = SpeedLimit.SpeedLimitHelper.getSpeedLimit(benchmarkParams.getOpsPerSec());
     
      final PatternFacade facade = PatternFacade.DefaultFacade.getInstance();
     
      final int workerID = workerIDs.get(CacheFactory.getCluster().getLocalMember().getId());
     
      ExecutorService service = Executors.newFixedThreadPool(benchmarkParams.getThreadCount());
     
      final CyclicBarrier startBarrier = new CyclicBarrier(benchmarkParams.getThreadCount());
      final CountDownLatch finishLatch = new CountDownLatch(benchmarkParams.getThreadCount());
     
      for(int t = 0; t != benchmarkParams.getThreadCount(); ++t)
      {
        final int threadNumber = t;
       
        Callable<Void> worker = new Callable<Void>()
        {
          @Override
          public Void call() throws Exception
          {
            try
            {
              startBarrier.await();
             
              long commandsPerWorker       = CommandBenchmarkDispatcher.getCommandsPerWorker(benchmarkParams);
              long commandsPerWorkerThread = CommandBenchmarkDispatcher.getCommandsPerWorkerThead(benchmarkParams);
             
              long offset = workerID * commandsPerWorker + threadNumber * commandsPerWorkerThread;
             
              for(int c = 0; c != benchmarkParams.getCommandPerThread(); ++c)
              {
                Identifier ctx = contexts[rnd.nextInt(contexts.length)];
                long id = offset + c * commandFactory.getMarksPerCommand();
               
                speedLimit.accure();
   
                facade.submit(ctx, commandFactory.createCommand(id, benchmarkParams.getReportBuffer()).send());
              }
             
              finishLatch.countDown();
            }
            catch (Throwable t)
View Full Code Here

Examples of edu.isi.karma.controller.command.CommandFactory

      KarmaException, CommandException {
    ExecutionController ctrl = WorkspaceRegistry.getInstance()
        .getExecutionController(workspace.getId());
    JSONArray inputParamArr = this.createMultiCellCmd(rvco, selectedPath
        .getLeaf().getId());
    CommandFactory cf = ctrl.getCommandFactoryMap().get(
        MultipleValueEditColumnCommand.class.getSimpleName());
    JSONInputCommandFactory scf = (JSONInputCommandFactory) cf;

    // TODO handle exceptions intelligently
    Command comm = scf.createCommand(inputParamArr, workspace);
View Full Code Here

Examples of edu.isi.karma.controller.command.CommandFactory

    // add a new column
    JSONArray inputParamArr0 = this.creatNewColumnCommand(worksheetId,
        hTableId, colnameString);
    ExecutionController ctrl = WorkspaceRegistry.getInstance()
        .getExecutionController(workspace.getId());
    CommandFactory cf0 = ctrl.getCommandFactoryMap().get(
        AddColumnCommand.class.getSimpleName());
    JSONInputCommandFactory scf1 = (JSONInputCommandFactory) cf0;
    Command comm1 = null;

    // TODO handle exceptions intelligently
View Full Code Here

Examples of edu.isi.karma.controller.command.CommandFactory

          JSONObject obj = new JSONObject(array.get(j).toString());
          newOutputColumns.add(obj.get("value").toString());
        }
      }
      System.out.println(inputParamArr.toString(4));
      CommandFactory cf = commandFactoryMap.get(commObject.get(HistoryArguments.commandName.name()));
      if(cf != null) {
        try { // This is sort of a hack the way I did this, but could not think of a better way to get rid of the dependency
          Command comm = cf.createCommand(inputParamArr, workspace);
          comm.setOutputColumns(newOutputColumns);
          if(comm != null){
            commands.add(comm);
            //TODO consolidate update
            uc.append(workspace.getCommandHistory().doCommand(comm, workspace, true));
View Full Code Here

Examples of edu.isi.karma.controller.command.CommandFactory

      {
        String tag = tags.getString(j);
        if(null != tag && tag.equals(CommandTag.Transformation.name()))
        {
          JSONArray inputParamArr = (JSONArray) commObject.get(HistoryArguments.inputParameters.name());
          CommandFactory cf = commandFactoryMap.get(commObject.get(HistoryArguments.commandName.name()));
          if(cf != null && cf instanceof JSONInputCommandFactory) {

            JSONInputCommandFactory scf = (JSONInputCommandFactory)cf;
            Command comm = null;
            try {
View Full Code Here

Examples of edu.isi.karma.controller.command.CommandFactory

          ExecutionController ctrl = WorkspaceRegistry.getInstance().getExecutionController(workspace.getId());
          HashMap<String, CommandFactory> commandFactoryMap = ctrl.getCommandFactoryMap();
          JSONArray inputParamArr = (JSONArray)rco.historyObject.get(HistoryArguments.inputParameters.name());
          String commandName = (String)rco.historyObject.get(HistoryArguments.commandName.name());
          executor.normalizeCommandHistoryJsonInput(workspace, worksheetId, inputParamArr, commandName, true);
          CommandFactory cf = commandFactoryMap.get(rco.historyObject.get(HistoryArguments.commandName.name()));
          Command comm = cf.createCommand(inputParamArr, workspace);
          effects.append(comm.doIt(workspace));
          history.add(comm);
        }catch(Exception e) {
          history.add(rco.command);
          effects.append(rco.command.doIt(workspace));
View Full Code Here

Examples of edu.isi.karma.controller.command.CommandFactory

      }
      if(!Modifier.isAbstract(subType.getModifiers()) && !subType.isInterface())
        try
      {

          CommandFactory commandFactory = subType.newInstance();
          Class<? extends Command> command = commandFactory.getCorrespondingCommand();

          commandFactoryMap.put(command.getSimpleName(), commandFactory);
      } catch (InstantiationException e)
      {
        logger.error("Error instantiating {} -- likely does not have no-arg constructor", subType);
View Full Code Here

Examples of jp.vmi.selenium.selenese.command.CommandFactory

    /**
     * Test of getEval with "storedVars". (old style)
     */
    @Test
    public void evalWithStoredVars() {
        CommandFactory cf = runner.getCommandFactory();
        cf.registerUserDefinedCommandFactory(new UserDefinedCommandFactory() {
            @Override
            public Command newCommand(int index, String name, String... args) {
                if (!"setBoolean".equals(name))
                    return null;
                return new Command(index, name, args, 2) {
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.