Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package org.drools.impl.adapters;
  
 import  org.kie.api.event.kiebase.KieBaseEventListener;
 import  org.kie.internal.KnowledgeBase;
 
 import java.util.Map;
 import java.util.Set;
 
 import static org.drools.impl.adapters.KnowledgePackageAdapter.adaptKnowledgePackages;
 import static org.drools.impl.adapters.KnowledgePackageAdapter.fromKiePackages;
 import static org.drools.impl.adapters.ProcessAdapter.adaptProcesses;
 import static org.drools.impl.adapters.StatefulKnowledgeSessionAdapter.adaptStatefulKnowledgeSession;
 
 public class KnowledgeBaseAdapter implements org.drools.KnowledgeBase {
 
     public final KnowledgeBase delegate;
 
     private final Map<KnowledgeBaseEventListener, KieBaseEventListener> listeners = new HashMap<KnowledgeBaseEventListener, KieBaseEventListener>();
 
     public KnowledgeBaseAdapter(KnowledgeBase delegate) {
         this. = delegate;
     }
 
     public void addKnowledgePackages(Collection<KnowledgePackagekpackages) {
         .addKnowledgePackages(fromKiePackages(kpackages));
     }
 
         return adaptKnowledgePackages(.getKnowledgePackages());
     }
 
     public KnowledgePackage getKnowledgePackage(String packageName) {
         return new KnowledgePackageAdapter(.getKnowledgePackage(packageName));
     }
 
     public void removeKnowledgePackage(String packageName) {
         .removeKnowledgePackage(packageName);
     }
 
     public Rule getRule(String packageNameString ruleName) {
         return new RuleAdapter(.getRule(packageNameruleName));
     }
 
     public void removeRule(String packageNameString ruleName) {
         .removeRule(packageNameruleName);
     }
 
     public Query getQuery(String packageNameString queryName) {
         return new QueryAdapter(.getQuery(packageNamequeryName));
     }
 
     public void removeQuery(String packageNameString queryName) {
         .removeQuery(packageNamequeryName);
     }
 
     public void removeFunction(String packageNameString ruleName) {
         .removeFunction(packageNameruleName);
     }
 
     public FactType getFactType(String packageNameString typeName) {
         return new FactTypeAdapter(.getFactType(packageNametypeName));
     }
 
     public org.drools.definition.process.Process getProcess(String processId) {
         return new ProcessAdapter(.getProcess(processId));
     }
 
     public void removeProcess(String processId) {
         .removeProcess(processId);
     }
 
     public Collection<ProcessgetProcesses() {
         return adaptProcesses(.getProcesses());
     }
 
         return new StatefulKnowledgeSessionAdapter(.newStatefulKnowledgeSession(((KnowledgeSessionConfigurationAdapter)conf).getDelegate(),
                                                                                         ((EnvironmentAdapter)environment).getDelegate()));
     }
 
         return new StatefulKnowledgeSessionAdapter(.newStatefulKnowledgeSession());
     }
 
         return adaptStatefulKnowledgeSession(.getStatefulKnowledgeSessions());
    }
        return new StatelessKnowledgeSessionAdapter(.newStatelessKnowledgeSession(((KnowledgeSessionConfigurationAdapter)conf).getDelegate()));
    }
        return new StatelessKnowledgeSessionAdapter(.newStatelessKnowledgeSession());
    }
    public Set<StringgetEntryPointIds() {
        return .getEntryPointIds();
    }
    public void addEventListener(KnowledgeBaseEventListener listener) {
        KnowledgeBaseEventListenerAdapter adapted = new KnowledgeBaseEventListenerAdapter(listener);
        .put(listeneradapted);
        .addEventListener(adapted);
    }
    public void removeEventListener(KnowledgeBaseEventListener listener) {
        .removeEventListener(.remove(listener));
    }
        return .keySet();
    }
New to GrepCode? Check out our FAQ X