Package org.drools.common

Examples of org.drools.common.AbstractRuleBase


                    }
                    continue;
                }

                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


        }               
       
    }

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

        boolean needsWrapping = ! ( core instanceof TraitableBean );

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

        ClassLoader cl = null;

        try {
            if ( item.isBinaryUpToDate() && ServiceImplementation.ruleBaseCache.containsKey( item.getUUID() ) ) {
                RuleBase rb = ServiceImplementation.ruleBaseCache.get( item.getUUID() );
                AbstractRuleBase arb = (AbstractRuleBase) rb;
                // load up the existing class loader from before
                cl = arb.getConfiguration().getClassLoader();
                Thread.currentThread().setContextClassLoader( cl );
            } else {
                // load up the classloader we are going to use
                List<JarInputStream> jars = BRMSPackageBuilder.getJars( item );
                cl = BRMSPackageBuilder.createClassLoader( jars );
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

        ClassLoader cl = null;

        try {
            if ( item.isBinaryUpToDate() && this.ruleBaseCache.containsKey( item.getUUID() ) ) {
                RuleBase rb = this.ruleBaseCache.get( item.getUUID() );
                AbstractRuleBase arb = (AbstractRuleBase) rb;
                // load up the existing class loader from before
                cl = arb.getConfiguration().getClassLoader();
                Thread.currentThread().setContextClassLoader( cl );
            } else {
                // load up the classloader we are going to use
                List<JarInputStream> jars = BRMSPackageBuilder.getJars( item );
                cl = BRMSPackageBuilder.createClassLoader( jars );
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

                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

TOP

Related Classes of org.drools.common.AbstractRuleBase

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.