Package org.drools.util

Examples of org.drools.util.CompositeClassLoader


        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


        }

        //Run Test Scenario
        try {
            AuditLogReporter logger = new AuditLogReporter(workingMemory);
            CompositeClassLoader classLoader = ((InternalRuleBase) ruleBase).getRootClassLoader();
            StringBuilder buf = new StringBuilder();
            AssetItemIterator it = item.listAssetsByFormat(AssetFormats.DRL_MODEL);
            while (it.hasNext()) {
                AssetItem as = it.next();
                buf.append(as.getContent());
View Full Code Here

                   
                    Set<KnowledgeDefinition> kdefs = getKnowledgeDefinitions( entry, newPackage );

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

                    JavaDialectRuntimeData.TypeDeclarationClassLoader tdClassLoader = (JavaDialectRuntimeData.TypeDeclarationClassLoader)
                            ((AbstractRuleBase) ((KnowledgeBaseImpl) this.kbase).ruleBase).getTypeDeclarationClassLoader();

                    JavaDialectRuntimeData jdata = (JavaDialectRuntimeData) newPackage.pkg.getDialectRuntimeRegistry().getDialectData( "java" );
View Full Code Here

        InternalRuleBase ruleBase = ((InternalRuleBase) workingMemory.getRuleBase());
        if ( MemoryUtil.permGenStats.isUsageThresholdExceeded(ruleBase.getConfiguration().getPermGenThreshold()) ) {
            return;
        }

        CompositeClassLoader classLoader = ruleBase.getRootClassLoader();
        if (analyzedCondition == null) {
            analyzedCondition = ((MvelConditionEvaluator) conditionEvaluator).getAnalyzedCondition(object, workingMemory, leftTuple);
        }
        try {
            conditionEvaluator = ASMConditionEvaluatorJitter.jitEvaluator(expression, analyzedCondition, declarations, classLoader, leftTuple);
View Full Code Here

        public Class<?> loadClass( final String name,
                final boolean resolve ) throws ClassNotFoundException {
            Class<?> cls = fastFindClass( name );

            if (cls == null) {
                final CompositeClassLoader parent = (CompositeClassLoader) getParent();
                cls = parent.loadClass( name,
                                        resolve,
                                        this );
            }

            if (cls == null) {
View Full Code Here

        }
        return null;
    }

    static CompositeClassLoader getCompositeClassLoader(final Object obj, final WorkingMemory workingMemory) {
        CompositeClassLoader classLoader = getCompositeClassLoader(obj); // Try to use the same ClassLoader used for the stub
        if (classLoader == null) {
            classLoader = ((AbstractRuleBase)workingMemory.getRuleBase()).getRootClassLoader();
        }
        return classLoader;
    }
View Full Code Here

        return classLoader;
    }

    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));
    }
View Full Code Here

        public Class< ? > loadClass(final String name,
                                    final boolean resolve) throws ClassNotFoundException {
            Class< ? > cls = fastFindClass( name );
           
            if ( cls == null ) {
                final CompositeClassLoader parent = ( CompositeClassLoader ) getParent();
                cls = parent.loadClass( name, resolve, this );
            }
           
            if ( cls == null ) {
                throw new ClassNotFoundException("Unable to load class: " + name);
            }
View Full Code Here

        InternalRuleBase ruleBase = ((InternalRuleBase) workingMemory.getRuleBase());
        if ( MemoryUtil.permGenStats.isUsageThresholdExceeded(ruleBase.getConfiguration().getPermGenThreshold()) ) {
            return;
        }

        CompositeClassLoader classLoader = ruleBase.getRootClassLoader();
        if (analyzedCondition == null) {
            analyzedCondition = ((MvelConditionEvaluator) conditionEvaluator).getAnalyzedCondition(object, workingMemory, leftTuple);
        }
        try {
            conditionEvaluator = ASMConditionEvaluatorJitter.jitEvaluator(expression, analyzedCondition, declarations, classLoader, leftTuple);
View Full Code Here

                   
                    Set<KnowledgeDefinition> kdefs = getKnowledgeDefinitions( entry, newPackage );

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

                    JavaDialectRuntimeData.TypeDeclarationClassLoader tdClassLoader = (JavaDialectRuntimeData.TypeDeclarationClassLoader)
                            ((AbstractRuleBase) ((KnowledgeBaseImpl) this.kbase).ruleBase).getTypeDeclarationClassLoader();

                    JavaDialectRuntimeData jdata = (JavaDialectRuntimeData) newPackage.pkg.getDialectRuntimeRegistry().getDialectData( "java" );
View Full Code Here

TOP

Related Classes of org.drools.util.CompositeClassLoader

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.