Package org.crsh.shell

Examples of org.crsh.shell.ShellFactory


      PluginContext context = WebPluginLifeCycle.getPluginContext(contextPath);
      if (context != null) {
        Boolean enabled = context.getProperty(WebPlugin.ENABLED);
        if (enabled != null && enabled) {
          log.fine("Using shell " + context);
          ShellFactory factory = context.getPlugin(ShellFactory.class);
          Principal user = wsSession.getUserPrincipal();
          Shell shell = factory.create(user);
          CRaSHSession session = new CRaSHSession(wsSession, shell);
          sessions.put(wsSession.getId(), session);
          log.fine("Established session " + wsSession.getId());
        } else {
          log.fine("Web plugin disabled");
View Full Code Here


    }
  };

  @Override
  public ShellFactory getImplementation() {
    return new ShellFactory() {
      @Override
      public Shell create(Principal principal) {
        return shell;
      }
    };
View Full Code Here

    return keyPairProvider;
  }

  public void init() {
    try {
      ShellFactory factory = context.getPlugin(ShellFactory.class);

      //
      SshServer server = SshServer.setUpDefaultServer();
      server.setPort(port);
View Full Code Here

    bootstrap.bootstrap();

    //
    if (port != null) {
      try {
        ShellFactory factory = bootstrap.getContext().getPlugin(ShellFactory.class);
        Shell shell = factory.create(null);
        RemoteClient client = new RemoteClient(port, shell);
        log.log(Level.INFO, "Callback back remote on port " + port);
        client.connect();
        client.getRunnable().run();
      }
View Full Code Here

        }
      });

      //
      if (interactive) {
        ShellFactory factory = bootstrap.getContext().getPlugin(ShellFactory.class);
        shell = factory.create(null);
      } else {
        shell = null;
      }
      closeable = null;
    }
View Full Code Here

    //
    SpringBootstrap bootstrap = context.getBean(SpringBootstrap.class);

    // Test a bit
    ShellFactory factory = bootstrap.getContext().getPlugin(ShellFactory.class);
    Shell shell = factory.create(null);
    assertNotNull(shell);
    ShellProcess process = shell.createProcess("foo_cmd");
    assertNotNull(process);
    BaseProcessContext pc = BaseProcessContext.create(process).execute();
    assertTrue(pc.getResponse() instanceof ShellResponse.Ok);
View Full Code Here

    catch (IOException e) {
      log.log(Level.FINE, "Could not read cron file", e);
    }

    //
    ShellFactory factory = getContext().getPlugin(ShellFactory.class);
    TaskTable table = new TaskTable();
    for (String cronLine : lines) {
      CRaSHTaskDef crshTask = validateAndParseCronLine(cronLine);
      if (crshTask != null) {
        table.add(crshTask.getSchedullingPattern(), new CRaSHTask(this, factory, crshTask));
View Full Code Here

TOP

Related Classes of org.crsh.shell.ShellFactory

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.