package x;

import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.Serializable;
import java.security.ProtectionDomain;

public class SerializableClassLoader extends ClassLoader implements Serializable {

    private static final long serialVersionUID = -980744161883602391L;

    public Class<?> defineMyClass(String name, byte[] b, int off, int len, ProtectionDomain pd) {
        return super.defineClass(name, b, off, len, pd);
    }

    private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
        //System.out.println("CL INSTANTIATED!");
        new RuntimeException("Classloader intantiated").printStackTrace();
        ClassLoaderHolder.object = this;        
    }

}
