use of org.kie.api.event.kiebase.KieBaseEventListener in project drools by kiegroup.
the class StatefulKnowledgeSessionImpl method dispose.
public void dispose() {
alive = false;
if (pool != null) {
pool.release(this);
return;
}
if (!agenda.dispose(this)) {
return;
}
if (logger != null) {
try {
logger.close();
} catch (Exception e) {
/* the logger was already closed, swallow */
}
}
for (WorkingMemoryEntryPoint ep : this.entryPointsManager.getEntryPoints()) {
ep.dispose();
}
for (AsyncReceiveNode.AsyncReceiveMemory receiveMemory : this.receiveNodeMemories) {
receiveMemory.dispose();
}
this.ruleRuntimeEventSupport.clear();
this.ruleEventListenerSupport.clear();
this.agendaEventSupport.clear();
for (KieBaseEventListener listener : kieBaseEventListeners) {
this.kBase.removeEventListener(listener);
}
if (this.processRuntime != null) {
this.processRuntime.dispose();
}
if (this.timerService != null) {
this.timerService.shutdown();
}
if (this.workItemManager != null) {
((org.drools.core.process.instance.WorkItemManager) this.workItemManager).dispose();
}
this.kBase.disposeStatefulSession(this);
if (this.mbeanRegistered.get()) {
DroolsManagementAgent.getInstance().unregisterKnowledgeSessionUnderName(mbeanRegisteredCBSKey, this);
}
}
Aggregations