Package org.drools.factmodel.traits

Examples of org.drools.factmodel.traits.Thing


        return shed((TraitableBean<K>) thing.getCore(), trait);
    }

    public <T,K> Thing<K> shed( TraitableBean<K> core, Class<T> trait ) {
        retract( core.removeTrait( trait.getName() ) );
        Thing thing = core.getTrait( Thing.class.getName() );
        update( thing );
        return thing;
    }
View Full Code Here


                // this is a traitable core object, so its traits must be updated as well
                if ( ((TraitableBean) h.getObject()).hasTraits() ) {
                    updateTraits( h.getObject(), mask, null, modifiedClass, null, ((TraitableBean) h.getObject()).getMostSpecificTraits()  );
                }
            } else if ( h.isTraiting() ) {
                Thing x = (Thing) h.getObject();
                // in case this is a proxy
                if ( x != x.getCore() ) {
                    Object core = x.getCore();
                    InternalFactHandle coreHandle = (InternalFactHandle) getFactHandle( core );
                    ((InternalWorkingMemoryEntryPoint) coreHandle.getEntryPoint()).update(
                            coreHandle,
                            core,
                            mask,
View Full Code Here

                        // Example: given classes A <- B <-C, at OTN A, a proxy c can only pass if no proxy b exists

                        TraitableBean txBean = (TraitableBean) proxy.getObject();
                        TraitTypeMap tMap = (TraitTypeMap) txBean._getTraitMap();
                        Collection<Thing> x = tMap.immediateParents( this.typeMask );
                        Thing k = x.iterator().next();

                        long originalMask = context.getModificationMask();
                        if ( ! k.isTop() ) {
                            ((PropagationContextImpl) context).setModificationMask( -1L );
                        }
                        //System.out.println(" MODIFY PASS !! " + factHandle.getObject() + " " + ( (TraitProxy) factHandle.getObject() ).getTypeCode() + " >> " + vetoMask + " checks in " + typeMask );
                        this.sink.propagateModifyObject( factHandle,
                                modifyPreviousTuples,
View Full Code Here

        return shed((TraitableBean<K>) thing.getCore(), trait);
    }

    public <T,K> Thing<K> shed( TraitableBean<K> core, Class<T> trait ) {
        retract( core.removeTrait( trait.getName() ) );
        Thing thing = core.getTrait( Thing.class.getName() );
        update( thing );
        return thing;
    }
View Full Code Here

                // this is a traitable core object, so its traits must be updated as well
                if ( ((TraitableBean) h.getObject()).hasTraits() ) {
                    updateTraits( h.getObject(), mask, null, modifiedClass, null, ((TraitableBean) h.getObject()).getMostSpecificTraits()  );
                }
            } else if ( h.isTraiting() ) {
                Thing x = (Thing) h.getObject();
                // in case this is a proxy
                if ( x != x.getCore() ) {
                    Object core = x.getCore();
                    InternalFactHandle coreHandle = (InternalFactHandle) getFactHandle( core );
                    ((InternalWorkingMemoryEntryPoint) coreHandle.getEntryPoint()).update(
                            coreHandle,
                            core,
                            mask,
View Full Code Here

    private void updateManyTraits( Object object, long mask, Collection<Thing> originators, Class<?> modifiedClass, BitSet veto, Collection<Key<Thing>> mostSpecificTraits ) {
        veto = veto != null ? (BitSet) veto.clone() : null;

        for ( Key<Thing> k : mostSpecificTraits ) {
            Thing t = k.getValue();
            if ( ! originators.contains( t ) ) {
                TraitProxy proxy = (TraitProxy) t;

                proxy.setTypeFilter( veto );
                InternalFactHandle h = (InternalFactHandle) lookupFactHandle( t );
View Full Code Here

        return shed((TraitableBean<K>) thing.getCore(), trait);
    }

    public <T,K> Thing<K> shed( TraitableBean<K> core, Class<T> trait ) {
        retract( core.removeTrait( trait.getName() ) );
        Thing thing = core.getTrait( Thing.class.getName() );
        update( thing );
        return thing;
    }
View Full Code Here

        return shed((TraitableBean<K>) thing.getCore(), trait);
    }

    public <T,K> Thing<K> shed( TraitableBean<K> core, Class<T> trait ) {
        retract( core.removeTrait( trait.getName() ) );
        Thing thing = core.getTrait( Thing.class.getName() );
        update( thing );
        return thing;
    }
View Full Code Here

        return shed((TraitableBean<K>) thing.getCore(), trait);
    }

    public <T,K> Thing<K> shed( TraitableBean<K> core, Class<T> trait ) {
        retract( core.removeTrait( trait.getName() ) );
        Thing thing = core.getTrait( Thing.class.getName() );
        update( thing );
        return thing;
    }
View Full Code Here

        return shed((TraitableBean<K>) thing.getCore(), trait);
    }

    public <T,K> Thing<K> shed( TraitableBean<K> core, Class<T> trait ) {
        retract( core.removeTrait( trait.getName() ) );
        Thing thing = core.getTrait( Thing.class.getName() );
        update( thing );
        return thing;
    }
View Full Code Here

TOP

Related Classes of org.drools.factmodel.traits.Thing

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.