Package org.drools.common

Examples of org.drools.common.AbstractRuleBase$TypeDeclarationCandidate


        new ConnectionImpl(
            compositeNode, Node.CONNECTION_DEFAULT_TYPE,
            endNode, Node.CONNECTION_DEFAULT_TYPE
        );
       
        AbstractRuleBase ruleBase = (AbstractRuleBase) RuleBaseFactory.newRuleBase();
        ruleBase.addProcess(process);
        InternalWorkingMemory workingMemory = new ReteooWorkingMemory(1, ruleBase);
        ProcessInstance processInstance = workingMemory.startProcess("org.drools.process.event");
        assertEquals(0, myList.size());
        Person jack = new Person();
        jack.setName("Jack");
View Full Code Here


                    KnowledgePackageImp newPackage = (KnowledgePackageImp) pkage;
                   
                    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();

                    newPackage.pkg.getDialectRuntimeRegistry().onAdd( rootClassLoader );
                    newPackage.pkg.getDialectRuntimeRegistry().onBeforeExecute();
                    newPackage.pkg.getClassFieldAccessorStore().setClassFieldAccessorCache( abstractRuleBase.getClassFieldAccessorCache() );
                    newPackage.pkg.getClassFieldAccessorStore().wire();

                    this.listener.debug( "KnowledgeAgent: Diffing: " + entry.getKey() );

                    ResourceDiffProducer rdp = new BinaryResourceDiffProducerImpl();
View Full Code Here

        ClassLoader classloader = null;

        try {
            if ( packageItem.isBinaryUpToDate() && RuleBaseCache.getInstance().contains( packageItem.getUUID() ) ) {

                AbstractRuleBase arb = (AbstractRuleBase) RuleBaseCache.getInstance().get( packageItem.getUUID() );
                // load up the existing class loader from before
                classloader = arb.getConfiguration().getClassLoader();
                Thread.currentThread().setContextClassLoader( classloader );
            } else {
                // load up the classloader we are going to use
                ClassLoaderBuilder classLoaderBuilder = new ClassLoaderBuilder( packageItem.listAssetsWithVersionsSpecifiedByDependenciesByFormat( AssetFormats.MODEL ) );
                classloader = classLoaderBuilder.buildClassLoader();
View Full Code Here

                    KnowledgePackageImp newPackage = (KnowledgePackageImp) pkage;
                   
                    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();

                    newPackage.pkg.getDialectRuntimeRegistry().onAdd( rootClassLoader );
                    newPackage.pkg.getDialectRuntimeRegistry().onBeforeExecute();
                    newPackage.pkg.getClassFieldAccessorStore().setClassFieldAccessorCache( abstractRuleBase.getClassFieldAccessorCache() );
                    newPackage.pkg.getClassFieldAccessorStore().wire();

                    this.listener.debug( "KnowledgeAgent: Diffing: " + entry.getKey() );

                    ResourceDiffProducer rdp = new BinaryResourceDiffProducerImpl();
View Full Code Here

        }

    }

    public static TraitFactory getTraitBuilderForKnowledgeBase( KnowledgeBase kb ) {
        AbstractRuleBase arb = (AbstractRuleBase) ((KnowledgeBaseImpl) kb ).getRuleBase();
        return arb.getConfiguration().getComponentFactory().getTraitFactory();
    }
View Full Code Here

        }

    }

    public static TraitFactory getTraitBuilderForKnowledgeBase( KnowledgeBase kb ) {
        AbstractRuleBase arb = (AbstractRuleBase) ((KnowledgeBaseImpl) kb ).getRuleBase();
        return arb.getConfiguration().getComponentFactory().getTraitFactory();
    }
View Full Code Here

        }               
       
    }

    protected <T, K> T applyTrait( K core, Class<T> trait, boolean logical ) {
        AbstractRuleBase arb = (AbstractRuleBase) ((KnowledgeBaseImpl) this.getKnowledgeRuntime().getKnowledgeBase() ).getRuleBase();
        TraitFactory builder = arb.getConfiguration().getComponentFactory().getTraitFactory();

        boolean needsWrapping = ! ( core instanceof TraitableBean );

        TraitableBean inner = needsWrapping ? asTraitable( core, builder ) : (TraitableBean) core;
        if ( needsWrapping ) {
View Full Code Here

                for ( KnowledgePackage pkage : newPackages ) {

                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();

                this.listener.debug( "KnowledgeAgent: Diffing: " + entry.getKey() );

                ResourceDiffProducer rdp = new BinaryResourceDiffProducerImpl();
View Full Code Here

        ClassLoader classloader = null;

        try {
            if ( packageItem.isBinaryUpToDate() && RuleBaseCache.getInstance().contains( packageItem.getUUID() ) ) {

                AbstractRuleBase arb = (AbstractRuleBase) RuleBaseCache.getInstance().get( packageItem.getUUID() );
                // load up the existing class loader from before
                classloader = arb.getConfiguration().getClassLoader();
                Thread.currentThread().setContextClassLoader( classloader );
            } else {
                // load up the classloader we are going to use
                ClassLoaderBuilder classLoaderBuilder = new ClassLoaderBuilder( packageItem.listAssetsWithVersionsSpecifiedByDependenciesByFormat( AssetFormats.MODEL ) );
                classloader = classLoaderBuilder.buildClassLoader();
View Full Code Here

                    KnowledgePackageImp newPackage = (KnowledgePackageImp) pkage;
                   
                    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();

                    newPackage.pkg.getDialectRuntimeRegistry().onAdd( rootClassLoader );
                    newPackage.pkg.getDialectRuntimeRegistry().onBeforeExecute();
                    newPackage.pkg.getClassFieldAccessorStore().setClassFieldAccessorCache( abstractRuleBase.getClassFieldAccessorCache() );
                    newPackage.pkg.getClassFieldAccessorStore().wire();

                    this.listener.debug( "KnowledgeAgent: Diffing: " + entry.getKey() );

                    ResourceDiffProducer rdp = new BinaryResourceDiffProducerImpl();
View Full Code Here

TOP

Related Classes of org.drools.common.AbstractRuleBase$TypeDeclarationCandidate

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.