示例#1
0
 static TypeResolver getTypeResolver(
     final InvokerStub stub,
     final WorkingMemory workingMemory,
     final CompositeClassLoader classLoader) {
   org.drools.rule.Package pkg = workingMemory.getRuleBase().getPackage(stub.getPackageName());
   TypeResolver typeResolver = pkg == null ? null : pkg.getTypeResolver();
   if (typeResolver == null) {
     Set<String> imports = new HashSet<String>();
     for (String imp : stub.getPackageImports()) {
       imports.add(imp);
     }
     typeResolver = new ClassTypeResolver(imports, classLoader, stub.getPackageName());
   }
   return typeResolver;
 }
示例#2
0
 static ClassGenerator createInvokerClassGenerator(
     final InvokerStub stub, final WorkingMemory workingMemory) {
   String className = stub.getPackageName() + "." + stub.getGeneratedInvokerClassName();
   CompositeClassLoader classLoader = getCompositeClassLoader(stub, workingMemory);
   return createInvokerClassGenerator(
       className, stub, classLoader, getTypeResolver(stub, workingMemory, classLoader));
 }