001 package org.crsh.shell.impl.remoting; 002 003 import org.crsh.shell.Shell; 004 import org.crsh.util.AbstractSocketServer; 005 006 import java.io.IOException; 007 import java.io.InputStream; 008 import java.io.OutputStream; 009 010 /** @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a> */ 011 public class RemoteServer extends AbstractSocketServer { 012 013 /** . */ 014 private ServerAutomaton automaton; 015 016 public RemoteServer(int bindingPort) { 017 super(bindingPort); 018 } 019 020 @Override 021 protected void handle(InputStream in, OutputStream out) throws IOException { 022 this.automaton = new ServerAutomaton(in, out).addCloseListener(this); 023 } 024 025 public Shell getShell() { 026 return automaton; 027 } 028 }