home *** CD-ROM | disk | FTP | other *** search
- package sun.rmi.transport.proxy;
-
- import java.io.IOException;
- import java.net.Socket;
- import java.rmi.server.RMISocketFactory;
-
- class AsyncConnector implements Runnable {
- protected RMIMasterSocketFactory master;
- protected RMISocketFactory factory;
- protected String host;
- protected int port;
- protected IOException exception;
- protected Socket socket;
- boolean cleanUp = false;
-
- AsyncConnector(RMIMasterSocketFactory var1, RMISocketFactory var2, String var3, int var4) {
- this.master = var1;
- this.factory = var2;
- this.host = var3;
- this.port = var4;
- }
-
- public void run() {
- try {
- Socket var23 = this.factory.createSocket(this.host, this.port);
- synchronized(this){}
-
- try {
- this.socket = var23;
- this.notify();
- } catch (Throwable var20) {
- throw var20;
- }
-
- this.master.rememberFactory(this.host, this.factory);
- synchronized(this){}
-
- try {
- if (this.cleanUp) {
- try {
- this.socket.close();
- } catch (IOException var19) {
- }
- }
- } catch (Throwable var21) {
- throw var21;
- }
-
- } catch (IOException var22) {
- IOException var1 = var22;
- synchronized(this){}
-
- try {
- this.exception = var1;
- this.notify();
- } catch (Throwable var18) {
- throw var18;
- }
-
- }
- }
-
- synchronized IOException getException() {
- return this.exception;
- }
-
- synchronized Socket getSocket() {
- return this.socket;
- }
-
- synchronized void notUsed() {
- if (this.socket != null) {
- try {
- this.socket.close();
- } catch (IOException var1) {
- }
- }
-
- this.cleanUp = true;
- }
- }
-