org.drools.common
Interface InternalWorkingMemory

All Superinterfaces:
RuleBaseEventManager, WorkingMemory, org.drools.runtime.rule.WorkingMemoryEntryPoint, WorkingMemoryEventManager
All Known Subinterfaces:
InternalWorkingMemoryActions
All Known Implementing Classes:
AbstractWorkingMemory, ReteooStatefulSession, ReteooWorkingMemory

public interface InternalWorkingMemory
extends WorkingMemory


Method Summary
 void activationFired()
          This method is called by the agenda right after an activation was fired to allow the working memory to resume any activities blocked during activation firing.
 void addLIANodePropagation(LIANodePropagation liaNodePropagation)
           
 void clearNodeMemory(NodeMemory node)
           
 void endBatchExecution()
           
 void endOperation()
          This method must be called after finishing any work in the engine, like inserting a new fact or firing a new rule.
 void executeQueuedActions()
           
 org.drools.runtime.Calendars getCalendars()
           
 Map<String,org.drools.runtime.Channel> getChannels()
          Returns a map of channel Id->Channel of all channels in this working memory
 DateFormats getDateFormats()
           
 EntryPoint getEntryPoint()
           
 EntryPointNode getEntryPointNode()
           
 Map<String,? extends org.drools.runtime.rule.WorkingMemoryEntryPoint> getEntryPoints()
           
 ExecutionResultImpl getExecutionResult()
           
 Map<String,org.drools.runtime.ExitPoint> getExitPoints()
          Deprecated. Use getChannels() instead.
 FactHandle getFactHandleByIdentity(Object object)
          Looks for the fact handle associated to the given object by looking up the object IDENTITY (==), even if rule base is configured to AssertBehavior.EQUALITY.
 FactHandleFactory getFactHandleFactory()
           
 int getId()
           
 long getIdleTime()
          Returns the number of time units (usually ms) that the engine is idle according to the session clock or -1 if it is not idle.
 InternalFactHandle getInitialFactHandle()
           
 InternalKnowledgeRuntime getKnowledgeRuntime()
           
 Lock getLock()
           
 long getNextPropagationIdCounter()
           
 Object getNodeMemory(NodeMemory node)
           
 ObjectStore getObjectStore()
           
 ObjectTypeConfigurationRegistry getObjectTypeConfigurationRegistry()
           
 PartitionTaskManager getPartitionTaskManager(RuleBasePartitionId partitionId)
          Returns the PartitionTaskManager for the given partition ID in case the rulebase has partitions enabled
 InternalProcessRuntime getProcessRuntime()
           
 SessionConfiguration getSessionConfiguration()
           
 TimerService getTimerService()
          Returns the TimerService instance (session clock) for this session.
 long getTimeToNextJob()
          Returns the number of time units (usually ms) to the next scheduled job
 long getTotalFactCount()
          Returns the total number of facts in the working memory, i.e., counting all facts from all entry points.
 TruthMaintenanceSystem getTruthMaintenanceSystem()
           
 void insert(InternalFactHandle handle, Object object, Rule rule, Activation activation, ObjectTypeConf typeConf)
           
 boolean isSequential()
           
 void prepareToFireActivation()
          This method is called by the agenda before firing a new activation to ensure the working memory is in a safe state to fire the activation.
 void queueWorkingMemoryAction(WorkingMemoryAction action)
           
 void retract(FactHandle factHandle, boolean removeLogical, boolean updateEqualsMap, Rule rule, Activation activation)
           
 void setAgendaEventSupport(AgendaEventSupport agendaEventSupport)
           
 void setId(int id)
           
 void setKnowledgeRuntime(InternalKnowledgeRuntime kruntime)
           
 void setWorkingMemoryEventSupport(WorkingMemoryEventSupport workingMemoryEventSupport)
           
 void startBatchExecution(ExecutionResultImpl results)
           
 void startOperation()
          This method must be called before starting any new work in the engine, like inserting a new fact or firing a new rule.
 void updateEntryPointsCache()
           
 
Methods inherited from interface org.drools.WorkingMemory
clearActivationGroup, clearAgenda, clearAgendaGroup, clearRuleFlowGroup, fireAllRules, fireAllRules, fireAllRules, fireAllRules, getAgenda, getEnvironment, getFactHandle, getGlobal, getGlobalResolver, getObject, getProcessInstance, getProcessInstances, getQueryResults, getRuleBase, getSessionClock, getWorkingMemoryEntryPoint, getWorkItemManager, halt, iterateFactHandles, iterateFactHandles, iterateObjects, iterateObjects, setAsyncExceptionHandler, setFocus, setGlobal, setGlobalResolver, startProcess, startProcess
 
Methods inherited from interface org.drools.WorkingMemoryEventManager
addEventListener, addEventListener, getAgendaEventListeners, getWorkingMemoryEventListeners, removeEventListener, removeEventListener
 
Methods inherited from interface org.drools.RuleBaseEventManager
addEventListener, getRuleBaseEventListeners, removeEventListener
 
Methods inherited from interface org.drools.WorkingMemoryEntryPoint
insert, insert, retract, update
 
