Package org.drools.rule

Examples of org.drools.rule.PackageCompilationData


                lock();
                doUnlock = true;
            }
            this.removalsSinceLock++;

            PackageCompilationData compilationData = null;

            removeRule( pkg,
                        rule );
            compilationData = pkg.removeRule( rule );
            if ( this.reloadPackageCompilationData == null ) {
View Full Code Here


            }

            this.eventSupport.fireBeforeFunctionRemoved( pkg,
                                                         functionName );

            final PackageCompilationData compilationData = pkg.removeFunction( functionName );
            if ( compilationData == null ) {
                throw new IllegalArgumentException( "function name '" + packageName + "' does not exist in the Package '" + packageName + "'." );
            }

            if ( this.reloadPackageCompilationData == null ) {
View Full Code Here

        final Map globals = pkg.getGlobals();
        final Set imports = pkg.getImports();

        // First update the binary files
        // @todo: this probably has issues if you add classes in the incorrect order - functions, rules, invokers.
        final PackageCompilationData compilationData = pkg.getPackageCompilationData();
        final PackageCompilationData newCompilationData = newPkg.getPackageCompilationData();
        final String[] files = newCompilationData.list();
        for ( int i = 0, length = files.length; i < length; i++ ) {
            compilationData.write( files[i],
                                   newCompilationData.read( files[i] ) );
        }

        // Merge imports
        imports.addAll( newPkg.getImports() );

        // Add invokers
        compilationData.putAllInvokers( newCompilationData.getInvokers() );

        if ( compilationData.isDirty() ) {
            if ( this.reloadPackageCompilationData == null ) {
                this.reloadPackageCompilationData = new ReloadPackageCompilationData();
            }
View Full Code Here

                lock();
                doUnlock = true;
            }
            this.removalsSinceLock++;

            PackageCompilationData compilationData = null;

            removeRule( pkg,
                        rule );
            compilationData = pkg.removeRule( rule );
            if ( this.reloadPackageCompilationData == null ) {
View Full Code Here

            }

            this.eventSupport.fireBeforeFunctionRemoved( pkg,
                                                         functionName );

            final PackageCompilationData compilationData = pkg.removeFunction( functionName );
            if ( compilationData == null ) {
                throw new IllegalArgumentException( "function name '" + packageName + "' does not exist in the Package '" + packageName + "'." );
            }

            if ( this.reloadPackageCompilationData == null ) {
View Full Code Here

            this.set.add( packageCompilationData );
        }

        public void execute(final InternalRuleBase ruleBase) {
            for ( final Iterator it = this.set.iterator(); it.hasNext(); ) {
                final PackageCompilationData packageCompilationData = (PackageCompilationData) it.next();
                packageCompilationData.reload();
            }
        }
View Full Code Here

            this.set.add( packageCompilationData );
        }
       
        public void execute(InternalRuleBase ruleBase) {
            for ( Iterator it = this.set.iterator(); it.hasNext(); ) {
                PackageCompilationData packageCompilationData = ( PackageCompilationData ) it.next();
                packageCompilationData.reload();
            }
        }
View Full Code Here

        final Map globals = pkg.getGlobals();
        final Set imports = pkg.getImports();

        // First update the binary files
        // @todo: this probably has issues if you add classes in the incorrect order - functions, rules, invokers.
        final PackageCompilationData compilationData = pkg.getPackageCompilationData();
        final PackageCompilationData newCompilationData = newPkg.getPackageCompilationData();
        final String[] files = newCompilationData.list();
        for ( int i = 0, length = files.length; i < length; i++ ) {
            compilationData.write( files[i],
                                   newCompilationData.read( files[i] ) );
        }

        // Merge imports
        imports.addAll( newPkg.getImports() );

        // Add invokers
        compilationData.putAllInvokers( newCompilationData.getInvokers() );
       
        if ( compilationData.isDirty() ) {
            if ( this.reloadPackageCompilationData == null ) {
                this.reloadPackageCompilationData = new ReloadPackageCompilationData();
            }
View Full Code Here

            // in the working memory array
            int lastAquiredLock = 0;
            // get a snapshot of current working memories for locking
            final InternalWorkingMemory[] wms = getWorkingMemories();
           
            PackageCompilationData compilationData = null;

            try {
                // Iterate each workingMemory and lock it
                // This is so we don't update the Rete network during propagation
                for ( lastAquiredLock = 0; lastAquiredLock < wms.length; lastAquiredLock++ ) {
View Full Code Here

            final Package pkg = (Package) this.pkgs.get( packageName );
            if ( pkg ==  null) {
                throw new IllegalArgumentException("Package name '" + packageName + "' does not exist for this Rule Base.");
            }
           
            PackageCompilationData compilationData = pkg.removeFunction( functionName );
            if ( compilationData == null ) {
                throw new IllegalArgumentException("function name '" + packageName + "' does not exist in the Package '" + packageName + "'.");
            }
           
            if ( this.reloadPackageCompilationData == null ) {
View Full Code Here

TOP

Related Classes of org.drools.rule.PackageCompilationData

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.