Package org.glassfish.embeddable

Examples of org.glassfish.embeddable.CommandRunner.run()


                        commandParams[i - 1] = split[i].trim();
                    }
                }
                try {
                    CommandResult result = commandParams == null ?
                            cr.run(command) : cr.run(command, commandParams);
                    System.out.println("\n" + result.getOutput());
                } catch (Exception ex) {
                    System.out.println(ex.getMessage());
                }
            }
View Full Code Here


                        commandParams[i - 1] = split[i].trim();
                    }
                }
                try {
                    CommandResult result = commandParams == null ?
                            cr.run(command) : cr.run(command, commandParams);
                    System.out.println("\n" + result.getOutput());
                } catch (Exception ex) {
                    System.out.println(ex.getMessage());
                }
            }
View Full Code Here

            if (key.startsWith(CONFIG_PROP_PREFIX)) {
                if (commandRunner == null) {
                    // only create the CommandRunner if needed
                    commandRunner = habitat.getService(CommandRunner.class);
                }
                CommandResult result = commandRunner.run("set",
                        key.substring(CONFIG_PROP_PREFIX.length()) + "=" + props.getProperty(key));
                if (result.getExitStatus() != CommandResult.ExitStatus.SUCCESS) {
                    throw new GlassFishException(result.getOutput());
                }
            }
View Full Code Here

                        commandParams[i - 1] = split[i].trim();
                    }
                }
                try {
                    CommandResult result = commandParams == null ?
                            cr.run(command) : cr.run(command, commandParams);
                    System.out.println("\n" + result.getOutput());
                } catch (Exception ex) {
                    System.out.println(ex.getMessage());
                }
            }
View Full Code Here

                        commandParams[i - 1] = split[i].trim();
                    }
                }
                try {
                    CommandResult result = commandParams == null ?
                            cr.run(command) : cr.run(command, commandParams);
                    System.out.println("\n" + result.getOutput());
                } catch (Exception ex) {
                    System.out.println(ex.getMessage());
                }
            }
View Full Code Here

    public void configure(Properties props) throws GlassFishException {
        CommandRunner commandRunner = habitat.getComponent(CommandRunner.class);
        for (Object obj : props.keySet()) {
            String key = (String) obj;
            if (key.startsWith(CONFIG_PROP_PREFIX)) {
                CommandResult result = commandRunner.run("set",
                        key.substring(CONFIG_PROP_PREFIX.length()) + "=" + props.getProperty(key));
                if (result.getExitStatus() != CommandResult.ExitStatus.SUCCESS) {
                    throw new GlassFishException(result.getOutput());
                }
            }
View Full Code Here

   }
  
   private String executeCommand(String command, String... parameterList) throws Throwable
   {
      CommandRunner runner = glassfish.getCommandRunner();
      CommandResult result = runner.run(command, parameterList);

      String output = null;
      switch(result.getExitStatus())
      {
         case FAILURE:
View Full Code Here

   }
  
   private void executeCommand(String command, String... parameterList) throws Throwable
   {
      CommandRunner runner = glassfish.getCommandRunner();
      CommandResult result = runner.run(command, parameterList);

      switch(result.getExitStatus())
      {
         case FAILURE:
         case WARNING:
View Full Code Here

   }
  
   private void executeCommand(String command, String... parameterList) throws Throwable
   {
      CommandRunner runner = glassfish.getCommandRunner();
      CommandResult result = runner.run(command, parameterList);

      switch(result.getExitStatus())
      {
         case FAILURE:
         case WARNING:
View Full Code Here

    public void configure(Properties props) throws GlassFishException {
        CommandRunner commandRunner = habitat.getService(CommandRunner.class);
        for (Object obj : props.keySet()) {
            String key = (String) obj;
            if (key.startsWith(CONFIG_PROP_PREFIX)) {
                CommandResult result = commandRunner.run("set",
                        key.substring(CONFIG_PROP_PREFIX.length()) + "=" + props.getProperty(key));
                if (result.getExitStatus() != CommandResult.ExitStatus.SUCCESS) {
                    throw new GlassFishException(result.getOutput());
                }
            }
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.