KnowledgePackageImp newPackage = (KnowledgePackageImp) pkage;
Set<KnowledgeDefinition> kdefs = getKnowledgeDefinitions( entry, newPackage );
KnowledgePackageImp oldPackage = (KnowledgePackageImp) this.kbase.getKnowledgePackage( newPackage.getName() );
AbstractRuleBase abstractRuleBase = (AbstractRuleBase) ((KnowledgeBaseImpl) this.kbase).ruleBase;
CompositeClassLoader rootClassLoader = abstractRuleBase.getRootClassLoader();
JavaDialectRuntimeData.TypeDeclarationClassLoader tdClassLoader = (JavaDialectRuntimeData.TypeDeclarationClassLoader)
((AbstractRuleBase) ((KnowledgeBaseImpl) this.kbase).ruleBase).getTypeDeclarationClassLoader();
newPackage.pkg.getDialectRuntimeRegistry().onAdd( rootClassLoader );
newPackage.pkg.getDialectRuntimeRegistry().onBeforeExecute();
newPackage.pkg.getClassFieldAccessorStore().setClassFieldAccessorCache( abstractRuleBase.getClassFieldAccessorCache() );
newPackage.pkg.getClassFieldAccessorStore().wire();
this.listener.debug( "KnowledgeAgent: Diffing: " + entry.getKey() );
ResourceDiffProducer rdp = new BinaryResourceDiffProducerImpl();