home *** CD-ROM | disk | FTP | other *** search
- package javax.rmi;
-
- import java.rmi.NoSuchObjectException;
- import java.rmi.Remote;
- import java.rmi.RemoteException;
- import java.security.AccessController;
- import java.util.Properties;
- import javax.rmi.CORBA.PortableRemoteObjectDelegate;
- import javax.rmi.CORBA.Util;
- import org.omg.CORBA.INITIALIZE;
- import sun.security.action.GetPropertyAction;
-
- public class PortableRemoteObject {
- private static PortableRemoteObjectDelegate proDelegate = null;
- private static final String PortableRemoteObjectClassKey = "javax.rmi.CORBA.PortableRemoteObjectClass";
- private static final String defaultPortableRemoteObjectImplName = "com.sun.corba.se.internal.javax.rmi.PortableRemoteObject";
-
- protected PortableRemoteObject() throws RemoteException {
- if (proDelegate != null) {
- exportObject((Remote)this);
- }
-
- }
-
- public static void exportObject(Remote var0) throws RemoteException {
- if (proDelegate != null) {
- proDelegate.exportObject(var0);
- }
-
- }
-
- public static Remote toStub(Remote var0) throws NoSuchObjectException {
- return proDelegate != null ? proDelegate.toStub(var0) : null;
- }
-
- public static void unexportObject(Remote var0) throws NoSuchObjectException {
- if (proDelegate != null) {
- proDelegate.unexportObject(var0);
- }
-
- }
-
- public static Object narrow(Object var0, Class var1) throws ClassCastException {
- return proDelegate != null ? proDelegate.narrow(var0, var1) : null;
- }
-
- public static void connect(Remote var0, Remote var1) throws RemoteException {
- if (proDelegate != null) {
- proDelegate.connect(var0, var1);
- }
-
- }
-
- private static Object createDelegateIfSpecified(String var0) {
- String var1 = (String)AccessController.doPrivileged(new GetPropertyAction(var0));
- if (var1 == null) {
- Properties var2 = getORBPropertiesFile();
- if (var2 != null) {
- var1 = var2.getProperty(var0);
- }
- }
-
- if (var1 == null) {
- var1 = "com.sun.corba.se.internal.javax.rmi.PortableRemoteObject";
- }
-
- try {
- return Util.loadClass(var1, (String)null, (ClassLoader)null).newInstance();
- } catch (ClassNotFoundException var4) {
- throw new INITIALIZE("cannot instantiate " + var1);
- } catch (Exception var5) {
- throw new INITIALIZE("cannot instantiate " + var1);
- }
- }
-
- private static Properties getORBPropertiesFile() {
- return (Properties)AccessController.doPrivileged(new GetORBPropertiesFileAction());
- }
-
- static {
- proDelegate = (PortableRemoteObjectDelegate)createDelegateIfSpecified("javax.rmi.CORBA.PortableRemoteObjectClass");
- }
- }
-