public class DefaultKnowledgeHelper extends Object implements KnowledgeHelper, Externalizable
Constructor and Description |
---|
DefaultKnowledgeHelper() |
DefaultKnowledgeHelper(Activation activation,
WorkingMemory workingMemory) |
DefaultKnowledgeHelper(WorkingMemory workingMemory) |
Modifier and Type | Method and Description |
---|---|
protected <T,K> T |
applyManyTraits(K core,
Collection<Class<? extends Thing>> traits,
Object value,
boolean logical) |
protected <T,K> T |
applyTrait(K core,
Class<T> trait,
Object value,
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> void |
configureTrait(T thing,
Object value) |
void |
delete(FactHandle handle) |
void |
delete(Object object) |
protected <T> T |
doInsertTrait(T thing,
Object core,
boolean logical,
BitSet boundary) |
<T,K> T |
don(K core,
Class<T> trait) |
<T,K> T |
don(K core,
Class<T> trait,
boolean logical) |
<T,K> T |
don(K core,
Collection<Class<? extends Thing>> traits) |
<T,K> T |
don(K core,
Collection<Class<? extends Thing>> traits,
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.EntryPoint |
getEntryPoint(String id) |
Map<String,org.kie.api.runtime.rule.EntryPoint> |
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() |
protected Collection<Thing> |
getTraitBoundary(TraitableBean inner,
boolean needsProxy,
boolean hasTrait,
Class trait) |
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) |
protected <K> ClassDefinition |
lookupClassDefinition(K core) |
FactHandle |
lookupFactHandle(Object object) |
void |
modify(Object newObject) |
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> |
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) |
public DefaultKnowledgeHelper()
public DefaultKnowledgeHelper(WorkingMemory workingMemory)
public DefaultKnowledgeHelper(Activation activation, WorkingMemory workingMemory)
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public void setActivation(Activation agendaItem)
setActivation
in interface KnowledgeHelper
public void reset()
reset
in interface KnowledgeHelper
public LinkedList<LogicalDependency> getpreviousJustified()
public void blockMatch(org.kie.api.runtime.rule.Match act)
blockMatch
in interface org.kie.api.runtime.rule.RuleContext
public void unblockAllMatches(org.kie.api.runtime.rule.Match act)
unblockAllMatches
in interface org.kie.api.runtime.rule.RuleContext
public FactHandle insert(Object object)
KnowledgeHelper
insert
in interface KnowledgeHelper
object
- -
the object to be assertedpublic FactHandle insert(Object object, boolean dynamic) throws FactException
KnowledgeHelper
insert
in interface KnowledgeHelper
object
- -
the object to be asserteddynamic
- -
specifies the object implements onPropertyChangeListenerFactException
public void insertLogical(Object object)
insertLogical
in interface KnowledgeHelper
insertLogical
in interface org.kie.api.runtime.rule.RuleContext
public void insertLogical(Object object, boolean dynamic)
insertLogical
in interface KnowledgeHelper
public void insertLogical(Object object, Object value)
insertLogical
in interface org.kie.api.runtime.rule.RuleContext
public void cancelRemainingPreviousLogicalDependencies()
cancelRemainingPreviousLogicalDependencies
in interface KnowledgeHelper
public void cancelMatch(org.kie.api.runtime.rule.Match act)
cancelMatch
in interface org.kie.api.runtime.rule.RuleContext
public FactHandle lookupFactHandle(Object object)
public FactHandle getFactHandle(Object object)
getFactHandle
in interface KnowledgeHelper
public FactHandle getFactHandle(FactHandle handle)
getFactHandle
in interface KnowledgeHelper
public void update(FactHandle handle, Object newObject)
update
in interface KnowledgeHelper
public void update(FactHandle handle)
update
in interface KnowledgeHelper
public void update(FactHandle handle, long mask, Class<?> modifiedClass)
update
in interface KnowledgeHelper
public void update(Object object)
update
in interface KnowledgeHelper
public void update(Object object, long mask, Class<?> modifiedClass)
update
in interface KnowledgeHelper
public void retract(Object object)
retract
in interface KnowledgeHelper
public void retract(FactHandle handle)
retract
in interface KnowledgeHelper
public void delete(Object object)
delete
in interface KnowledgeHelper
public void delete(FactHandle handle)
delete
in interface KnowledgeHelper
public Rule getRule()
getRule
in interface KnowledgeHelper
getRule
in interface org.kie.api.runtime.rule.RuleContext
public Tuple getTuple()
getTuple
in interface KnowledgeHelper
public WorkingMemory getWorkingMemory()
getWorkingMemory
in interface KnowledgeHelper
public org.kie.internal.runtime.KnowledgeRuntime getKnowledgeRuntime()
getKnowledgeRuntime
in interface org.kie.api.runtime.KieContext
public Activation getMatch()
getMatch
in interface KnowledgeHelper
getMatch
in interface org.kie.api.runtime.rule.RuleContext
public void setFocus(String focus)
setFocus
in interface KnowledgeHelper
public Object get(Declaration declaration)
get
in interface KnowledgeHelper
public Declaration getDeclaration(String identifier)
getDeclaration
in interface KnowledgeHelper
public void halt()
halt
in interface KnowledgeHelper
public org.kie.api.runtime.rule.EntryPoint getEntryPoint(String id)
getEntryPoint
in interface KnowledgeHelper
public org.kie.api.runtime.Channel getChannel(String id)
getChannel
in interface KnowledgeHelper
public Map<String,org.kie.api.runtime.rule.EntryPoint> getEntryPoints()
getEntryPoints
in interface KnowledgeHelper
public Map<String,org.kie.api.runtime.Channel> getChannels()
getChannels
in interface KnowledgeHelper
public IdentityHashMap<Object,FactHandle> getIdentityMap()
getIdentityMap
in interface KnowledgeHelper
public void setIdentityMap(IdentityHashMap<Object,FactHandle> identityMap)
setIdentityMap
in interface KnowledgeHelper
identityMap
- the identityMap to setpublic <T> T getContext(Class<T> contextClass)
getContext
in interface KnowledgeHelper
public <T,K> T don(K core, Collection<Class<? extends Thing>> traits)
don
in interface KnowledgeHelper
public <T,K> T don(K core, Collection<Class<? extends Thing>> traits, boolean logical)
don
in interface KnowledgeHelper
public <T,K> T don(K core, Class<T> trait, boolean logical)
don
in interface KnowledgeHelper
public org.kie.api.runtime.KieRuntime getKieRuntime()
getKieRuntime
in interface org.kie.api.runtime.KieContext
protected <K> TraitableBean<K,CoreWrapper<K>> asTraitable(K core, TraitFactory builder)
protected <K> ClassDefinition lookupClassDefinition(K core)
protected <T,K> T applyManyTraits(K core, Collection<Class<? extends Thing>> traits, Object value, boolean logical) throws LogicalTypeInconsistencyException
protected <T,K> T applyTrait(K core, Class<T> trait, Object value, boolean logical) throws LogicalTypeInconsistencyException
protected Collection<Thing> getTraitBoundary(TraitableBean inner, boolean needsProxy, boolean hasTrait, Class trait)
protected <T> void configureTrait(T thing, Object value)
public <T,K> T don(Thing<K> core, Class<T> trait, boolean logical)
don
in interface KnowledgeHelper
public <T,K> T don(K core, Class<T> trait)
don
in interface KnowledgeHelper
public <T,K> T don(Thing<K> core, Class<T> trait)
don
in interface KnowledgeHelper
public <T,K> Thing<K> shed(Thing<K> thing, Class<T> trait)
shed
in interface KnowledgeHelper
public <T,K,X extends TraitableBean> Thing<K> shed(TraitableBean<K,X> core, Class<T> trait)
shed
in interface KnowledgeHelper
public void modify(Object newObject)
modify
in interface KnowledgeHelper
Copyright © 2001-2015 JBoss by Red Hat. All Rights Reserved.