1 26 27 28 package org.objectweb.mobilitools.smi; 29 30 31 import java.io.*; 32 import org.omg.CfMAF.MAFAgentSystem; 33 import org.omg.CfMAF.AgentProfile; 34 35 36 42 public class SMIObjectInputStream extends ObjectInputStream 43 { 44 ClassLoader my_loader; 45 46 47 public SMIObjectInputStream( 48 InputStream stream, 49 ClassLoader loader) 50 throws StreamCorruptedException, IOException 51 { 52 super(stream); 53 my_loader = loader; 54 } 55 56 57 public SMIObjectInputStream( 58 InputStream stream, 59 String codebase, 60 AgentProfile profile, 61 MAFAgentSystem provider) 62 throws StreamCorruptedException, IOException 63 { 64 super(stream); 65 my_loader = Misc.getClassLoader( 66 Thread.currentThread().getContextClassLoader(), 67 codebase, 68 profile, 69 provider); 70 } 71 72 73 protected Class resolveClass (ObjectStreamClass classDesc) 74 throws IOException, ClassNotFoundException 75 { 76 try 77 { 78 return super.resolveClass(classDesc); 79 } 80 catch (ClassNotFoundException e) 81 { 82 return my_loader.loadClass(classDesc.getName()); 83 } 84 } 85 } 86 | Popular Tags |