Drools :: Core 6.0.0.Beta5

org.drools.core.base
Class DefaultKnowledgeHelper

java.lang.Object
  extended by org.drools.core.base.DefaultKnowledgeHelper
All Implemented Interfaces:
Externalizable, Serializable, KnowledgeHelper, org.kie.api.runtime.KieContext, org.kie.api.runtime.rule.RuleContext

public class DefaultKnowledgeHelper
extends Object
implements KnowledgeHelper, Externalizable

See Also:
Serialized Form

Nested Class Summary
static class DefaultKnowledgeHelper.RetractTrait
           
 
Constructor Summary
DefaultKnowledgeHelper()
           
DefaultKnowledgeHelper(Activation activation, WorkingMemory workingMemory)
           
DefaultKnowledgeHelper(WorkingMemory workingMemory)
           
 
Method Summary
protected
<T,K> T
applyTrait(K core, Class<T> trait, boolean logical)
           
protected
<K> TraitableBean<K,CoreWrapper<K>>
asTraitable(K core, TraitFactory builder)
           
 void blockMatch(org.kie.api.runtime.rule.Match act)
           
 void cancelMatch(org.kie.api.runtime.rule.Match act)
           
 void cancelRemainingPreviousLogicalDependencies()
           
protected
<T> T
doInsertTrait(T thing, boolean logical)
           
<T,K> T
don(K core, Class<T> trait)
           
<T,K> T
don(K core, Class<T> trait, boolean logical)
           
<T,K> T
don(Thing<K> core, Class<T> trait)
           
<T,K> T
don(Thing<K> core, Class<T> trait, boolean logical)
           
 Object get(Declaration declaration)
           
 org.kie.api.runtime.Channel getChannel(String id)
           
 Map<String,org.kie.api.runtime.Channel> getChannels()
           
<T> T
getContext(Class<T> contextClass)
           
 Declaration getDeclaration(String identifier)
           
 org.kie.api.runtime.rule.SessionEntryPoint getEntryPoint(String id)
           
 Map<String,org.kie.api.runtime.rule.SessionEntryPoint> getEntryPoints()
           
 FactHandle getFactHandle(FactHandle handle)
           
 FactHandle getFactHandle(Object object)
           
 IdentityHashMap<Object,FactHandle> getIdentityMap()
           
 org.kie.api.runtime.KieRuntime getKieRuntime()
           
 org.kie.internal.runtime.KnowledgeRuntime getKnowledgeRuntime()
           
 Activation getMatch()
           
 LinkedList<LogicalDependency> getpreviousJustified()
           
 Rule getRule()
           
 Tuple getTuple()
           
 WorkingMemory getWorkingMemory()
           
 void halt()
           
 FactHandle insert(Object object)
          Asserts an object
 FactHandle insert(Object object, boolean dynamic)
          Asserts an object specifying that it implement the onPropertyChange listener
 void insertLogical(Object object)
           
 void insertLogical(Object object, boolean dynamic)
           
 void insertLogical(Object object, Object value)
           
 void insertLogical(Object object, Object value, boolean dynamic)
           
 void modify(Object newObject)
           
protected
<T,K> T
processTraits(K core, Class<T> trait, TraitFactory builder, boolean needsUpdate, TraitableBean<K,? extends TraitableBean> inner, boolean logical)
           
 void readExternal(ObjectInput in)
           
 void reset()
           
 void retract(FactHandle handle)
           
 void retract(Object object)
           
 void setActivation(Activation agendaItem)
           
 void setFocus(String focus)
           
 void setIdentityMap(IdentityHashMap<Object,FactHandle> identityMap)
           
<T,K> Thing<K>
shed(Thing<K> thing, Class<T> trait)
           
<T,K,X extends TraitableBean>
Thing<K>
shed(TraitableBean<K,X> core, Class<T> trait)
           
 void unblockAllMatches(org.kie.api.runtime.rule.Match act)
           
 void update(FactHandle handle)
           
 void update(FactHandle handle, long mask, Class<?> modifiedClass)
           
 void update(FactHandle handle, Object newObject)
           
 void update(Object object)
           
 void update(Object object, long mask, Class<?> modifiedClass)
           
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultKnowledgeHelper

