Package org.crsh.plugin

Examples of org.crsh.plugin.PluginContext


    try {
      URI uri = wsSession.getRequestURI();
      String path = uri.getPath();
      log.fine("Establishing session for " + path);
      String contextPath = path.substring(0, path.lastIndexOf('/'));
      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());
View Full Code Here


        throw new IllegalArgumentException("Wrong root directory argument " + root.getCanonicalPath());
      }
    }
    FS cmdFS = new FS().mount(Thread.currentThread().getContextClassLoader(), Path.get("/crash/commands/"));
    FS confFS = new FS().mount(Thread.currentThread().getContextClassLoader(), Path.get("/crash/"));
    PluginContext ctx = new PluginContext(
      new ServiceLoaderDiscovery(Thread.currentThread().getContextClassLoader()),
      Collections.<String, Object>emptyMap(),
      cmdFS,
      confFS,
      Thread.currentThread().getContextClassLoader());
    ctx.refresh();
    CRaSH crash = new CRaSH(ctx);
    StringBuilder buffer = new StringBuilder();
    for (Map.Entry<String, String> s : crash.getCommands()) {
      Command<?> cmd = crash.getCommand(s.getKey());
      CommandDescriptor<?> desc = cmd.getDescriptor();
View Full Code Here

    return this;
  }

  @Override
  public void init() {
    PluginContext context = getContext();
    this.username = context.getProperty(SIMPLE_USERNAME);
    this.password = context.getProperty(SIMPLE_PASSWORD);
  }
View Full Code Here

      PluginDiscovery discovery = new BeanFactoryFilteringPluginDiscovery(
          this.resourceLoader.getClassLoader(), this.beanFactory,
          this.properties.getDisabledPlugins());

      PluginContext context = new PluginContext(discovery,
          createPluginContextAttributes(), commandFileSystem,
          configurationFileSystem, this.resourceLoader.getClassLoader());

      context.refresh();
      start(context);
    }
View Full Code Here

    this.context.register(SecurityConfiguration.class);
    this.context.register(CrshAutoConfiguration.class);
    this.context.refresh();

    PluginLifeCycle lifeCycle = this.context.getBean(PluginLifeCycle.class);
    PluginContext pluginContext = lifeCycle.getContext();

    int count = 0;
    Iterator<AuthenticationPlugin> plugins = pluginContext.getPlugins(
        AuthenticationPlugin.class).iterator();
    while (plugins.hasNext()) {
      count++;
      plugins.next();
    }
View Full Code Here

    // The service loader discovery
    ServiceLoaderDiscovery discovery = new ServiceLoaderDiscovery(loader);

    //
    PluginContext context = new PluginContext(
      discovery,
      attributes,
      cmdFS,
      confFS,
      loader);

    //
    context.refresh();

    //
    start(context);
  }
View Full Code Here

  public CRaSHShellFactory() {
  }

  @Override
  public void init() {
    PluginContext context = getContext();
    crash = new CRaSH(context);
  }
View Full Code Here

TOP

Related Classes of org.crsh.plugin.PluginContext

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.