Package org.drools.core.common
Class NamedEntryPoint
- java.lang.Object
-
- org.drools.core.common.NamedEntryPoint
-
- All Implemented Interfaces:
PropertyChangeListener,EventListener,InternalWorkingMemoryEntryPoint,WorkingMemoryEntryPoint,org.kie.api.runtime.rule.EntryPoint
public class NamedEntryPoint extends Object implements InternalWorkingMemoryEntryPoint, WorkingMemoryEntryPoint, PropertyChangeListener
-
-
Field Summary
Fields Modifier and Type Field Description protected static Class<?>[]ADD_REMOVE_PROPERTY_CHANGE_LISTENER_ARG_TYPESprotected Object[]addRemovePropertyChangeListenerArgsThe arguments used when adding/removing a property change listener.protected Set<InternalFactHandle>dynamicFactsprotected EntryPointIdentryPointprotected EntryPointNodeentryPointNodeprotected FactHandleFactoryhandleFactoryprotected InternalKnowledgeBasekBaseprotected ReentrantLocklockprotected static org.slf4j.Loggerlogprotected ObjectStoreobjectStoreprotected PropagationContextFactorypctxFactoryprotected ReteEvaluatorreteEvaluator
-
Constructor Summary
Constructors Modifier Constructor Description protectedNamedEntryPoint()NamedEntryPoint(EntryPointId entryPoint, EntryPointNode entryPointNode, ReteEvaluator reteEvaluator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddPropertyChangeListener(InternalFactHandle handle, boolean dynamicFlag)protected voidafterRetract(InternalFactHandle handle, RuleImpl rule, TerminalNode terminalNode)protected voidbeforeDestroy(RuleImpl rule, TerminalNode terminalNode, InternalFactHandle handle)protected voidbeforeUpdate(InternalFactHandle handle, Object object, Activation activation, Object originalObject, PropagationContext propagationContext)PropagationContextdelete(InternalFactHandle handle, Object object, ObjectTypeConf typeConf, RuleImpl rule, Activation activation)PropagationContextdelete(InternalFactHandle handle, Object object, ObjectTypeConf typeConf, RuleImpl rule, Activation activation, TerminalNode terminalNode)voiddelete(org.kie.api.runtime.rule.FactHandle handle)voiddelete(org.kie.api.runtime.rule.FactHandle factHandle, RuleImpl rule, TerminalNode terminalNode)voiddelete(org.kie.api.runtime.rule.FactHandle factHandle, RuleImpl rule, TerminalNode terminalNode, org.kie.api.runtime.rule.FactHandle.State fhState)voiddelete(org.kie.api.runtime.rule.FactHandle handle, org.kie.api.runtime.rule.FactHandle.State fhState)voiddispose()Internal method called by the engine when the session is being disposed, so that the entry point can proceed with the necessary clean ups.EntryPointIdgetEntryPoint()StringgetEntryPointId()EntryPointNodegetEntryPointNode()longgetFactCount()org.kie.api.runtime.rule.FactHandlegetFactHandle(Object object)org.kie.api.runtime.rule.FactHandlegetFactHandleByIdentity(Object object)<T extends org.kie.api.runtime.rule.FactHandle>
Collection<T>getFactHandles()<T extends org.kie.api.runtime.rule.FactHandle>
Collection<T>getFactHandles(org.kie.api.runtime.ObjectFilter filter)FactHandleFactorygetHandleFactory()InternalKnowledgeBasegetKnowledgeBase()ObjectgetObject(org.kie.api.runtime.rule.FactHandle factHandle)Collection<? extends Object>getObjects()Collection<? extends Object>getObjects(org.kie.api.runtime.ObjectFilter filter)ObjectStoregetObjectStore()ObjectTypeConfigurationRegistrygetObjectTypeConfigurationRegistry()PropagationContextFactorygetPctxFactory()ReteEvaluatorgetReteEvaluator()ObjectgetRuleUnit()TraitHelpergetTraitHelper()TruthMaintenanceSystemgetTruthMaintenanceSystem()org.kie.api.runtime.rule.FactHandleinsert(Object object)org.kie.api.runtime.rule.FactHandleinsert(Object object, boolean dynamic)Insert a fact registering JavaBeanPropertyChangeListenerson the Object to automatically triggerupdatecalls ifdynamicistrue.org.kie.api.runtime.rule.FactHandleinsert(Object object, boolean dynamic, RuleImpl rule, TerminalNode terminalNode)voidinsert(InternalFactHandle handle, Object object, RuleImpl rule, ObjectTypeConf typeConf, PropagationContext pctx)voidinsert(InternalFactHandle handle, Object object, RuleImpl rule, TerminalNode terminalNode, ObjectTypeConf typeConf)org.kie.api.runtime.rule.FactHandleinsertAsync(Object object)voidlock()voidpropertyChange(PropertyChangeEvent event)voidremoveFromObjectStore(InternalFactHandle handle)protected voidremovePropertyChangeListener(org.kie.api.runtime.rule.FactHandle handle, boolean removeFromSet)voidreset()voidretract(org.kie.api.runtime.rule.FactHandle handle)voidsetRuleUnit(Object ruleUnit)StringtoString()voidunlock()voidupdate(InternalFactHandle handle, Object object, Object originalObject, ObjectTypeConf typeConf, PropagationContext propagationContext)InternalFactHandleupdate(InternalFactHandle handle, Object object, BitMask mask, Class<?> modifiedClass, Activation activation)voidupdate(org.kie.api.runtime.rule.FactHandle factHandle, Object object)voidupdate(org.kie.api.runtime.rule.FactHandle handle, Object object, String... modifiedProperties)voidupdate(org.kie.api.runtime.rule.FactHandle factHandle, Object object, BitMask mask, Class<?> modifiedClass, Activation activation)
-
-
-
Field Detail
-
log
protected static final transient org.slf4j.Logger log
-
ADD_REMOVE_PROPERTY_CHANGE_LISTENER_ARG_TYPES
protected static final Class<?>[] ADD_REMOVE_PROPERTY_CHANGE_LISTENER_ARG_TYPES
-
addRemovePropertyChangeListenerArgs
protected final Object[] addRemovePropertyChangeListenerArgs
The arguments used when adding/removing a property change listener.
-
objectStore
protected ObjectStore objectStore
-
kBase
protected transient InternalKnowledgeBase kBase
-
entryPoint
protected EntryPointId entryPoint
-
entryPointNode
protected EntryPointNode entryPointNode
-
reteEvaluator
protected ReteEvaluator reteEvaluator
-
handleFactory
protected FactHandleFactory handleFactory
-
pctxFactory
protected PropagationContextFactory pctxFactory
-
lock
protected ReentrantLock lock
-
dynamicFacts
protected Set<InternalFactHandle> dynamicFacts
-
-
Constructor Detail
-
NamedEntryPoint
protected NamedEntryPoint()
-
NamedEntryPoint
public NamedEntryPoint(EntryPointId entryPoint, EntryPointNode entryPointNode, ReteEvaluator reteEvaluator)
-
-
Method Detail
-
lock
public void lock()
-
unlock
public void unlock()
-
reset
public void reset()
- Specified by:
resetin interfaceWorkingMemoryEntryPoint
-
getObjectStore
public ObjectStore getObjectStore()
- Specified by:
getObjectStorein interfaceWorkingMemoryEntryPoint
-
getEntryPointNode
public EntryPointNode getEntryPointNode()
- Specified by:
getEntryPointNodein interfaceWorkingMemoryEntryPoint
-
getHandleFactory
public FactHandleFactory getHandleFactory()
- Specified by:
getHandleFactoryin interfaceWorkingMemoryEntryPoint
-
insert
public org.kie.api.runtime.rule.FactHandle insert(Object object)
- Specified by:
insertin interfaceorg.kie.api.runtime.rule.EntryPoint- See Also:
WorkingMemory
-
insert
public org.kie.api.runtime.rule.FactHandle insert(Object object, boolean dynamic)
Description copied from interface:WorkingMemoryEntryPointInsert a fact registering JavaBeanPropertyChangeListenerson the Object to automatically triggerupdatecalls ifdynamicistrue.- Specified by:
insertin interfaceWorkingMemoryEntryPoint- Parameters:
object- The fact object.dynamic- true if Drools should add JavaBeanPropertyChangeListenersto the object.- Returns:
- The new fact-handle associated with the object.
-
insert
public org.kie.api.runtime.rule.FactHandle insert(Object object, boolean dynamic, RuleImpl rule, TerminalNode terminalNode)
- Specified by:
insertin interfaceInternalWorkingMemoryEntryPoint
-
insert
public void insert(InternalFactHandle handle, Object object, RuleImpl rule, TerminalNode terminalNode, ObjectTypeConf typeConf)
- Specified by:
insertin interfaceInternalWorkingMemoryEntryPoint
-
insert
public void insert(InternalFactHandle handle, Object object, RuleImpl rule, ObjectTypeConf typeConf, PropagationContext pctx)
- Specified by:
insertin interfaceInternalWorkingMemoryEntryPoint
-
insertAsync
public org.kie.api.runtime.rule.FactHandle insertAsync(Object object)
- Specified by:
insertAsyncin interfaceInternalWorkingMemoryEntryPoint
-
update
public void update(org.kie.api.runtime.rule.FactHandle factHandle, Object object)- Specified by:
updatein interfaceorg.kie.api.runtime.rule.EntryPoint
-
update
public void update(org.kie.api.runtime.rule.FactHandle handle, Object object, String... modifiedProperties)- Specified by:
updatein interfaceorg.kie.api.runtime.rule.EntryPoint
-
update
public void update(org.kie.api.runtime.rule.FactHandle factHandle, Object object, BitMask mask, Class<?> modifiedClass, Activation activation)- Specified by:
updatein interfaceWorkingMemoryEntryPoint
-
update
public InternalFactHandle update(InternalFactHandle handle, Object object, BitMask mask, Class<?> modifiedClass, Activation activation)
- Specified by:
updatein interfaceInternalWorkingMemoryEntryPoint
-
beforeUpdate
protected void beforeUpdate(InternalFactHandle handle, Object object, Activation activation, Object originalObject, PropagationContext propagationContext)
-
update
public void update(InternalFactHandle handle, Object object, Object originalObject, ObjectTypeConf typeConf, PropagationContext propagationContext)
- Specified by:
updatein interfaceInternalWorkingMemoryEntryPoint
-
retract
public void retract(org.kie.api.runtime.rule.FactHandle handle)
- Specified by:
retractin interfaceorg.kie.api.runtime.rule.EntryPoint
-
delete
public void delete(org.kie.api.runtime.rule.FactHandle handle)
- Specified by:
deletein interfaceorg.kie.api.runtime.rule.EntryPoint
-
delete
public void delete(org.kie.api.runtime.rule.FactHandle handle, org.kie.api.runtime.rule.FactHandle.State fhState)- Specified by:
deletein interfaceorg.kie.api.runtime.rule.EntryPoint
-
delete
public void delete(org.kie.api.runtime.rule.FactHandle factHandle, RuleImpl rule, TerminalNode terminalNode)- Specified by:
deletein interfaceWorkingMemoryEntryPoint
-
delete
public void delete(org.kie.api.runtime.rule.FactHandle factHandle, RuleImpl rule, TerminalNode terminalNode, org.kie.api.runtime.rule.FactHandle.State fhState)- Specified by:
deletein interfaceWorkingMemoryEntryPoint
-
beforeDestroy
protected void beforeDestroy(RuleImpl rule, TerminalNode terminalNode, InternalFactHandle handle)
-
delete
public PropagationContext delete(InternalFactHandle handle, Object object, ObjectTypeConf typeConf, RuleImpl rule, Activation activation)
- Specified by:
deletein interfaceInternalWorkingMemoryEntryPoint
-
delete
public PropagationContext delete(InternalFactHandle handle, Object object, ObjectTypeConf typeConf, RuleImpl rule, Activation activation, TerminalNode terminalNode)
- Specified by:
deletein interfaceInternalWorkingMemoryEntryPoint
-
afterRetract
protected void afterRetract(InternalFactHandle handle, RuleImpl rule, TerminalNode terminalNode)
-
removeFromObjectStore
public void removeFromObjectStore(InternalFactHandle handle)
- Specified by:
removeFromObjectStorein interfaceInternalWorkingMemoryEntryPoint
-
addPropertyChangeListener
protected void addPropertyChangeListener(InternalFactHandle handle, boolean dynamicFlag)
-
removePropertyChangeListener
protected void removePropertyChangeListener(org.kie.api.runtime.rule.FactHandle handle, boolean removeFromSet)
-
getObjectTypeConfigurationRegistry
public ObjectTypeConfigurationRegistry getObjectTypeConfigurationRegistry()
- Specified by:
getObjectTypeConfigurationRegistryin interfaceWorkingMemoryEntryPoint
-
getKnowledgeBase
public InternalKnowledgeBase getKnowledgeBase()
- Specified by:
getKnowledgeBasein interfaceWorkingMemoryEntryPoint
-
getFactHandle
public org.kie.api.runtime.rule.FactHandle getFactHandle(Object object)
- Specified by:
getFactHandlein interfaceorg.kie.api.runtime.rule.EntryPoint
-
getEntryPoint
public EntryPointId getEntryPoint()
- Specified by:
getEntryPointin interfaceWorkingMemoryEntryPoint
-
getReteEvaluator
public ReteEvaluator getReteEvaluator()
- Specified by:
getReteEvaluatorin interfaceWorkingMemoryEntryPoint
-
getFactHandleByIdentity
public org.kie.api.runtime.rule.FactHandle getFactHandleByIdentity(Object object)
-
getObject
public Object getObject(org.kie.api.runtime.rule.FactHandle factHandle)
- Specified by:
getObjectin interfaceorg.kie.api.runtime.rule.EntryPoint
-
getFactHandles
public <T extends org.kie.api.runtime.rule.FactHandle> Collection<T> getFactHandles()
- Specified by:
getFactHandlesin interfaceorg.kie.api.runtime.rule.EntryPoint
-
getFactHandles
public <T extends org.kie.api.runtime.rule.FactHandle> Collection<T> getFactHandles(org.kie.api.runtime.ObjectFilter filter)
- Specified by:
getFactHandlesin interfaceorg.kie.api.runtime.rule.EntryPoint
-
getObjects
public Collection<? extends Object> getObjects()
- Specified by:
getObjectsin interfaceorg.kie.api.runtime.rule.EntryPoint
-
getObjects
public Collection<? extends Object> getObjects(org.kie.api.runtime.ObjectFilter filter)
- Specified by:
getObjectsin interfaceorg.kie.api.runtime.rule.EntryPoint
-
getEntryPointId
public String getEntryPointId()
- Specified by:
getEntryPointIdin interfaceorg.kie.api.runtime.rule.EntryPoint
-
getFactCount
public long getFactCount()
- Specified by:
getFactCountin interfaceorg.kie.api.runtime.rule.EntryPoint
-
propertyChange
public void propertyChange(PropertyChangeEvent event)
- Specified by:
propertyChangein interfacePropertyChangeListener
-
dispose
public void dispose()
Description copied from interface:WorkingMemoryEntryPointInternal method called by the engine when the session is being disposed, so that the entry point can proceed with the necessary clean ups.- Specified by:
disposein interfaceWorkingMemoryEntryPoint
-
getTruthMaintenanceSystem
public TruthMaintenanceSystem getTruthMaintenanceSystem()
- Specified by:
getTruthMaintenanceSystemin interfaceWorkingMemoryEntryPoint
-
getTraitHelper
public TraitHelper getTraitHelper()
- Specified by:
getTraitHelperin interfaceInternalWorkingMemoryEntryPoint
-
getPctxFactory
public PropagationContextFactory getPctxFactory()
- Specified by:
getPctxFactoryin interfaceInternalWorkingMemoryEntryPoint
-
getRuleUnit
public Object getRuleUnit()
- Specified by:
getRuleUnitin interfaceWorkingMemoryEntryPoint
-
setRuleUnit
public void setRuleUnit(Object ruleUnit)
- Specified by:
setRuleUnitin interfaceWorkingMemoryEntryPoint
-
-