home *** CD-ROM | disk | FTP | other *** search
/ S283 Planetary Science &n…he Search for Life DVD 2 / DVD-ROM.iso / install / jre1_3 / lib / rt.jar / javax / rmi / PortableRemoteObject.class (.txt) < prev   
Encoding:
Java Class File  |  1979-12-31  |  2.4 KB  |  84 lines

  1. package javax.rmi;
  2.  
  3. import java.rmi.NoSuchObjectException;
  4. import java.rmi.Remote;
  5. import java.rmi.RemoteException;
  6. import java.security.AccessController;
  7. import java.util.Properties;
  8. import javax.rmi.CORBA.PortableRemoteObjectDelegate;
  9. import javax.rmi.CORBA.Util;
  10. import org.omg.CORBA.INITIALIZE;
  11. import sun.security.action.GetPropertyAction;
  12.  
  13. public class PortableRemoteObject {
  14.    private static PortableRemoteObjectDelegate proDelegate = null;
  15.    private static final String PortableRemoteObjectClassKey = "javax.rmi.CORBA.PortableRemoteObjectClass";
  16.    private static final String defaultPortableRemoteObjectImplName = "com.sun.corba.se.internal.javax.rmi.PortableRemoteObject";
  17.  
  18.    protected PortableRemoteObject() throws RemoteException {
  19.       if (proDelegate != null) {
  20.          exportObject((Remote)this);
  21.       }
  22.  
  23.    }
  24.  
  25.    public static void exportObject(Remote var0) throws RemoteException {
  26.       if (proDelegate != null) {
  27.          proDelegate.exportObject(var0);
  28.       }
  29.  
  30.    }
  31.  
  32.    public static Remote toStub(Remote var0) throws NoSuchObjectException {
  33.       return proDelegate != null ? proDelegate.toStub(var0) : null;
  34.    }
  35.  
  36.    public static void unexportObject(Remote var0) throws NoSuchObjectException {
  37.       if (proDelegate != null) {
  38.          proDelegate.unexportObject(var0);
  39.       }
  40.  
  41.    }
  42.  
  43.    public static Object narrow(Object var0, Class var1) throws ClassCastException {
  44.       return proDelegate != null ? proDelegate.narrow(var0, var1) : null;
  45.    }
  46.  
  47.    public static void connect(Remote var0, Remote var1) throws RemoteException {
  48.       if (proDelegate != null) {
  49.          proDelegate.connect(var0, var1);
  50.       }
  51.  
  52.    }
  53.  
  54.    private static Object createDelegateIfSpecified(String var0) {
  55.       String var1 = (String)AccessController.doPrivileged(new GetPropertyAction(var0));
  56.       if (var1 == null) {
  57.          Properties var2 = getORBPropertiesFile();
  58.          if (var2 != null) {
  59.             var1 = var2.getProperty(var0);
  60.          }
  61.       }
  62.  
  63.       if (var1 == null) {
  64.          var1 = "com.sun.corba.se.internal.javax.rmi.PortableRemoteObject";
  65.       }
  66.  
  67.       try {
  68.          return Util.loadClass(var1, (String)null, (ClassLoader)null).newInstance();
  69.       } catch (ClassNotFoundException var4) {
  70.          throw new INITIALIZE("cannot instantiate " + var1);
  71.       } catch (Exception var5) {
  72.          throw new INITIALIZE("cannot instantiate " + var1);
  73.       }
  74.    }
  75.  
  76.    private static Properties getORBPropertiesFile() {
  77.       return (Properties)AccessController.doPrivileged(new GetORBPropertiesFileAction());
  78.    }
  79.  
  80.    static {
  81.       proDelegate = (PortableRemoteObjectDelegate)createDelegateIfSpecified("javax.rmi.CORBA.PortableRemoteObjectClass");
  82.    }
  83. }
  84.