Package org.jboss.fresh.io

Examples of org.jboss.fresh.io.BufferWriter


   * Displays properties of all processes and sessions.
   */
  public void process(String exepath, String[] params) throws Exception {
    log.debug("entered");

    pout = new PrintWriter2(new BufferedWriter(new BufferWriter(getStdOut())));

    String[] invalids = getInvalidSwitches(args, "axflitT", new String[]{"--ex", "--help", "--order", "--out", "--full-thread-dump"});

    alles = isSwitchActive(args, "a", null);
    boolean xall = isSwitchActive(args, "x", null);
View Full Code Here


  public void process(String exename, String[] params) throws Exception {
    log.debug("entered");

    if (helpRequested()) {
      PrintWriter out = new PrintWriter(new BufferWriter(getStdOut()));
      out.print("  Usage: lslns [--help] [-out=string|filename|fileinfo] TARGET\n");
      out.print("    --help : this help\n");
      out.close();
      log.debug("done");
      return;
    }

    BufferObjectWriter oout = new BufferObjectWriter(getStdOut());
    VFS vfs = shell.getVFS();

    FileName pwd = new FileName(shell.getEnvProperty("PWD"));
    String out = OUTPUT_STRING;
    FileName target = null;
    Collection result = new HashSet();


    if (params.length <= 2) {
      for (int i = 0; i < params.length; i++) {
        String param = params[i];

        if (param.startsWith(OUTPUT))
          out = param.substring(OUTPUT.length());

        else {
          FileName path = new FileName(param);
          if (path.isRelative())
            path = pwd.absolutize(path);

          target = path;
        }
      }
    }

    if ((params.length >= 3) || (target == null)) {
      if (canThrowEx()) {
        throw new RuntimeException("Usage: lslns [-out=string|filename|fileinfo] TARGET");
      } else {
        PrintWriter pw = new PrintWriter(new BufferWriter(getStdOut()));
        pw.println("Usage: lslns [-out=string|filename|fileinfo] TARGET");
      }
    } else {
      Collection links = vfs.getLinks(shell.getUserCtx(), target, true);
      Iterator it = links.iterator();
View Full Code Here

    //  cat [PATHS]
    public void process(String exename, String[] params) throws Exception {
        getLog().debug("entered");

        if (helpRequested()) {
            PrintWriter2 out = new PrintWriter2(new BufferWriter(getStdOut()));
            out.println("Usage: " + getCmd() + " [-ex] [-notx] <service name> <method sig>");
            out.println("      --help : this help");
            out.close();
            getLog().debug("done");
            return;
        }

        // zaklju�imo transakcijo �e je za�eta
        // get mbean name
        // get method
        PrintWriter out = new PrintWriter(new BufferWriter(getStdOut()));

        if (params.length < 2) {
            if (canThrowEx()) {
                throw new Exception("Wrong number of parameters. Usage: " + getCmd() + " [-notx] <service name> <method sig>");
            } else {
View Full Code Here

  public void process(String exename, String[] params) throws Exception {
    log.debug("entered");

    if (helpRequested()) {
      PrintWriter out = new PrintWriter(new BufferWriter(getStdOut()));
      out.print("Usage: cat [--help] [files]\n");
      out.print("    If no parameters are given, cat reads from his standard input Buffer.\n");
      out.print("    --help : this help\n");
      out.close();
      System.out.println("[CatExe] : done.");
View Full Code Here

  private static final String ADD = "-a";

  public void process(String exename, String[] params) throws Exception {
    log.debug("entered");

    PrintWriter2 out = new PrintWriter2(new BufferWriter(getStdOut()));

    if (helpRequested()) {
      out.println("Usage: setattr [-ex] [--help] [-a] FILE_NAME  ATTR_NAME ATTR_VALUE  [ATTR_NAME ATTR_VALUE]");
      out.println("    ATTR_NAME : name of the attribute to be set.");
      out.println("    ATTR_VALUE : new value of the specified attribute.");
View Full Code Here

  public void process(String exepath, String[] params) throws Exception {
    log.debug("entered");

    if (helpRequested()) {
      PrintWriter out = new PrintWriter(new BufferWriter(getStdOut()));
      out.println("Usage: set [-s] PROPERTY = NEW_VALUE");
      out.println("              set property value");
      out.println();
      out.println("   -s          : Set system property (System.setProperty)");
      out.println("   -p <procid> : process id - apply set operation to a process / shell ");
View Full Code Here

  public void process(String exepath, String[] params) throws Exception {
    log.debug("entered");

    if (helpRequested() || params.length == 0) {
      PrintWriter out = new PrintWriter(new BufferWriter(getStdOut()));
      out.print("Usage: kill [-ex] [--help] [pid]\n");
      out.print("    -<sig> : kind of signal (i.e. STOP, TERM, KILL)\n");
      out.print("       pid : process id of the process to be 'killed'\n");
      out.print("    --help : this help\n");
      out.close();
      log.debug("done");
      return;
    }

    PrintWriter pout = new PrintWriter(new BufferedWriter(new BufferWriter(getStdOut())));
    String sig = "TERM";
    String pid = null;
   
    // take one parameter: pid
    for(int i=0; i<params.length; i++) {
View Full Code Here

   */

  public void process(String exepath, String[] params) throws Exception {
    log.debug("entered");
    PrintWriter2 out = new PrintWriter2(new BufferWriter(getStdOut()));

    if (helpRequested() || (params.length < 3)) {
      usage(out);
      out.close();
      log.debug("done");
View Full Code Here

  public void process(String exepath, String[] params) {
    log.debug("entered");
    // echo displays parameters to out just as it gets them making spaces in between

    if (helpRequested()) {
      PrintWriter out = new PrintWriter(new BufferWriter(getStdOut()));
      out.print("Usage: echo [--help] [params]\n");
      out.print("      params : params to be sent to the pipeline with spaces in between each parameter.\n");
      out.print("      --help : this help\n");
      out.flush();
      log.debug("done");
      return;
    }

    PrintWriter pout = new PrintWriter(new BufferedWriter(new BufferWriter(getStdOut())));
    for (int i = 0; i < params.length; i++) {
      if (i > 0)
        pout.print(" ");
      pout.print(params[i]);
    }
View Full Code Here

      }
    } catch (Exception e) {
      if(canThrowEx()) {
        throw e;
      } else {
        org.jboss.fresh.io.BufferWriter bw = new BufferWriter(getStdOut());
        PrintWriter tOut = new PrintWriter(bw);
        tOut.write(e.toString());
      }
    }
    out.close();
View Full Code Here

TOP

Related Classes of org.jboss.fresh.io.BufferWriter

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.