Codota Logo
CLIContext.getCLI
Code IndexAdd Codota to your IDE (free)

How to use
getCLI
method
in
org.jpos.q2.CLIContext

Best Java code snippets using org.jpos.q2.CLIContext.getCLI (Showing top 9 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
DateTime d =
  • Codota Iconnew DateTime()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseDateTime(text)
  • Codota IconObject instant;new DateTime(instant)
  • Smart code suggestions by Codota
}
origin: jpos/jPOS

@Override
public void exec(CLIContext ctx, String[] args) throws Exception {
  final ObjectName on = new ObjectName("Q2:type=qbean,service=*");
  MBeanServer server = ctx.getCLI().getQ2().getMBeanServer();
  Set<ObjectInstance> b = server.queryMBeans(on, null);
  Iterator<ObjectInstance> it = b.iterator();
  while (it.hasNext()) {
    ObjectInstance instance = it.next();
    int status = (Integer) server.getAttribute(instance.getObjectName(), "State");
    if (status == QBean.STARTED) {
      ctx.println(instance.getObjectName().getKeyProperty("service") + "\t\t" + instance.getClassName());
    }
  }
}
origin: jpos/jPOS

  @Override
  public void exec(CLIContext ctx, String[] args) throws Exception {
    if (args.length < 2) {
      ctx.println("Usage: enable <xml_file(no extenssion)>");
      return;
    }
    File deployDir = ctx.getCLI().getQ2().getDeployDir();
    File deploy = new File(deployDir.getAbsolutePath() + "/" + args[1] + ".xml.off");
    if (deploy.exists() && deploy.isFile()) {
      File dest = new File(deployDir.getAbsolutePath() + "/" + args[1] + ".xml");
      deploy.renameTo(dest);
      ctx.println("ENABLED: " + args[1]);
      return;
    }
    File dest = new File(deployDir.getAbsolutePath() + "/" + args[1] + ".xml");
    if (dest.exists()) {
      ctx.println("Already enabled: " + args[1]);
      return;
    }
    ctx.println("Can't find the bean descriptor: " + args[1]);
    return;
  }
}
origin: jpos/jPOS

  @Override
  public void exec(CLIContext ctx, String[] args) throws Exception {
    if (args.length < 2) {
      ctx.println("Usage: enable <xml_file(no extenssion)>");
      return;
    }        
    File deployDir = ctx.getCLI().getQ2().getDeployDir();		
    File deploy = new File(deployDir.getAbsolutePath()+"/"+args[1]+".xml");
    if(deploy.exists() && deploy.isFile()){
      File dest = new File(deployDir.getAbsolutePath()+"/"+args[1]+".xml.off");
      deploy.renameTo(dest);
      ctx.println("DISABLED: " + args[1]);
      return;
    }
    File dest = new File(deployDir.getAbsolutePath()+"/"+args[1]+".xml.off");
    if (dest.exists()) {
      ctx.println("Already disabled: " + args[1]);
      return;
    }
    ctx.println("Can't find the bean descriptor: "+args[1]);
    return;
  }
}
origin: jpos/jPOS

@Override
public void exec(CLIContext ctx, String[] args) throws Exception {
  Q2 q2 = ctx.getCLI().getQ2();
  File deployDir = q2.getDeployDir();
  
  ctx.println(printDirectoryTree(deployDir));
  return;
}
origin: jpos/jPOS

  public void exec(CLIContext ctx, String[] args) throws Exception {
    ctx.println(ISOUtil.millisToString(ctx.getCLI().getQ2().getUptime()));
  }
}
origin: jpos/jPOS

MBeanServer server = ctx.getCLI().getQ2().getMBeanServer();
origin: jpos/jPOS-EE

binding.setVariable("q2",   cli.getCLI().getQ2());
binding.setVariable("cli",  cli.getCLI());
binding.setVariable("out",  new PrintStream(out));  // PrintStream "out" in the Binding will redirect println()
binding.setVariable("err",  new PrintStream(err));
origin: jpos/jPOS

public void exec(CLIContext cli, String[] args) throws IOException {
  boolean shutdown;
  if (cli.isInteractive() && cli.getOutputStream() != System.out) {
    cli.println ("Can't shutdown remotely");
    return;
  }
  if (hasOption(args, "-f", "--force", "-fq")) {
    shutdown = true;
  } else {
    shutdown = cli.confirm("Confirm shutdown (Yes/No) ? ");
  }
  if (shutdown) {
    if (!hasOption (args, "-q", "--quiet", "-fq"))
      cli.println("Shutting down.");
    cli.getCLI().getQ2().shutdown();
  } else {
    cli.println("Q2 will continue running.");
  }
}
origin: jpos/jPOS

if (cmd instanceof CLISubSystem) {
  CLISubSystem ss = (CLISubSystem) cmd;
  ctx.getCLI().setPrompt(ss.getPrompt(ctx, args), ss.getCompletionPrefixes(ctx, args));
org.jpos.q2CLIContextgetCLI

Popular methods of CLIContext

  • println
  • getReader
  • getOutputStream
  • getUserData
  • print
  • <init>
  • builder
  • confirm
  • isInteractive
  • isStopped
  • printLoggeable
  • printThrowable
  • printLoggeable,
  • printThrowable,
  • setReader,
  • setStopped

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getSupportFragmentManager (FragmentActivity)
  • putExtra (Intent)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • JList (javax.swing)
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now