001 package org.crsh.shell.impl.command;
002
003 import org.crsh.plugin.CRaSHPlugin;
004 import org.crsh.plugin.PluginContext;
005 import org.crsh.shell.Shell;
006 import org.crsh.shell.ShellFactory;
007
008 import java.security.Principal;
009
010 /** @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a> */
011 public class CRaSHShellFactory extends CRaSHPlugin<ShellFactory> implements ShellFactory {
012
013 /** . */
014 private CRaSH crash;
015
016 public CRaSHShellFactory() {
017 }
018
019 @Override
020 public void init() {
021 PluginContext context = getContext();
022 crash = new CRaSH(context);
023 }
024
025 @Override
026 public ShellFactory getImplementation() {
027 return this;
028 }
029
030 public Shell create(Principal principal) {
031 return crash.createSession(principal);
032 }
033 }