use of org.drools.core.common.ClassAwareObjectStore in project drools by kiegroup.
the class KieBaseUpdater method clearInstancesOfModifiedClass.
protected void clearInstancesOfModifiedClass(Class<?> cls) {
// remove all ObjectTypeNodes for the modified classes
ClassObjectType objectType = new ClassObjectType(cls);
for (EntryPointNode epn : ctx.kBase.getRete().getEntryPointNodes().values()) {
epn.removeObjectType(objectType);
}
// remove all instance of the old class from the object stores
for (InternalWorkingMemory wm : ctx.kBase.getWorkingMemories()) {
for (EntryPoint ep : wm.getEntryPoints()) {
InternalWorkingMemoryEntryPoint wmEp = (InternalWorkingMemoryEntryPoint) wm.getWorkingMemoryEntryPoint(ep.getEntryPointId());
ClassAwareObjectStore store = ((ClassAwareObjectStore) wmEp.getObjectStore());
if (store.clearClassStore(cls)) {
log.warn("Class " + cls.getName() + " has been modified and therfore its old instances will no longer match");
}
}
}
}
Aggregations