org.drools.base
Class DefaultKnowledgeHelper

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

public class DefaultKnowledgeHelper
extends Object
implements KnowledgeHelper, Externalizable

See Also:
Serialized Form

Constructor Summary
DefaultKnowledgeHelper()
           
DefaultKnowledgeHelper(Activation activation, WorkingMemory workingMemory)
           
DefaultKnowledgeHelper(WorkingMemory workingMemory)
           
 
Method Summary
 void blockActivation(org.drools.runtime.rule.Activation act)
           
 void cancelActivation(org.drools.runtime.rule.Activation act)
           
 void cancelRemainingPreviousLogicalDependencies()
           
<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)
           
 Activation getActivation()
           
 org.drools.runtime.Channel getChannel(String id)
           
 Map<String,org.drools.runtime.Channel> getChannels()
           
<T> T
getContext(Class<T> contextClass)
           
 Declaration getDeclaration(String identifier)
           
 org.drools.runtime.rule.WorkingMemoryEntryPoint getEntryPoint(String id)
           
 Map<String,org.drools.runtime.rule.WorkingMemoryEntryPoint> getEntryPoints()
           
 org.drools.runtime.ExitPoint getExitPoint(String id)
          Deprecated. use getChannel(String) instead
 Map<String,org.drools.runtime.ExitPoint> getExitPoints()
          Deprecated. use getChannels() instead
 FactHandle getFactHandle(FactHandle handle)
           
 FactHandle getFactHandle(Object object)
           
 IdentityHashMap<Object,FactHandle> getIdentityMap()
           
 org.drools.runtime.KnowledgeRuntime getKnowledgeRuntime()
           
 Rule getRule()
           
 Tuple getTuple()
           
 WorkingMemory getWorkingMemory()
           
 void halt()
           
 void insert(Object object)
          Asserts an object, notice that it does not return the FactHandle
 void insert(Object object, boolean dynamic)
          Asserts an object specifying that it implement the onPropertyChange listener, notice that it does not return the FactHandle.
 void insertLogical(Object object)
           
 void insertLogical(Object object, boolean dynamic)
           
 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> Thing<K>
shed(TraitableBean<K> core, Class<T> trait)
           
 void unblockAllActivations(org.drools.runtime.rule.Activation act)
           
 void update(FactHandle handle)
           
 void update(FactHandle handle, Object newObject)
           
 void update(Object object)
           
 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

blockActivation

public void blockActivation(org.drools.runtime.rule.Activation act)
Specified by:
blockActivation in interface org.drools.runtime.rule.RuleContext

unblockAllActivations

public void unblockAllActivations(org.drools.runtime.rule.Activation act)
Specified by:
unblockAllActivations in interface org.drools.runtime.rule.RuleContext

insert

public void insert(Object object)
Description copied from interface: KnowledgeHelper
Asserts an object, notice that it does not return the FactHandle

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

insert

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

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 org.drools.runtime.rule.RuleContext
Specified by:
insertLogical in interface KnowledgeHelper

insertLogical

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

cancelRemainingPreviousLogicalDependencies

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

cancelActivation

public void cancelActivation(org.drools.runtime.rule.Activation act)
Specified by:
cancelActivation in interface org.drools.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(Object object)
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 org.drools.runtime.rule.RuleContext
Specified by:
getRule in interface KnowledgeHelper
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.drools.runtime.KnowledgeRuntime getKnowledgeRuntime()
Specified by:
getKnowledgeRuntime in interface org.drools.runtime.KnowledgeContext

getActivation

public Activation getActivation()
Specified by:
getActivation in interface org.drools.runtime.rule.RuleContext
Specified by:
getActivation in interface KnowledgeHelper

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.drools.runtime.rule.WorkingMemoryEntryPoint getEntryPoint(String id)
Specified by:
getEntryPoint in interface KnowledgeHelper

getExitPoint

@Deprecated
public org.drools.runtime.ExitPoint getExitPoint(String id)
Deprecated. use getChannel(String) instead

Specified by:
getExitPoint in interface KnowledgeHelper

getChannel

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

getEntryPoints

public Map<String,org.drools.runtime.rule.WorkingMemoryEntryPoint> getEntryPoints()
Specified by:
getEntryPoints in interface KnowledgeHelper

getExitPoints

@Deprecated
public Map<String,org.drools.runtime.ExitPoint> getExitPoints()
Deprecated. use getChannels() instead

Specified by:
getExitPoints in interface KnowledgeHelper

getChannels

public Map<String,org.drools.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

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> Thing<K> shed(TraitableBean<K> core,
                           Class<T> trait)
Specified by:
shed in interface KnowledgeHelper

modify

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


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