// main ..........(SL: now renamed)................................................. public void start() { // EditorServer server ; // // if(args.length == 1) // server = new EditorServer(args[0], "No Name", "No Description") ; // else // server = new EditorServer(null, args[0], args[1]) ; // final EditorServer self = server ; Session editorSession = null; this.textChannel = null; this.textChannelConsumer = null; URLString url = null; String sessionType = null; String hostname = null; int hostport = 0; if (EditorServer_Debug) System.err.println("EditorServer: main."); hostname = "localhost"; hostport = 4461; sessionType = "socket"; url = URLString.createSessionURL(hostname, hostport, sessionType, sessionName); if (EditorServer_Debug) System.err.println("EditorServer: main: url: " + url.toString()); try { /* Registry running? Start it if it isn't. */ if (RegistryFactory.registryExists(sessionType) == false) { RegistryFactory.startRegistry(sessionType); } /* Create a session, [re]bind it and create a channel. */ this.client = new NetworkedClient("Server"); editorSession = SessionFactory.createSession(this.client, url, true); // setup text channel this.textChannel = editorSession.createChannel(this.client, "TextChannel", true, true, true); this.textChannelConsumer = new TextChannelConsumer(this); this.textChannel.addConsumer(this.client, this.textChannelConsumer); // setup client channel this.clientChannel = editorSession.createChannel(this.client, "ClientChannel", true, true, true); this.clientChannelConsumer = new ClientChannelConsumer(this); this.clientChannel.addConsumer(this.client, this.clientChannelConsumer); this.clientChannel.addChannelListener( new ChannelAdaptor() { public void channelConsumerAdded(ChannelEvent event) { self.clientAppeared(); } }); System.err.println("Setup and bound Editor server."); } catch (JSDTException e) { System.err.println("EditorServer: main: shared data exception: " + e); if (EditorServer_Debug) { e.printStackTrace(); } } this.pack(); // on Linux, this seems to be the only way to set JFrame sizes // (i.e. resize it after packing (which seems to defeat the // purpose of packing)!) this.setSize(new Dimension(800, 600)); this.setVisible(true); }