Package org.drools.util

Examples of org.drools.util.CompositeClassLoader$Loader


        if (!jitted) {
            if (conditionEvaluator == null) {
                conditionEvaluator = new MvelConditionEvaluator(getParserConfiguration(workingMemory), expression, operator);
            } else {
                if (isJittable && invocationCounter.getAndIncrement() == JIT_THRESOLD) {
                    CompositeClassLoader classLoader = ((AbstractRuleBase)workingMemory.getRuleBase()).getRootClassLoader();
                    conditionEvaluator = ASMConditionEvaluatorJitter.jit(((MvelConditionEvaluator)conditionEvaluator).getExecutableStatement(), classLoader);
                    jitted = true;
                }
            }
        }
View Full Code Here


            } catch (ClassCastException cce) {
                System.out.println("Got ClassCastException: " + cce);
                mvelValue = false;
            }
            try {
                CompositeClassLoader classLoader = ((AbstractRuleBase)workingMemory.getRuleBase()).getRootClassLoader();
                conditionEvaluator = ASMConditionEvaluatorJitter.jit(((MvelConditionEvaluator)conditionEvaluator).getExecutableStatement(), classLoader);
            } catch (Throwable t) {
                throw new RuntimeException("Exception jitting: " + expression, t);
            }
        }
View Full Code Here

                KnowledgePackageImp newPackage = (KnowledgePackageImp) pkage;

                KnowledgePackageImp oldPackage = (KnowledgePackageImp) this.kbase.getKnowledgePackage( newPackage.getName() );
                AbstractRuleBase abstractRuleBase = (AbstractRuleBase)((KnowledgeBaseImpl)this.kbase).ruleBase;
                CompositeClassLoader rootClassLoader = abstractRuleBase.getRootClassLoader();

                newPackage.pkg.getDialectRuntimeRegistry().onAdd( rootClassLoader );
                newPackage.pkg.getDialectRuntimeRegistry().onBeforeExecute();
                newPackage.pkg.getClassFieldAccessorStore().setClassFieldAccessorCache( abstractRuleBase.getClassFieldAccessorCache());
                newPackage.pkg.getClassFieldAccessorStore().wire();
View Full Code Here

    }

    private void jitEvaluator(InternalWorkingMemory workingMemory, Object object, Map<String, Object> vars) {
        jitted = true;
        try {
            CompositeClassLoader classLoader = ((AbstractRuleBase)workingMemory.getRuleBase()).getRootClassLoader();
            if (analyzedCondition == null) {
                analyzedCondition = ((MvelConditionEvaluator) conditionEvaluator).getAnalyzedCondition(object, vars);
            }
            conditionEvaluator = ASMConditionEvaluatorJitter.jit(analyzedCondition, classLoader);
        } catch (Throwable t) {
View Full Code Here

        assertEquals( "org.test.NewBean",
                      type.getTypeClass().getName() );
        assertFalse( builder.hasErrors() );

        Package bp = builder.getPackage();
        CompositeClassLoader rootClassloader = ClassLoaderUtil.getClassLoader( new ClassLoader[]{Thread.currentThread().getContextClassLoader()},
                                                                               getClass(),
                                                                               false );
        JavaDialectRuntimeData dialectData = (JavaDialectRuntimeData) bp.getDialectRuntimeRegistry().getDialectData( "java" );
        dialectData.onAdd( bp.getDialectRuntimeRegistry(),
                           rootClassloader );

        Class newBean = rootClassloader.loadClass( "org.test.NewBean" );
        assertNotNull( newBean );
    }
View Full Code Here

        assertEquals( "org.test.NewBean",
                      type.getTypeClass().getName() );
        assertFalse( builder.hasErrors() );

        Package bp = builder.getPackage();
        CompositeClassLoader rootClassloader = ClassLoaderUtil.getClassLoader( new ClassLoader[]{Thread.currentThread().getContextClassLoader()},
                                                                               getClass(),
                                                                               false );
        JavaDialectRuntimeData dialectData = (JavaDialectRuntimeData) bp.getDialectRuntimeRegistry().getDialectData( "java" );
        dialectData.onAdd( bp.getDialectRuntimeRegistry(),
                           rootClassloader );

        Class newBean = rootClassloader.loadClass( "org.test.NewBean" );
        assertNotNull( newBean );
    }
View Full Code Here

                KnowledgePackageImp newPackage = (KnowledgePackageImp) pkage;

                KnowledgePackageImp oldPackage = (KnowledgePackageImp) this.kbase.getKnowledgePackage( newPackage.getName() );
                AbstractRuleBase abstractRuleBase = (AbstractRuleBase)((KnowledgeBaseImpl)this.kbase).ruleBase;
                CompositeClassLoader rootClassLoader = abstractRuleBase.getRootClassLoader();

                newPackage.pkg.getDialectRuntimeRegistry().onAdd( rootClassLoader );
                newPackage.pkg.getDialectRuntimeRegistry().onBeforeExecute();
                newPackage.pkg.getClassFieldAccessorStore().setClassFieldAccessorCache( abstractRuleBase.getClassFieldAccessorCache());
                newPackage.pkg.getClassFieldAccessorStore().wire();
View Full Code Here

    private static class ExecutorHolder {
        private static final Executor executor = ExecutorProviderFactory.getExecutorProvider().getExecutor();
    }

    private void executeJitting(Object object, InternalWorkingMemory workingMemory, LeftTuple leftTuple) {
        CompositeClassLoader classLoader = ((AbstractRuleBase)workingMemory.getRuleBase()).getRootClassLoader();
        if (analyzedCondition == null) {
            analyzedCondition = ((MvelConditionEvaluator) conditionEvaluator).getAnalyzedCondition(object, workingMemory, leftTuple);
        }
        conditionEvaluator = ASMConditionEvaluatorJitter.jitEvaluator(expression, analyzedCondition, declarations, classLoader, leftTuple);
    }
View Full Code Here

TOP

Related Classes of org.drools.util.CompositeClassLoader$Loader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.