Examples of Machine


Examples of org.apache.lenya.ac.Machine

        User user = identity.getUser();
        if (user != null) {
            userId = user.getId();
        }

        Machine machine = identity.getMachine();
        if (machine != null) {
            ipAddress = machine.getIp();
        }

        Role[] roles = PolicyAuthorizer.getRoles(request);
        String[] roleIds = new String[roles.length];
        for (int i = 0; i < roles.length; i++) {
View Full Code Here

Examples of org.apache.lenya.ac.Machine

                    User user = identity.getUser();
                    if (user != null) {
                        userId = user.getId();
                        objects.put(UsecaseCronJob.USER_ID, userId);
                    }
                    Machine machine = identity.getMachine();
                    if (machine != null) {
                        objects.put(UsecaseCronJob.MACHINE_IP, machine.getIp());
                    }
                }
            }

            String role = CronJob.class.getName() + "/usecase";
View Full Code Here

Examples of org.apache.lenya.ac.Machine

                }

                identity.addIdentifiable(user);
            }
            if (this.machineIp != null) {
                Machine machine = new Machine(this.machineIp);
                identity.addIdentifiable(machine);
            }

            controller.authorize(request);
View Full Code Here

Examples of org.apache.lenya.ac.Machine

                    User user = identity.getUser();
                    if (user != null) {
                        userId = user.getId();
                        objects.put(UsecaseCronJob.USER_ID, userId);
                    }
                    Machine machine = identity.getMachine();
                    if (machine != null) {
                        objects.put(UsecaseCronJob.MACHINE_IP, machine.getIp());
                    }
                }
            }

            String role = CronJob.class.getName() + "/usecase";
View Full Code Here

Examples of org.apache.provisionr.api.pool.Machine

    public void execute(DelegateExecution execution) throws Exception {
        Pool pool = (Pool) execution.getVariable(CoreProcessVariables.POOL);
        checkNotNull(pool, "Please add the pool description as a process " +
            "variable with the name '%s'.", CoreProcessVariables.POOL);

        Machine machine = (Machine) execution.getVariable("machine");
        checkNotNull(machine, "expecting a process variable named 'machine'");

        LOG.info(">> Connecting to machine {} to run puppet script", machine);

        SSHClient client = Ssh.newClient(machine, overrideAdminAccess(pool));
        try {
            for (Map.Entry<String, String> entry : createAdditionalFiles(pool, machine).entrySet()) {
                Ssh.createFile(client, /* content = */ entry.getValue(), 0600, /* destination= */ entry.getKey());
            }

            final String destination = "/tmp/" + remoteFileName + ".pp";
            Ssh.createFile(client, createPuppetScript(pool, machine), 0600, destination);

            Session session = client.startSession();
            try {
                session.allocateDefaultPTY();

                // TODO: extract this loop outside of this activity (probably using a business process error)
                final String runScriptWithWaitCommand = "while ! which puppet &> /dev/null ; " +
                    "do echo 'Puppet command not found. Waiting for userdata.sh script to finish (10s)' " +
                    "&& sleep 10; " +
                    "done " +
                    "&& sudo puppet apply --detailed-exitcodes --debug --verbose " + destination;
                Session.Command command = session.exec(runScriptWithWaitCommand);

                Ssh.logCommandOutput(LOG, machine.getExternalId(), command);
                command.join();

                final Integer exitStatus = command.getExitStatus();
                if (exitStatus != PUPPET_FINISHED_WITH_NO_FAILURES && exitStatus != 0) {
                    throw new RuntimeException(String.format("Failed to execute puppet. " +
View Full Code Here

Examples of org.apache.uima.ducc.rm.scheduler.Machine

                if ( proc.isComplete() ) {
                    logger.debug(methodName, j.getId(), "Skipping process", pid, "on", ni.getName(), "beacause state is", state);
                    continue;
                 }

                Machine m = scheduler.getMachine(ni);
                if ( m == null ) {                             // not known, huh? maybe next epoch it will have checked in
                    refuse(j, "Cannot restore job because node " + ni.getName()  + " is unknown.");
                    return false;                              // so we don't add it to global tables
                } else {
                    DuccId id = proc.getDuccId();
                    Share   s = new Share(id, m, j, m.getShareOrder());        // guess share order; scheduler will reset when it recovers job
                    long mem = proc.getResidentMemory();

                    logger.info(methodName, j.getId(), "Assigning share in state", state, "pid", pid, "for recovery", s.toString());
                    j.recoverShare(s);
                    s.update(j.getId(), mem, state, proc.getTimeWindowInit(), proc.getTimeWindowRun(), pid);                   
View Full Code Here

Examples of org.asturlinux.frade.currin.machine.Machine

  try {
      Logger log = Logger.getLogger("Main");
      log.debug("En la ejecucion de Main");
      Program _p = parseFile(file);
      _p.debug();
      Machine _m = new Machine(_p);
            _m.evaluate(function);
      System.out.println(_m.printResult());
  } catch ( ParsingException pe ) {
      System.out.println("ERROR parseando el fichero");
  } catch ( InterpreterException ie) {
      System.out.println("ERROR ejecutando funcion");
      System.out.println(ie.getMessage());
View Full Code Here

Examples of org.jboss.blacktie.jatmibroker.core.conf.Machine

      while (launchers.hasNext()) {
        Server server = launchers.next();
        Iterator<Machine> iterator2 = server.getLocalMachine()
            .iterator();
        while (iterator2.hasNext()) {
          Machine machine = iterator2.next();
          ServerToStop serverToStop = new ServerToStop();
          serverToStop.setName(server.getName());
          serverToStop.setId(machine.getServerId());
          serversToStop.add(serverToStop);
        }
      }
    } else {
      ServerToStop serverToStop = new ServerToStop();
View Full Code Here

Examples of org.jboss.narayana.blacktie.jatmibroker.core.conf.Machine

      while (launchers.hasNext()) {
        Server server = launchers.next();
        Iterator<Machine> iterator2 = server.getLocalMachine()
            .iterator();
        while (iterator2.hasNext()) {
          Machine machine = iterator2.next();
          ServerToStop serverToStop = new ServerToStop();
          serverToStop.setName(server.getName());
          serverToStop.setId(machine.getServerId());
          serversToStop.add(serverToStop);
        }
      }
    } else {
      ServerToStop serverToStop = new ServerToStop();
View Full Code Here

Examples of org.jboss.narayana.blacktie.jatmibroker.core.conf.Machine

        if (localMachinesList.size() != 0) {
          Iterator<Machine> localMachines = localMachinesList
              .iterator();
          while (localMachines.hasNext()) {
            log.debug("Found machine");
            Machine localMachine = localMachines.next();
            String pathToExecutable = localMachine
                .getPathToExecutable();
            String argLine = "-i " + localMachine.getServerId()
                + " -s " + localMachine.getServer().getName();
            if (localMachine.getArgLine() != null) {
              argLine = argLine + " " + localMachine.getArgLine();
            }
            String[] split = argLine.split(" ");
            String[] cmdarray = new String[split.length + 1 + 0];
            cmdarray[0] = pathToExecutable;
            System.arraycopy(split, 0, cmdarray, 1, split.length);
            String[] envp = null;
            File dir = new File(localMachine.getWorkingDirectory());
            Process exec = Runtime.getRuntime().exec(cmdarray,
                envp, dir);
            log.debug("Launched server: " + pathToExecutable);
            BufferedReader output = new BufferedReader(
                new InputStreamReader(exec.getInputStream()));
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.