Package org.foo.shell

Examples of org.foo.shell.Command


  public void start(final BundleContext context) throws Exception {
    tracker = new ServiceTracker(context, Command.class.getName(), new ServiceTrackerCustomizer() {
     
      public Object addingService(ServiceReference ref) {
        Command command = (Command) context.getService(ref);
        startTty(context, command);
        return command;
      }
     
      public void modifiedService(ServiceReference ref, Object service) {
View Full Code Here


  public void start(final BundleContext context) throws Exception {
    tracker = new ServiceTracker(context, Command.class.getName(), new ServiceTrackerCustomizer() {
     
      public Object addingService(ServiceReference ref) {
        Command command = (Command) context.getService(ref);
        startTelnet(context, command);
        return command;
      }
     
      public void modifiedService(ServiceReference ref, Object service) {
View Full Code Here

  public void exec(String args, PrintStream out, PrintStream err) {
    int idx = args.indexOf(' ');

    boolean found = false;

    Command command = m_commands.get((idx > 0) ? args.substring(0, idx) : args);

    if (command != null) {
      found = true;

      try {
        command.exec((idx > 0) ? args.substring(idx) : null, out, err);
      } catch (Exception ex) {
        ex.printStackTrace(err);
        out.println("Unable to execute: " + args);
      }
    }
View Full Code Here

TOP

Related Classes of org.foo.shell.Command

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.