home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1998 January / PCO0198.ISO / browser / net_linx / jae40.jar / sun / rmi / server / MarshalInputStream.class (.txt) < prev    next >
Encoding:
Java Class File  |  1997-11-03  |  1.5 KB  |  50 lines

  1. package sun.rmi.server;
  2.  
  3. import java.io.IOException;
  4. import java.io.InputStream;
  5. import java.io.ObjectInputStream;
  6. import java.io.ObjectStreamClass;
  7. import java.io.StreamCorruptedException;
  8. import java.net.MalformedURLException;
  9. import java.net.URL;
  10. import netscape.applet.AppletClassLoader;
  11. import sun.rmi.transport.Utils;
  12.  
  13. public class MarshalInputStream extends ObjectInputStream {
  14.    private static boolean codebaseonly = Utils.getBoolean("java.rmi.server.useCodebaseOnly");
  15.  
  16.    public MarshalInputStream(InputStream var1) throws IOException, StreamCorruptedException {
  17.       super(var1);
  18.    }
  19.  
  20.    protected Class resolveClass(ObjectStreamClass var1) throws IOException, ClassNotFoundException {
  21.       Object var2 = ((ObjectInputStream)this).readObject();
  22.  
  23.       try {
  24.          return super.resolveClass(var1);
  25.       } catch (ClassNotFoundException var9) {
  26.          String var4 = var1.getName();
  27.          Object var5 = null;
  28.          Object var6 = null;
  29.  
  30.          try {
  31.             if (!codebaseonly && var2 != null && var2 instanceof String) {
  32.                String var11 = (String)var2;
  33.                URL var7 = new URL(var11);
  34.                var10 = RMIClassLoader.getClassLoader(var7);
  35.             } else {
  36.                var10 = RMIClassLoader.getLocalLoader();
  37.             }
  38.          } catch (MalformedURLException var8) {
  39.             throw new IOException("Malformed URL " + var6);
  40.          }
  41.  
  42.          if (var10 != null) {
  43.             return ((AppletClassLoader)var10).loadClass(var4);
  44.          } else {
  45.             throw var9;
  46.          }
  47.       }
  48.    }
  49. }
  50.