FileDocCategorySizeDatePackage
CustomObjectInputStream.javaAPI DocGlassfish v2 API3732Fri May 04 22:32:30 BST 2007org.apache.catalina.util

CustomObjectInputStream

public final class CustomObjectInputStream extends ObjectInputStream
Custom subclass of ObjectInputStream that loads from the class loader for this web application. This allows classes defined only with the web application to be found correctly.
author
Craig R. McClanahan
author
Bip Thelin
version
$Revision: 1.3 $, $Date: 2007/05/05 05:32:30 $

Fields Summary
private ClassLoader
classLoader
The class loader we will use to resolve classes.
Constructors Summary
public CustomObjectInputStream(InputStream stream, ClassLoader classLoader)
Construct a new instance of CustomObjectInputStream

param
stream The input stream we will read from
param
classLoader The class loader used to instantiate objects
exception
IOException if an input/output error occurs



                                        
      
                                    
          

        super(stream);
        this.classLoader = classLoader;
    
Methods Summary
public java.lang.ClassresolveClass(java.io.ObjectStreamClass classDesc)
Load the local class equivalent of the specified stream class description, by using the class loader assigned to this Context.

param
classDesc Class description from the input stream
exception
ClassNotFoundException if this class cannot be found
exception
IOException if an input/output error occurs

        return Class.forName(classDesc.getName(), false, classLoader);