Examples of Command


Examples of net.flexmojos.oss.compiler.command.Command

    private FlexCompilerArgumentParser parser;

    public Result compileSwc( final ICompcConfiguration configuration, boolean sychronize )
        throws Exception
    {
        return CommandUtil.execute( new Command()
        {
            public void command()
                throws Exception
            {
                String[] args = parser.parseArguments( configuration, ICompcConfiguration.class );
View Full Code Here

Examples of net.floodlightcontroller.core.IListener.Command

                    // Get the starting time (overall and per-component) of
                    // the processing chain for this packet if performance
                    // monitoring is turned on
                    pktinProcTime.recordStartTimePktIn();
                    Command cmd;
                    for (IOFMessageListener listener : listeners) {
                        pktinProcTime.recordStartTimeComp(listener);
                        cmd = listener.receive(sw, m, bc);
                        pktinProcTime.recordEndTimeComp(listener);
View Full Code Here

Examples of net.fortytwo.ripple.query.Command

                dereference(list.getFirst(), mc);
                results.put(list);
            }
        };

        Command cmd = new RippleQueryCmd(query, derefSink);

        // Execute the inner command and wait until it is finished.
        cmd.setQueryEngine(qe);
        taskSet = new TaskSet();
        taskSet.add(cmd);
        taskSet.waitUntilEmpty();

        // Flush results to the view.
View Full Code Here

Examples of net.java.trueupdate.manager.spec.cmd.Command

            }

            @Override public Command decorate(
                    final Command cmd,
                    final CommandId id) {
                final Command tcmd = time(cmd, id);
                return CommandId.UNDEPLOY == id ? undeploy(tcmd) : checked(tcmd);
            }

            Command time(final Command cmd, final CommandId id) {
                return Commands.time(cmd,
                        new CommandIdLogContext() {
                            @Override String loggerName() {
                                return CoreUpdateManager.class.getName();
                            }

                            @Override CommandId commandId() { return id; }
                        });
            }

            Command undeploy(final Command cmd) {
                return new AbstractCommand() {

                    @Override protected void doStart() throws Exception {
                        onStartUndeployment();
                    }

                    @Override protected void doPerform() throws Exception {
                        cmd.perform();
                        onPerformUndeployment();
                    }

                    @Override protected void doRevert() throws Exception {
                        cmd.revert();
                        onRevertUndeployment();
                    }
                };
            }

            void onStartUndeployment() throws Exception {
                sendRedeploymentRequest();
                final long stop = System.currentTimeMillis()
                        + HANDSHAKE_TIMEOUT_MILLIS;
                synchronized (sessionManager) {
                    while (true) {
                        final UpdateMessage um = sessionManager.get(request);
                        final Type type = um.type();
                        checkCancelled(type);
                        if (PROCEED_REDEPLOYMENT_RESPONSE.equals(type))
                            break;
                        final long remaining = stop - System.currentTimeMillis();
                        if (0 >= remaining)
                            throw new Exception(
                                    "Timeout while waiting for a redeployment response from the update agent.");
                        sessionManager.wait(remaining);
                    }
                }
            }

            void sendRedeploymentRequest() throws Exception {
                final UpdateMessage redeploymentRequest = responseFor(request)
                        .type(REDEPLOYMENT_REQUEST)
                        .artifactDescriptor(artifactDescriptor())
                        .build();
                sendAndLog(redeploymentRequest);
            }

            void checkCancelled(final Type type) throws Exception {
                if (CANCEL_REDEPLOYMENT_RESPONSE.equals(type))
                    throw new Exception(
                            "The update agent has cancelled the update installation.");
            }

            void onPerformUndeployment() {
                anticipatedDescriptor = request
                        .artifactDescriptor()
                        .update()
                        .version(request.updateVersion())
                        .build();
                anticipatedLocation = request.updateLocation();
            }

            void onRevertUndeployment() {
                anticipatedDescriptor = request.artifactDescriptor();
                anticipatedLocation = request.currentLocation();
            }

            Command checked(final Command cmd) {
                return new Command() {

                    @Override public void perform() throws Exception {
                        // Throw an InterruptedException if requested.
                        Thread.sleep(0);
                        // May be undeployed, so check for null.
View Full Code Here

Examples of net.kuujo.copycat.Command

  private void init() {
    Class<?> clazz = stateMachine.getClass();
    while (clazz != Object.class) {
      for (Method method : clazz.getDeclaredMethods()) {
        // Check whether this method is a "command" method.
        Command command = findAnnotation(method, Command.class);
        if (command != null) {
          addCommandMethod(method, command);
        } else {
          // Check whether this method is a "query" method.
          Query query = findAnnotation(method, Query.class);
View Full Code Here

Examples of net.ocheyedan.wrk.cmd.Command

    public static void main(String[] args) {

        Config.init();
        ensureTrelloToken();

        Command command = CommandLineParser.parse(args);
        command.run();
    }
View Full Code Here

Examples of net.raymanoz.command.Command

      executeCommand(cmdln);
    }
  }

  private void executeCommand(CmdLineArgumentsAndSwitches cmdln) {
    Command command;
    try {
      command = commands.get(cmdln.arg(0));
      command.execute(cmdln.arguments());
    } catch (ProblemInScriptListNumbers pe){
      System.out.println("************************************");
      System.out.println("");
      System.out.println(pe.getMessage());
      System.out.println("");
View Full Code Here

Examples of net.rim.device.api.command.Command

       
        user_message.setChangeListener(centre_text_listener);
        last_aids.setChangeListener(centre_text_listener);

        mi_kill.setCommandContext(this);
        mi_kill.setCommand(new Command(new KillCommand()));
        addMenuItem(mi_kill);

        mi_settings.setCommandContext(this);
        mi_settings.setCommand(new Command(new SettingsCommand()));
        addMenuItem(mi_settings);

        try {
            if(nfc_service.isNfcEnabled()) {
                nfc_led = new BitmapField(bmp_nfc_led_on);
View Full Code Here

Examples of net.rubyeye.xmemcached.command.Command

      final AtomicBoolean done = new AtomicBoolean(false);
      byte[] response = saslClient.hasInitialResponse() ? saslClient
          .evaluateChallenge(EMPTY_BYTES) : EMPTY_BYTES;
      CountDownLatch latch = new CountDownLatch(1);
      Command command = this.commandFactory.createAuthStartCommand(
          saslClient.getMechanismName(), latch, response);
      if (!this.memcachedTCPSession.isClosed())
        this.memcachedTCPSession.write(command);
      else {
        log
            .error("Authentication fail,because the connection has been closed");
        throw new RuntimeException(
            "Authentication fai,connection has been close");
      }

      while (!done.get()) {
        try {
          latch.await();
        } catch (InterruptedException e) {
          Thread.currentThread().interrupt();
          done.set(true);
        }
        ResponseStatus responseStatus = ((BaseBinaryCommand) command)
            .getResponseStatus();
        switch (responseStatus) {
        case NO_ERROR:
          done.set(true);
          log.info("Authentication to "
              + this.memcachedTCPSession.getRemoteSocketAddress()
              + " successfully");
          break;
        case AUTH_REQUIRED:
          log
              .error("Authentication failed to "
                  + this.memcachedTCPSession
                      .getRemoteSocketAddress());
          log.warn("Reopen connection to "
              + this.memcachedTCPSession.getRemoteSocketAddress()
              + ",beacause auth fail");
          this.memcachedTCPSession.setAuthFailed(true);

          // It it is not first time,try to sleep 1 second
          if (!this.authInfo.isFirstTime()) {
            Thread.sleep(1000);
          }
          this.memcachedTCPSession.close();
          done.set(true);
          break;
        case FUTHER_AUTH_REQUIRED:
          System.out.println(command.getResult());
          String result = String.valueOf(command.getResult());
          response = saslClient.evaluateChallenge(ByteUtils
              .getBytes(result));
          latch = new CountDownLatch(1);
          command = commandFactory.createAuthStepCommand(saslClient
              .getMechanismName(), latch, response);
View Full Code Here

Examples of net.schmizz.sshj.connection.channel.direct.Session.Command

      commandString.append(app.getInputDataDirectory());
      commandString.append(" ; ");
      commandString.append("mkdir -p ");
      commandString.append(app.getOutputDataDirectory());

      Command cmd = session.exec(commandString.toString());
      cmd.join(Constants.COMMAND_EXECUTION_TIMEOUT, TimeUnit.SECONDS);
    } catch (ConnectionException e) {
      throw new GFacHandlerException(e.getMessage(), e, context);
    } catch (TransportException e) {
      throw new GFacHandlerException(e.getMessage(), e, context);
    } catch (IOException e) {
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.