home *** CD-ROM | disk | FTP | other *** search
- package sun.rmi.transport.tcp;
-
- import java.util.Vector;
- import sun.rmi.transport.Connection;
- import sun.rmi.transport.RMIThread;
-
- class ConnectionAcceptor implements Runnable {
- private TCPTransport transport;
- private Vector queue = new Vector(4);
- private static int threadNum;
-
- public ConnectionAcceptor(TCPTransport var1) {
- this.transport = var1;
- }
-
- public void startNewAcceptor() {
- Thread var1 = RMIThread.newThread(this, "Multiplex Accept-" + ++threadNum, true);
- var1.start();
- }
-
- public void accept(Connection var1) {
- Vector var2 = this.queue;
- synchronized(var2){}
-
- try {
- this.queue.addElement(var1);
- this.queue.notify();
- } catch (Throwable var4) {
- throw var4;
- }
-
- }
-
- public void run() {
- Vector var2 = this.queue;
- synchronized(var2){}
-
- Connection var1;
- try {
- while(this.queue.size() == 0) {
- try {
- this.queue.wait();
- } catch (InterruptedException var5) {
- }
- }
-
- this.startNewAcceptor();
- var1 = (Connection)this.queue.elementAt(0);
- this.queue.removeElementAt(0);
- } catch (Throwable var6) {
- throw var6;
- }
-
- this.transport.handleMessages(var1, true);
- }
- }
-