Package org.jboss.blacktie.btadmin

Examples of org.jboss.blacktie.btadmin.CommandFailedException


        new String[] { "java.lang.String", "java.lang.String" });
    if (result) {
      log.info("Service unadvertised");
    } else {
      log.error("Service could not be unadvertised");
      throw new CommandFailedException(-1);
    }
  }
View Full Code Here


        "pauseDomain", new Object[] {}, new String[] {});
    if (result) {
      log.info("Domain paused");
    } else {
      log.error("Domain could not be paused");
      throw new CommandFailedException(-1);
    }
  }
View Full Code Here

            serverName, serviceName }, new String[] {
            "java.lang.String", "java.lang.String" });
    if (output == null) {
      log.error("Server/service was not running: " + serverName + "/"
          + serviceName);
      throw new CommandFailedException(-1);
    }
    Document document = output.getOwnerDocument();
    DOMImplementationLS domImplLS = (DOMImplementationLS) document
        .getImplementation();
    LSSerializer serializer = domImplLS.createLSSerializer();
View Full Code Here

        if (result) {
          log.info("Server shutdown successfully: " + next.getName()
              + " with id: " + next.getId());
        } else {
          log.error("Server could not be shutdown (may already be stopped)");
          throw new CommandFailedException(-1);
        }
      }
    } else {
      log.error("No servers were configured for shutdown");
      throw new CommandFailedException(-1);

    }
  }
View Full Code Here

              if (readLine == null) {
                readLine = error.readLine();
              }
              log.info(readLine);
              if (readLine == null) {
                throw new CommandFailedException(-3);
              } else if (readLine.endsWith("serverinit failed")) {
                throw new CommandFailedException(-2);
              } else if (readLine
                  .endsWith("Server waiting for requests...")) {
                new Thread(new EatIO(exec.getInputStream()))
                    .start();
                new Thread(new EatIO(exec.getErrorStream()))
                    .start();
                found = true;
                break;
              }
            }
          }
        }
      }
    }
    if (!found) {
      log.error("No machines configured for host");
      throw new CommandFailedException(-1);
    }
  }
View Full Code Here

        new String[] { "java.lang.String", "java.lang.String" });
    if (result) {
      log.info("Service advertised");
    } else {
      log.error("Service could not be advertised");
      throw new CommandFailedException(-1);
    }
  }
View Full Code Here

          commands.add(capitalized);
        }
      }
      if (commands.size() == 0) {
        log.error("Could not find any commands");
        throw new CommandFailedException(-1);
      }
    } catch (Throwable e) {
      log.debug("Was not loaded from a jar");
      try {
        // Get the location of this class
        Class[] classes = getClasses("org.jboss.blacktie.btadmin.commands");
        for (int i = 0; i < classes.length; i++) {
          String commandName = classes[i].getName().substring(
              classes[i].getName().lastIndexOf('.') + 1);
          String firstLetter = commandName.substring(0, 1);
          String remainder = commandName.substring(1);
          String capitalized = firstLetter.toLowerCase() + remainder;
          commands.add(capitalized);
        }
      } catch (Throwable e2) {
        log.error("Could not find any commands");
        throw new CommandFailedException(-1);
      }
    }
    for (int i = 0; i < commands.size(); i++) {
      if (command != null && !command.equals(commands.get(i))) {
        continue;
      }
      try {
        Command command = CommandHandler.loadCommand(commands.get(i));
        log.info("Example usage: " + commands.get(i) + " "
            + command.getExampleUsage());
      } catch (Exception e) {
        log.error("Could not get help for command: " + commands.get(i),
            e);
        throw new CommandFailedException(-1);
      }
    }
  }
View Full Code Here

        "resumeDomain", new Object[] {}, new String[] {});
    if (result) {
      log.info("Domain resumed");
    } else {
      log.error("Domain could not be resumed");
      throw new CommandFailedException(-1);
    }
  }
View Full Code Here

TOP

Related Classes of org.jboss.blacktie.btadmin.CommandFailedException

Copyright © 2018 www.massapicom. 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.