public DefaultKnowledgeHelper()

DefaultKnowledgeHelper

public DefaultKnowledgeHelper(WorkingMemory workingMemory)

DefaultKnowledgeHelper

public DefaultKnowledgeHelper(Activation activation,
                              WorkingMemory workingMemory)
Method Detail

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Throws:
IOException
ClassNotFoundException

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Throws:
IOException

setActivation

public void setActivation(Activation agendaItem)
Specified by:
setActivation in interface KnowledgeHelper

reset

public void reset()
Specified by:
reset in interface KnowledgeHelper

getpreviousJustified

public LinkedList<LogicalDependency> getpreviousJustified()

blockMatch

public void blockMatch(org.kie.api.runtime.rule.Match act)
Specified by:
blockMatch in interface org.kie.api.runtime.rule.RuleContext

unblockAllMatches

public void unblockAllMatches(org.kie.api.runtime.rule.Match act)
Specified by:
unblockAllMatches in interface org.kie.api.runtime.rule.RuleContext

insert

public FactHandle insert(Object object)
Description copied from interface: KnowledgeHelper
Asserts an object

Specified by:
insert in interface KnowledgeHelper
Parameters:
object - - the object to be asserted

insert

public FactHandle insert(Object object,
                         boolean dynamic)
                  throws FactException
Description copied from interface: KnowledgeHelper
Asserts an object specifying that it implement the onPropertyChange listener

Specified by:
insert in interface KnowledgeHelper
Parameters:
object - - the object to be asserted
dynamic - - specifies the object implements onPropertyChangeListener
Throws:
FactException

insertLogical

public void insertLogical(Object object)
Specified by:
insertLogical in interface KnowledgeHelper
Specified by:
insertLogical in interface org.kie.api.runtime.rule.RuleContext

insertLogical

public void insertLogical(Object object,
                          boolean dynamic)
Specified by:
insertLogical in interface KnowledgeHelper

insertLogical

public void insertLogical(Object object,
                          Object value)
Specified by:
insertLogical in interface org.kie.api.runtime.rule.RuleContext

insertLogical

public void insertLogical(Object object,
                          Object value,
                          boolean dynamic)

cancelRemainingPreviousLogicalDependencies

public void cancelRemainingPreviousLogicalDependencies()
Specified by:
cancelRemainingPreviousLogicalDependencies in interface KnowledgeHelper

cancelMatch

public void cancelMatch(org.kie.api.runtime.rule.Match act)
Specified by:
cancelMatch in interface org.kie.api.runtime.rule.RuleContext

getFactHandle

public FactHandle getFactHandle(Object object)
Specified by:
getFactHandle in interface KnowledgeHelper

getFactHandle

public FactHandle getFactHandle(FactHandle handle)
Specified by:
getFactHandle in interface KnowledgeHelper

update

public void update(FactHandle handle,
                   Object newObject)
Specified by:
update in interface KnowledgeHelper

update

public void update(FactHandle handle)
Specified by:
update in interface KnowledgeHelper

update

public void update(FactHandle handle,
                   long mask,
                   Class<?> modifiedClass)
Specified by:
update in interface KnowledgeHelper

update

public void update(Object object)
Specified by:
update in interface KnowledgeHelper

update

public void update(Object object,
                   long mask,
                   Class<?> modifiedClass)
Specified by:
update in interface KnowledgeHelper

retract

public void retract(Object object)
Specified by:
retract in interface KnowledgeHelper

retract

public void retract(FactHandle handle)
Specified by:
retract in interface KnowledgeHelper

getRule

public Rule getRule()
Specified by:
getRule in interface KnowledgeHelper
Specified by:
getRule in interface org.kie.api.runtime.rule.RuleContext
Returns:
- The rule name

getTuple

public Tuple getTuple()
Specified by:
getTuple in interface KnowledgeHelper

getWorkingMemory

