Examples of CommandEnvironment


Examples of java.rmi.activation.ActivationGroupDesc.CommandEnvironment

        ActivationSystem system = new FakeActivationSystem(logger);
        ActivationGroupID agid = new FakeActivationGroupID(logger, system);
        String program = "java";
        String[] options = {""};
        Properties props = new Properties();
        CommandEnvironment cmd = new CommandEnvironment(program, options);
        ActivationGroupDesc gd = new ActivationGroupDesc(props, cmd);
        try {
            java.rmi.activation.ActivationGroup ag =
                    ActivationGroup.createGroup(agid, gd, 0);
        } catch (ActivationException ae) {
View Full Code Here

Examples of java.rmi.activation.ActivationGroupDesc.CommandEnvironment

    sys.getActivationGroupDesc(gid);
    throw new RuntimeException(
           "client2 able to getActivationGroupDesc");
      } catch (SecurityException e) {
      }
      CommandEnvironment env =
    new CommandEnvironment("foobar", new String[]{"-baz"});
      // can set java program to "foobar" and option "-baz"
      sys.setActivationGroupDesc(gid,
               new ActivationGroupDesc(null, env));
      env = new CommandEnvironment("baz", null);
      // cannot set java program to "baz"
      try {
    sys.setActivationGroupDesc(gid,
             new ActivationGroupDesc(null,
                   env));
    throw new RuntimeException(
       "client2 able to setActivationGroupDesc with program baz");
      } catch (SecurityException e) {
      }
      // cannot set java program to "foobar" and option "-foobar"
      env = new CommandEnvironment("foobar", new String[]{"-foobar"});
      try {
    sys.setActivationGroupDesc(gid,
             new ActivationGroupDesc(null, env));
    throw new RuntimeException(
     "client2 able to setActivationGroupDesc with option -foobar");
View Full Code Here

Examples of java.rmi.activation.ActivationGroupDesc.CommandEnvironment

  String[] options = (String[]) config.getEntry(
      "com.sun.jini.example.hello.Server", "javaOptions", String[].class,
      new String[0]);

  /* Create command environment */
  CommandEnvironment cmd = new CommandEnvironment(program, options);

  /* Get system properties for Java program */
  String[] propValues = (String[]) config.getEntry(
      "com.sun.jini.example.hello.Server", "javaProperties",
      String[].class, new String[0]);
View Full Code Here

Examples of java.rmi.activation.ActivationGroupDesc.CommandEnvironment

      ServiceStarter.getActivationSystem(
          getActivationSystemHost(),
    getActivationSystemPort(),
    config);
   
  CommandEnvironment cmdToExecute
      = new CommandEnvironment(getServerCommand(),
                               getServerOptions());
  ActivationGroupID gid = null;
        try {
      gid = sys.registerGroup(
                new ActivationGroupDesc(getServerProperties(),
View Full Code Here

Examples of org.platformlayer.ops.CommandEnvironment

      TemplatedFile nat = addChild(TemplatedFile.build(template, scriptPath));
      nat.setFileMode("0755");

      // Simulate an ifup run
      Command command = Command.build(scriptPath);
      CommandEnvironment env = new CommandEnvironment();
      env.put("IFACE", template.getPublicInterface());
      env.put("MODE", "start");
      env.put("ADDRFAM", "inet");
      command.setEnvironment(env);

      nat.setUpdateAction(command);
    }
  }
View Full Code Here

Examples of org.platformlayer.ops.CommandEnvironment

    apt.update(target, true);

    // We need to install curl first so we can detect the performance of our proxies
    apt.install(target, "curl"); // Needed for proxy testing at least

    CommandEnvironment httpProxyEnv = httpProxies.getHttpProxyEnvironment(target, Usage.SoftwarePackages, null);

    // For now, we assume that this image doesn't have debootstrap pre-installed
    apt.install(target, "debootstrap");

    // For transferring the file to a direct image server
View Full Code Here

Examples of org.platformlayer.ops.CommandEnvironment

  public void install(OpsTarget target, String... packageNames) throws OpsException {
    install(target, Arrays.asList(packageNames));
  }

  public void upgrade(OpsTarget target) throws OpsException {
    CommandEnvironment commandEnvironment = buildEnvironmentWithProxy(target);

    Command command = Command.build("apt-get --yes upgrade");
    target.executeCommand(command.setEnvironment(commandEnvironment).setTimeout(TimeSpan.TEN_MINUTES));

    flushCache(target);
View Full Code Here

Examples of org.platformlayer.ops.CommandEnvironment

    flushCache(target);
  }

  public void clean(OpsTarget target) throws OpsException {
    CommandEnvironment commandEnvironment = buildEnvironmentWithProxy(target);

    Command command = Command.build("apt-get clean");
    target.executeCommand(command.setEnvironment(commandEnvironment).setTimeout(TimeSpan.TEN_MINUTES));
  }
View Full Code Here

Examples of org.platformlayer.ops.CommandEnvironment

    }
    return packages;
  }

  private CommandEnvironment buildEnvironmentWithProxy(OpsTarget target) throws OpsException {
    CommandEnvironment commandEnvironment = null;

    if (!haveCurl(target)) {
      log.warn("We don't yet have curl; can't detect best proxy so won't use a proxy");
    } else {
      commandEnvironment = httpProxies.getHttpProxyEnvironment(target, Usage.SoftwarePackages, null);
    }

    if (commandEnvironment == null) {
      commandEnvironment = new CommandEnvironment();
    }

    return commandEnvironment;
  }
View Full Code Here

Examples of org.platformlayer.ops.CommandEnvironment

    return commandEnvironment;
  }

  public void install(OpsTarget target, Iterable<String> packageNames) throws OpsException {
    CommandEnvironment commandEnvironment = buildEnvironmentWithProxy(target);
    commandEnvironment.put("DEBIAN_FRONTEND", "noninteractive");

    log.info("Installing APT packages: " + Joiner.on(",").join(packageNames));

    Command command = Command.build("apt-get install --yes");
    for (String packageName : packageNames) {
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.