Methods inherited from interface org.drools.runtime.rule.WorkingMemoryEntryPoint
getEntryPointId, getFactCount, getFactHandles, getFactHandles, getObjects, getObjects
 

Method Detail

getId

int getId()

setId

void setId(int id)

setWorkingMemoryEventSupport

void setWorkingMemoryEventSupport(WorkingMemoryEventSupport workingMemoryEventSupport)

setAgendaEventSupport

void setAgendaEventSupport(AgendaEventSupport agendaEventSupport)

getNodeMemory

Object getNodeMemory(NodeMemory node)

clearNodeMemory

void clearNodeMemory(NodeMemory node)

getNextPropagationIdCounter

long getNextPropagationIdCounter()

getObjectStore

ObjectStore getObjectStore()

getTruthMaintenanceSystem

TruthMaintenanceSystem getTruthMaintenanceSystem()

executeQueuedActions

void executeQueuedActions()

queueWorkingMemoryAction

void queueWorkingMemoryAction(WorkingMemoryAction action)

getFactHandleFactory

FactHandleFactory getFactHandleFactory()

getEntryPoint

EntryPoint getEntryPoint()

getEntryPointNode

EntryPointNode getEntryPointNode()

insert

void insert(InternalFactHandle handle,
            Object object,
            Rule rule,
            Activation activation,
            ObjectTypeConf typeConf)

getFactHandleByIdentity

FactHandle getFactHandleByIdentity(Object object)
Looks for the fact handle associated to the given object by looking up the object IDENTITY (==), even if rule base is configured to AssertBehavior.EQUALITY.

Specified by:
getFactHandleByIdentity in interface WorkingMemory
Parameters:
object -
Returns:
null if fact handle not found

retract

void retract(FactHandle factHandle,
             boolean removeLogical,
             boolean updateEqualsMap,
             Rule rule,
             Activation activation)
             throws FactException
Throws:
FactException

getLock

Lock getLock()

isSequential

boolean isSequential()

addLIANodePropagation

void addLIANodePropagation(LIANodePropagation liaNodePropagation)

getObjectTypeConfigurationRegistry

ObjectTypeConfigurationRegistry getObjectTypeConfigurationRegistry()

getInitialFactHandle

InternalFactHandle getInitialFactHandle()

getCalendars

org.drools.runtime.Calendars getCalendars()

getTimerService

TimerService getTimerService()
Returns the TimerService instance (session clock) for this session.

Returns:

getPartitionTaskManager

PartitionTaskManager getPartitionTaskManager(RuleBasePartitionId partitionId)
Returns the PartitionTaskManager for the given partition ID in case the rulebase has partitions enabled

Parameters:
partitionId - the ID of the partition for which the task manager is assigned
Returns:
the PartitionTaskManager

setKnowledgeRuntime

void setKnowledgeRuntime(InternalKnowledgeRuntime kruntime)

getKnowledgeRuntime

InternalKnowledgeRuntime getKnowledgeRuntime()

getExitPoints

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


getChannels

Map<String,org.drools.runtime.Channel> getChannels()
Returns a map of channel Id->Channel of all channels in this working memory

Returns:

getEntryPoints

Map<String,? extends org.drools.runtime.rule.WorkingMemoryEntryPoint> getEntryPoints()

getSessionConfiguration

SessionConfiguration getSessionConfiguration()

startBatchExecution

void startBatchExecution(ExecutionResultImpl results)

getExecutionResult

ExecutionResultImpl getExecutionResult()

endBatchExecution

void endBatchExecution()

startOperation

void startOperation()
This method must be called before starting any new work in the engine, like inserting a new fact or firing a new rule. It will reset the engine idle time counter. This method must be extremely light to avoid contentions when called by multiple threads/entry-points


endOperation

void endOperation()
This method must be called after finishing any work in the engine, like inserting a new fact or firing a new rule. It will reset the engine idle time counter. This method must be extremely light to avoid contentions when called by multiple threads/entry-points


getIdleTime

long getIdleTime()
Returns the number of time units (usually ms) that the engine is idle according to the session clock or -1 if it is not idle. This method is not synchronised and might return an approximate value.

Returns:

getTimeToNextJob

long getTimeToNextJob()
Returns the number of time units (usually ms) to the next scheduled job

Returns:
the number of time units until the next scheduled job or -1 if there is no job scheduled

updateEntryPointsCache

void updateEntryPointsCache()

prepareToFireActivation

void prepareToFireActivation()
This method is called by the agenda before firing a new activation to ensure the working memory is in a safe state to fire the activation.


activationFired

void activationFired()
This method is called by the agenda right after an activation was fired to allow the working memory to resume any activities blocked during activation firing.


getTotalFactCount

long getTotalFactCount()
Returns the total number of facts in the working memory, i.e., counting all facts from all entry points. This is an approximate value and may not be accurate due to the concurrent nature of the entry points.

Returns:

getDateFormats

DateFormats getDateFormats()

getProcessRuntime

InternalProcessRuntime getProcessRuntime()


Copyright © 2001-2013 JBoss Inc.. All Rights Reserved.