this.pkgs = (Map) stream.readObject();
if ( stream instanceof DroolsObjectInputStream ) {
final DroolsObjectInputStream parentStream = (DroolsObjectInputStream) stream;
parentStream.setRuleBase( this );
this.packageClassLoader = new CompositePackageClassLoader( parentStream.getClassLoader() );
this.classLoader = new MapBackedClassLoader( parentStream.getClassLoader() );
} else {
this.packageClassLoader = new CompositePackageClassLoader( Thread.currentThread().getContextClassLoader() );
this.classLoader = new MapBackedClassLoader( Thread.currentThread().getContextClassLoader() );
}
this.packageClassLoader.addClassLoader( this.classLoader );
this.objenesis = createObjenesis();