1 package org.apache.turbine.util.pool; 2 3 18 19 import java.io.IOException ; 20 import java.io.InputStream ; 21 import java.io.ObjectInputStream ; 22 import java.io.ObjectStreamClass ; 23 24 30 public class ObjectInputStreamForContext extends ObjectInputStream 31 { 32 35 private ClassLoader classLoader; 36 37 44 public ObjectInputStreamForContext(InputStream in, 45 ClassLoader loader) 46 throws IOException 47 { 48 super(in); 49 classLoader = loader; 50 } 51 52 protected Class resolveClass(ObjectStreamClass v) 53 throws IOException , 54 ClassNotFoundException 55 { 56 return classLoader == null ? 57 super.resolveClass(v) : classLoader.loadClass(v.getName()); 58 } 59 } 60 | Popular Tags |