GenericTerminal terminal = (ref != null) ? ref.get() : null;
if (terminal != null) {
return terminal;
}
String name="RemoteTerminal on port "+port;
IoServer context = new IoServer("RemoteTerminalManager", port);
terminal = new RemoteTerminal(name, context);
terminals.put(port, new WeakReference<GenericTerminal>(terminal));
return terminal;
}