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();
JavaDialectRuntimeData jdata = (JavaDialectRuntimeData) newPackage.pkg.getDialectRuntimeRegistry().getDialectData( "java" );
Map<String,byte[]> definedClasses = jdata.getClassDefinitions();
for ( String className : definedClasses.keySet() ) {
if ( tdClassLoader.getStore().getClassDefinition( className ) != null ) {
jdata.removeClassDefinition( className );
jdata.getStore().remove( className );
}
}
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();