001 package org.crsh.shell.impl;
002
003 import groovy.lang.Script;
004 import org.crsh.command.GroovyScriptCommand;
005 import org.crsh.command.ShellCommand;
006 import org.crsh.plugin.PluginContext;
007 import org.crsh.plugin.ResourceKind;
008
009 /** @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a> */
010 public class CRaSH {
011
012
013 /** . */
014 final ClassManager<ShellCommand> commands;
015
016 /** . */
017 final ClassManager<Script> lifecycles;
018
019 /** . */
020 final PluginContext context;
021
022 public CRaSH(PluginContext context) {
023 this.context = context;
024 this.commands = new ClassManager<ShellCommand>(context, ResourceKind.COMMAND, ShellCommand.class, GroovyScriptCommand.class);
025 this.lifecycles = new ClassManager<Script>(context, ResourceKind.LIFECYCLE, Script.class, Script.class);
026 }
027
028 public CRaSHSession createSession() {
029 return new CRaSHSession(this);
030 }
031 }