public WorkingMemory getWorkingMemory()
Specified by:
getWorkingMemory in interface KnowledgeHelper

getKnowledgeRuntime

public org.kie.internal.runtime.KnowledgeRuntime getKnowledgeRuntime()
Specified by:
getKnowledgeRuntime in interface org.kie.api.runtime.KieContext

getMatch

public Activation getMatch()
Specified by:
getMatch in interface KnowledgeHelper
Specified by:
getMatch in interface org.kie.api.runtime.rule.RuleContext

setFocus

public void setFocus(String focus)
Specified by:
setFocus in interface KnowledgeHelper

get

public Object get(Declaration declaration)
Specified by:
get in interface KnowledgeHelper

getDeclaration

public Declaration getDeclaration(String identifier)
Specified by:
getDeclaration in interface KnowledgeHelper

halt

public void halt()
Specified by:
halt in interface KnowledgeHelper

getEntryPoint

public org.kie.api.runtime.rule.SessionEntryPoint getEntryPoint(String id)
Specified by:
getEntryPoint in interface KnowledgeHelper

getChannel

public org.kie.api.runtime.Channel getChannel(String id)
Specified by:
getChannel in interface KnowledgeHelper

getEntryPoints

public Map<String,org.kie.api.runtime.rule.SessionEntryPoint> getEntryPoints()
Specified by:
getEntryPoints in interface KnowledgeHelper

getChannels

public Map<String,org.kie.api.runtime.Channel> getChannels()
Specified by:
getChannels in interface KnowledgeHelper

getIdentityMap

public IdentityHashMap<Object,FactHandle> getIdentityMap()
Specified by:
getIdentityMap in interface KnowledgeHelper
Returns:
the identityMap

setIdentityMap

public void setIdentityMap(IdentityHashMap<Object,FactHandle> identityMap)
Specified by:
setIdentityMap in interface KnowledgeHelper
Parameters:
identityMap - the identityMap to set

getContext

public <T> T getContext(Class<T> contextClass)
Specified by:
getContext in interface KnowledgeHelper

don

public <T,K> T don(K core,
                   Class<T> trait,
                   boolean logical)
Specified by:
don in interface KnowledgeHelper

doInsertTrait

protected <T> T doInsertTrait(T thing,
                              boolean logical)

getKieRuntime

public org.kie.api.runtime.KieRuntime getKieRuntime()
Specified by:
getKieRuntime in interface org.kie.api.runtime.KieContext

applyTrait

protected <T,K> T applyTrait(K core,
                             Class<T> trait,
                             boolean logical)
                throws LogicalTypeInconsistencyException
Throws:
LogicalTypeInconsistencyException

asTraitable

protected <K> TraitableBean<K,CoreWrapper<K>> asTraitable(K core,
                                                          TraitFactory builder)

processTraits

protected <T,K> T processTraits(K core,
                                Class<T> trait,
                                TraitFactory builder,
                                boolean needsUpdate,
                                TraitableBean<K,? extends TraitableBean> inner,
                                boolean logical)
                   throws LogicalTypeInconsistencyException
Throws:
LogicalTypeInconsistencyException

don

public <T,K> T don(Thing<K> core,
                   Class<T> trait,
                   boolean logical)
Specified by:
don in interface KnowledgeHelper

don

public <T,K> T don(K core,
                   Class<T> trait)
Specified by:
don in interface KnowledgeHelper

don

public <T,K> T don(Thing<K> core,
                   Class<T> trait)
Specified by:
don in interface KnowledgeHelper

shed

public <T,K> Thing<K> shed(Thing<K> thing,
                           Class<T> trait)
Specified by:
shed in interface KnowledgeHelper

shed

public <T,K,X extends TraitableBean> Thing<K> shed(TraitableBean<K,X> core,
                                                   Class<T> trait)
Specified by:
shed in interface KnowledgeHelper

modify

public void modify(Object newObject)
Specified by:
modify in interface KnowledgeHelper

Drools :: Core 6.0.0.Beta5

Copyright © 2001-2013 JBoss by Red Hat. All Rights Reserved.