public ClassLoader getClassLoader(CommandExecutor exec) { ClassLoader cl = null; if ( exec instanceof StatefulKnowledgeSessionImpl ) { cl = ((ReteooRuleBase) ((StatefulKnowledgeSessionImpl) exec).getRuleBase()).getRootClassLoader(); } else if ( exec instanceof StatelessKnowledgeSessionImpl ) { cl = ((ReteooRuleBase) ((StatelessKnowledgeSessionImpl) exec).getRuleBase()).getRootClassLoader(); } else if ( exec instanceof CommandBasedStatefulKnowledgeSession ) { cl = ((ReteooRuleBase) ((KnowledgeBaseImpl) ((CommandBasedStatefulKnowledgeSession) exec).getKnowledgeBase()).getRuleBase()).getRootClassLoader(); } return cl; }
public ClassLoader getClassLoader(CommandExecutor exec) { ClassLoader cl = null; if ( exec instanceof StatefulKnowledgeSessionImpl ) { cl = ((ReteooRuleBase) ((StatefulKnowledgeSessionImpl) exec).getRuleBase()).getRootClassLoader(); } else if ( exec instanceof StatelessKnowledgeSessionImpl ) { cl = ((ReteooRuleBase) ((StatelessKnowledgeSessionImpl) exec).getRuleBase()).getRootClassLoader(); } else if ( exec instanceof CommandBasedStatefulKnowledgeSession ) { cl = ((ReteooRuleBase) ((KnowledgeBaseImpl) ((CommandBasedStatefulKnowledgeSession) exec).getKnowledgeBase()).getRuleBase()).getRootClassLoader(); } return cl; }
public WorkingMemoryLogger(final KnowledgeRuntimeEventManager session) { if (session instanceof StatefulKnowledgeSessionImpl) { WorkingMemoryEventManager eventManager = ((StatefulKnowledgeSessionImpl) session).session; eventManager.addEventListener( (WorkingMemoryEventListener) this ); eventManager.addEventListener( (AgendaEventListener) this ); eventManager.addEventListener( (RuleBaseEventListener) this ); InternalProcessRuntime processRuntime = ((StatefulKnowledgeSessionImpl) session).session.getProcessRuntime(); if (processRuntime != null) { processRuntime.addEventListener( (ProcessEventListener) this ); } } else if (session instanceof StatelessKnowledgeSessionImpl) { ((StatelessKnowledgeSessionImpl) session).workingMemoryEventSupport.addEventListener( this ); ((StatelessKnowledgeSessionImpl) session).agendaEventSupport.addEventListener( this ); ((StatelessKnowledgeSessionImpl) session).processEventSupport.addEventListener( this ); ((StatelessKnowledgeSessionImpl) session).getRuleBase().addEventListener( this ); } else if (session instanceof CommandBasedStatefulKnowledgeSession) { ReteooWorkingMemoryInterface eventManager = ((StatefulKnowledgeSessionImpl)((KnowledgeCommandContext)((CommandBasedStatefulKnowledgeSession) session).getCommandService().getContext()).getStatefulKnowledgesession()).session; eventManager.addEventListener( (WorkingMemoryEventListener) this ); eventManager.addEventListener( (AgendaEventListener) this ); InternalProcessRuntime processRuntime = eventManager.getProcessRuntime(); eventManager.addEventListener( (RuleBaseEventListener) this ); if (processRuntime != null) { processRuntime.addEventListener( (ProcessEventListener) this ); } } else { throw new IllegalArgumentException("Not supported session in logger: " + session.getClass()); } }
sksi.getRuleBase().addEventListener((RuleBaseEventListener)el); } else if (el instanceof KnowledgeBaseEventListener) { new KnowledgeBaseImpl(sksi.getRuleBase()).addEventListener((KnowledgeBaseEventListener)el);