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_TYPES
protected Object[]
addRemovePropertyChangeListenerArgs
The arguments used when adding/removing a property change listener.protected Set<InternalFactHandle>
dynamicFacts
protected EntryPointId
entryPoint
protected EntryPointNode
entryPointNode
protected FactHandleFactory
handleFactory
protected InternalKnowledgeBase
kBase
protected ReentrantLock
lock
protected static org.slf4j.Logger
log
protected ObjectStore
objectStore
protected PropagationContextFactory
pctxFactory
protected StatefulKnowledgeSessionImpl
wm
-
Constructor Summary
Constructors Modifier Constructor Description protected
NamedEntryPoint()
NamedEntryPoint(EntryPointId entryPoint, EntryPointNode entryPointNode, StatefulKnowledgeSessionImpl wm)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addPropertyChangeListener(InternalFactHandle handle, boolean dynamicFlag)
protected void
afterRetract(InternalFactHandle handle, RuleImpl rule, TerminalNode terminalNode)
protected void
beforeDestroy(RuleImpl rule, TerminalNode terminalNode, InternalFactHandle handle)
protected void
beforeUpdate(InternalFactHandle handle, Object object, Activation activation, Object originalObject, PropagationContext propagationContext)
PropagationContext
delete(InternalFactHandle handle, Object object, ObjectTypeConf typeConf, RuleImpl rule, Activation activation)
PropagationContext
delete(InternalFactHandle handle, Object object, ObjectTypeConf typeConf, RuleImpl rule, Activation activation, TerminalNode terminalNode)
void
delete(org.kie.api.runtime.rule.FactHandle handle)
void
delete(org.kie.api.runtime.rule.FactHandle factHandle, RuleImpl rule, TerminalNode terminalNode)
void
delete(org.kie.api.runtime.rule.FactHandle factHandle, RuleImpl rule, TerminalNode terminalNode, org.kie.api.runtime.rule.FactHandle.State fhState)
void
delete(org.kie.api.runtime.rule.FactHandle handle, org.kie.api.runtime.rule.FactHandle.State fhState)
void
dispose()
Internal method called by the engine when the session is being disposed, so that the entry point can proceed with the necessary clean ups.void
enQueueWorkingMemoryAction(WorkingMemoryAction action)
EntryPointId
getEntryPoint()
String
getEntryPointId()
EntryPointNode
getEntryPointNode()
long
getFactCount()
org.kie.api.runtime.rule.FactHandle
getFactHandle(Object object)
org.kie.api.runtime.rule.FactHandle
getFactHandleByIdentity(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)
FactHandleFactory
getHandleFactory()
InternalWorkingMemory
getInternalWorkingMemory()
InternalKnowledgeBase
getKnowledgeBase()
Object
getObject(org.kie.api.runtime.rule.FactHandle factHandle)
Collection<? extends Object>
getObjects()
Collection<? extends Object>
getObjects(org.kie.api.runtime.ObjectFilter filter)
ObjectStore
getObjectStore()
ObjectTypeConfigurationRegistry
getObjectTypeConfigurationRegistry()
PropagationContextFactory
getPctxFactory()
Object
getRuleUnit()
TraitHelper
getTraitHelper()
TruthMaintenanceSystem
getTruthMaintenanceSystem()
WorkingMemoryEntryPoint
getWorkingMemoryEntryPoint(String name)
org.kie.api.runtime.rule.FactHandle
insert(Object object)
org.kie.api.runtime.rule.FactHandle
insert(Object object, boolean dynamic)
Insert a fact registering JavaBeanPropertyChangeListeners
on the Object to automatically triggerupdate
calls ifdynamic
istrue
.org.kie.api.runtime.rule.FactHandle
insert(Object object, boolean dynamic, RuleImpl rule, TerminalNode terminalNode)
void
insert(InternalFactHandle handle, Object object, RuleImpl rule, ObjectTypeConf typeConf, PropagationContext pctx)
void
insert(InternalFactHandle handle, Object object, RuleImpl rule, TerminalNode terminalNode, ObjectTypeConf typeConf)
org.kie.api.runtime.rule.FactHandle
insertAsync(Object object)
void
lock()
void
propertyChange(PropertyChangeEvent event)
void
removeFromObjectStore(InternalFactHandle handle)
protected void
removePropertyChangeListener(org.kie.api.runtime.rule.FactHandle handle, boolean removeFromSet)
void
reset()
void
retract(org.kie.api.runtime.rule.FactHandle handle)
void
setRuleUnit(Object ruleUnit)
String
toString()
void
unlock()
void
update(InternalFactHandle handle, Object object, Object originalObject, ObjectTypeConf typeConf, PropagationContext propagationContext)
InternalFactHandle
update(InternalFactHandle handle, Object object, BitMask mask, Class<?> modifiedClass, Activation activation)
void
update(org.kie.api.runtime.rule.FactHandle factHandle, Object object)
void
update(org.kie.api.runtime.rule.FactHandle handle, Object object, String... modifiedProperties)
void
update(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
-
wm
protected StatefulKnowledgeSessionImpl wm
-
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, StatefulKnowledgeSessionImpl wm)
-
-
Method Detail
-
lock
public void lock()
-
unlock
public void unlock()
-
reset
public void reset()
- Specified by:
reset
in interfaceWorkingMemoryEntryPoint
-
getObjectStore
public ObjectStore getObjectStore()
- Specified by:
getObjectStore
in interfaceWorkingMemoryEntryPoint
-
getEntryPointNode
public EntryPointNode getEntryPointNode()
- Specified by:
getEntryPointNode
in interfaceWorkingMemoryEntryPoint
-
getHandleFactory
public FactHandleFactory getHandleFactory()
- Specified by:
getHandleFactory
in interfaceWorkingMemoryEntryPoint
-
insert
public org.kie.api.runtime.rule.FactHandle insert(Object object)
- Specified by:
insert
in 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:WorkingMemoryEntryPoint
Insert a fact registering JavaBeanPropertyChangeListeners
on the Object to automatically triggerupdate
calls ifdynamic
istrue
.- Specified by:
insert
in interfaceWorkingMemoryEntryPoint
- Parameters:
object
- The fact object.dynamic
- true if Drools should add JavaBeanPropertyChangeListeners
to 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:
insert
in interfaceInternalWorkingMemoryEntryPoint
-
insert
public void insert(InternalFactHandle handle, Object object, RuleImpl rule, TerminalNode terminalNode, ObjectTypeConf typeConf)
- Specified by:
insert
in interfaceInternalWorkingMemoryEntryPoint
-
insert
public void insert(InternalFactHandle handle, Object object, RuleImpl rule, ObjectTypeConf typeConf, PropagationContext pctx)
- Specified by:
insert
in interfaceInternalWorkingMemoryEntryPoint
-
insertAsync
public org.kie.api.runtime.rule.FactHandle insertAsync(Object object)
- Specified by:
insertAsync
in interfaceInternalWorkingMemoryEntryPoint
-
update
public void update(org.kie.api.runtime.rule.FactHandle factHandle, Object object)
- Specified by:
update
in interfaceorg.kie.api.runtime.rule.EntryPoint
-
update
public void update(org.kie.api.runtime.rule.FactHandle handle, Object object, String... modifiedProperties)
- Specified by:
update
in 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:
update
in interfaceWorkingMemoryEntryPoint
-
update
public InternalFactHandle update(InternalFactHandle handle, Object object, BitMask mask, Class<?> modifiedClass, Activation activation)
- Specified by:
update
in 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:
update
in interfaceInternalWorkingMemoryEntryPoint
-
retract
public void retract(org.kie.api.runtime.rule.FactHandle handle)
- Specified by:
retract
in interfaceorg.kie.api.runtime.rule.EntryPoint
-
delete
public void delete(org.kie.api.runtime.rule.FactHandle handle)
- Specified by:
delete
in 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:
delete
in interfaceorg.kie.api.runtime.rule.EntryPoint
-
delete
public void delete(org.kie.api.runtime.rule.FactHandle factHandle, RuleImpl rule, TerminalNode terminalNode)
- Specified by:
delete
in 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:
delete
in 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:
delete
in interfaceInternalWorkingMemoryEntryPoint
-
delete
public PropagationContext delete(InternalFactHandle handle, Object object, ObjectTypeConf typeConf, RuleImpl rule, Activation activation, TerminalNode terminalNode)
- Specified by:
delete
in interfaceInternalWorkingMemoryEntryPoint
-
afterRetract
protected void afterRetract(InternalFactHandle handle, RuleImpl rule, TerminalNode terminalNode)
-
removeFromObjectStore
public void removeFromObjectStore(InternalFactHandle handle)
- Specified by:
removeFromObjectStore
in interfaceInternalWorkingMemoryEntryPoint
-
addPropertyChangeListener
protected void addPropertyChangeListener(InternalFactHandle handle, boolean dynamicFlag)
-
removePropertyChangeListener
protected void removePropertyChangeListener(org.kie.api.runtime.rule.FactHandle handle, boolean removeFromSet)
-
getWorkingMemoryEntryPoint
public WorkingMemoryEntryPoint getWorkingMemoryEntryPoint(String name)
- Specified by:
getWorkingMemoryEntryPoint
in interfaceWorkingMemoryEntryPoint
-
getObjectTypeConfigurationRegistry
public ObjectTypeConfigurationRegistry getObjectTypeConfigurationRegistry()
- Specified by:
getObjectTypeConfigurationRegistry
in interfaceWorkingMemoryEntryPoint
-
getKnowledgeBase
public InternalKnowledgeBase getKnowledgeBase()
- Specified by:
getKnowledgeBase
in interfaceWorkingMemoryEntryPoint
-
getFactHandle
public org.kie.api.runtime.rule.FactHandle getFactHandle(Object object)
- Specified by:
getFactHandle
in interfaceorg.kie.api.runtime.rule.EntryPoint
-
getEntryPoint
public EntryPointId getEntryPoint()
- Specified by:
getEntryPoint
in interfaceWorkingMemoryEntryPoint
-
getInternalWorkingMemory
public InternalWorkingMemory getInternalWorkingMemory()
- Specified by:
getInternalWorkingMemory
in interfaceWorkingMemoryEntryPoint
-
getFactHandleByIdentity
public org.kie.api.runtime.rule.FactHandle getFactHandleByIdentity(Object object)
- Specified by:
getFactHandleByIdentity
in interfaceWorkingMemoryEntryPoint
-
getObject
public Object getObject(org.kie.api.runtime.rule.FactHandle factHandle)
- Specified by:
getObject
in interfaceorg.kie.api.runtime.rule.EntryPoint
-
getFactHandles
public <T extends org.kie.api.runtime.rule.FactHandle> Collection<T> getFactHandles()
- Specified by:
getFactHandles
in 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:
getFactHandles
in interfaceorg.kie.api.runtime.rule.EntryPoint
-
getObjects
public Collection<? extends Object> getObjects()
- Specified by:
getObjects
in interfaceorg.kie.api.runtime.rule.EntryPoint
-
getObjects
public Collection<? extends Object> getObjects(org.kie.api.runtime.ObjectFilter filter)
- Specified by:
getObjects
in interfaceorg.kie.api.runtime.rule.EntryPoint
-
getEntryPointId
public String getEntryPointId()
- Specified by:
getEntryPointId
in interfaceorg.kie.api.runtime.rule.EntryPoint
-
getFactCount
public long getFactCount()
- Specified by:
getFactCount
in interfaceorg.kie.api.runtime.rule.EntryPoint
-
propertyChange
public void propertyChange(PropertyChangeEvent event)
- Specified by:
propertyChange
in interfacePropertyChangeListener
-
dispose
public void dispose()
Description copied from interface:WorkingMemoryEntryPoint
Internal 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:
dispose
in interfaceWorkingMemoryEntryPoint
-
enQueueWorkingMemoryAction
public void enQueueWorkingMemoryAction(WorkingMemoryAction action)
-
getTruthMaintenanceSystem
public TruthMaintenanceSystem getTruthMaintenanceSystem()
- Specified by:
getTruthMaintenanceSystem
in interfaceWorkingMemoryEntryPoint
-
getTraitHelper
public TraitHelper getTraitHelper()
- Specified by:
getTraitHelper
in interfaceInternalWorkingMemoryEntryPoint
-
getPctxFactory
public PropagationContextFactory getPctxFactory()
- Specified by:
getPctxFactory
in interfaceInternalWorkingMemoryEntryPoint
-
getRuleUnit
public Object getRuleUnit()
- Specified by:
getRuleUnit
in interfaceWorkingMemoryEntryPoint
-
setRuleUnit
public void setRuleUnit(Object ruleUnit)
- Specified by:
setRuleUnit
in interfaceWorkingMemoryEntryPoint
-
-