Package org.crsh.lang.impl.groovy.command

Examples of org.crsh.lang.impl.groovy.command.GroovyScript


  }

  @Override
  public void init(ShellSession session) {
    try {
      GroovyScript login = getLifeCycle(session, "login");
      if (login != null) {
        login.setBinding(new Binding(session));
        login.run();
      }
    }
    catch (CommandException e) {
      e.printStackTrace();
    }
View Full Code Here


  }

  @Override
  public void destroy(ShellSession session) {
    try {
      GroovyScript logout = getLifeCycle(session, "logout");
      if (logout != null) {
        logout.setBinding(new Binding(session));
        logout.run();
      }
    }
    catch (CommandException e) {
      e.printStackTrace();
    }
View Full Code Here

  public GroovyScript getLifeCycle(ShellSession session, String name) throws CommandException, NullPointerException {
    TimestampedObject<Class<? extends GroovyScript>> ref = scriptCache.getClass(name);
    if (ref != null) {
      Class<? extends GroovyScript> scriptClass = ref.getObject();
      GroovyScript script = (GroovyScript)InvokerHelper.createScript(scriptClass, new Binding(session));
      script.setBinding(new Binding(session));
      return script;
    } else {
      return null;
    }
  }
View Full Code Here

TOP

Related Classes of org.crsh.lang.impl.groovy.command.GroovyScript

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.