org.drools.impl
Class StatefulKnowledgeSessionImpl

java.lang.Object
  extended by org.drools.impl.StatefulKnowledgeSessionImpl
All Implemented Interfaces:
InternalKnowledgeRuntime, InternalWorkingMemoryEntryPoint, org.drools.event.KnowledgeRuntimeEventManager, org.drools.event.process.ProcessEventManager, org.drools.event.rule.WorkingMemoryEventManager, org.drools.runtime.CommandExecutor, org.drools.runtime.KnowledgeRuntime, org.drools.runtime.process.ProcessRuntime, org.drools.runtime.process.StatefulProcessSession, org.drools.runtime.rule.StatefulRuleSession, org.drools.runtime.rule.WorkingMemory, org.drools.runtime.rule.WorkingMemoryEntryPoint, org.drools.runtime.StatefulKnowledgeSession

public class StatefulKnowledgeSessionImpl
extends Object
implements org.drools.runtime.StatefulKnowledgeSession, InternalWorkingMemoryEntryPoint, InternalKnowledgeRuntime


Nested Class Summary
static class StatefulKnowledgeSessionImpl.AbstractImmutableCollection
           
static class StatefulKnowledgeSessionImpl.AgendaEventListenerWrapper
           
static class StatefulKnowledgeSessionImpl.AgendaFilterWrapper
           
static class StatefulKnowledgeSessionImpl.ObjectStoreWrapper
           
static class StatefulKnowledgeSessionImpl.WorkingMemoryEventListenerWrapper
           
 
Field Summary
 org.drools.KnowledgeBase kbase
           
 ReteooWorkingMemoryInterface session
           
 
Constructor Summary
StatefulKnowledgeSessionImpl(ReteooWorkingMemory session)
           
StatefulKnowledgeSessionImpl(ReteooWorkingMemory session, org.drools.KnowledgeBase kbase)
           
 
Method Summary
 void abortProcessInstance(long id)
           
 void addEventListener(org.drools.event.rule.AgendaEventListener listener)
           
 void addEventListener(org.drools.event.process.ProcessEventListener listener)
           
 void addEventListener(org.drools.event.rule.WorkingMemoryEventListener listener)
           
 org.drools.runtime.process.ProcessInstance createProcessInstance(String processId, Map<String,Object> parameters)
           
 void dispose()
           
 void endOperation()
           
<T> T
execute(org.drools.command.Command<T> command)
           
<T> T
execute(Context context, org.drools.command.Command<T> command)
           
 void executeQueuedActions()
           
 int fireAllRules()
           
 int fireAllRules(org.drools.runtime.rule.AgendaFilter agendaFilter)
           
 int fireAllRules(org.drools.runtime.rule.AgendaFilter agendaFilter, int max)
           
 int fireAllRules(int max)
           
 void fireUntilHalt()
           
 void fireUntilHalt(org.drools.runtime.rule.AgendaFilter agendaFilter)
           
 Queue<WorkingMemoryAction> getActionQueue()
           
 org.drools.runtime.rule.Agenda getAgenda()
           
 Collection<org.drools.event.rule.AgendaEventListener> getAgendaEventListeners()
           
 org.drools.runtime.Calendars getCalendars()
           
 Map<String,org.drools.runtime.Channel> getChannels()
           
 EntryPoint getEntryPoint()
           
 String getEntryPointId()
           
 EntryPointNode getEntryPointNode()
           
 org.drools.runtime.Environment getEnvironment()
           
 long getFactCount()
           
 org.drools.runtime.rule.FactHandle getFactHandle(Object object)
           
 FactHandle getFactHandleByIdentity(Object object)
           
<T extends org.drools.runtime.rule.FactHandle>
Collection<T>
getFactHandles()
           
<T extends org.drools.runtime.rule.FactHandle>
Collection<T>
getFactHandles(org.drools.runtime.ObjectFilter filter)
           
 Object getGlobal(String identifier)
           
 org.drools.runtime.Globals getGlobals()
           
 int getId()
           
 InternalWorkingMemory getInternalWorkingMemory()
           
 org.drools.KnowledgeBase getKnowledgeBase()
           
 long getLastIdleTimestamp()
           
 Object getObject(org.drools.runtime.rule.FactHandle factHandle)
           
 Collection<Object> getObjects()
           
 Collection<Object> getObjects(org.drools.runtime.ObjectFilter filter)
           
 ObjectStore getObjectStore()
           
 ObjectTypeConfigurationRegistry getObjectTypeConfigurationRegistry()
           
 Collection<org.drools.event.process.ProcessEventListener> getProcessEventListeners()
           
 org.drools.runtime.process.ProcessInstance getProcessInstance(long id)
           
 Collection<org.drools.runtime.process.ProcessInstance> getProcessInstances()
           
 InternalProcessRuntime getProcessRuntime()
           
 org.drools.runtime.rule.QueryResults getQueryResults(String query, Object... arguments)
           
 RuleBase getRuleBase()
           
<T extends org.drools.time.SessionClock>
T
getSessionClock()
           
 org.drools.runtime.KnowledgeSessionConfiguration getSessionConfiguration()
           
 TimerService getTimerService()
           
 org.drools.runtime.rule.WorkingMemoryEntryPoint getWorkingMemoryEntryPoint(String name)
           
 Collection<? extends org.drools.runtime.rule.WorkingMemoryEntryPoint> getWorkingMemoryEntryPoints()
           
 Collection<org.drools.event.rule.WorkingMemoryEventListener> getWorkingMemoryEventListeners()
           
 org.drools.runtime.process.WorkItemManager getWorkItemManager()
           
 void halt()
           
 org.drools.runtime.rule.FactHandle insert(Object object)
           
 org.drools.runtime.rule.LiveQuery openLiveQuery(String query, Object[] arguments, org.drools.runtime.rule.ViewChangedEventListener listener)
           
 void queueWorkingMemoryAction(WorkingMemoryAction action)
           
 void registerChannel(String name, org.drools.runtime.Channel channel)
           
 void registerExitPoint(String name, org.drools.runtime.ExitPoint exitPoint)
          Deprecated. Use registerChannel(String, Channel) instead.
 void removeEventListener(org.drools.event.rule.AgendaEventListener listener)
           
 void removeEventListener(org.drools.event.process.ProcessEventListener listener)
           
 void removeEventListener(org.drools.event.rule.WorkingMemoryEventListener listener)
           
 void reset()
           
 void retract(org.drools.runtime.rule.FactHandle factHandle)
           
 void retract(FactHandle factHandle, boolean removeLogical, boolean updateEqualsMap, Rule rule, Activation activation)
           
 void setEndOperationListener(EndOperationListener listener)
           
 void setGlobal(String identifier, Object object)
           
 void setId(int id)
           
 void signalEvent(String type, Object event)
           
 void signalEvent(String type, Object event, long processInstanceId)
           
 void startOperation()
           
 org.drools.runtime.process.ProcessInstance startProcess(String processId)
           
 org.drools.runtime.process.ProcessInstance startProcess(String processId, Map<String,Object> parameters)
           
 org.drools.runtime.process.ProcessInstance startProcessInstance(long processInstanceId)
           
 void unregisterChannel(String name)
           
 void unregisterExitPoint(String name)
          Deprecated. Use unregisterChannel(String) instead.
 void update(org.drools.runtime.rule.FactHandle factHandle)
           
 void update(org.drools.runtime.rule.FactHandle factHandle, Object object)
           
 void update(org.drools.runtime.rule.FactHandle factHandle, Object object, Rule rule, Activation activation)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

session

public ReteooWorkingMemoryInterface session

kbase

public org.drools.KnowledgeBase kbase
Constructor Detail

StatefulKnowledgeSessionImpl

public StatefulKnowledgeSessionImpl(ReteooWorkingMemory session)

StatefulKnowledgeSessionImpl

public StatefulKnowledgeSessionImpl(ReteooWorkingMemory session,
                                    org.drools.KnowledgeBase kbase)
Method Detail

reset

public void reset()
Specified by:
reset in interface InternalWorkingMemoryEntryPoint

getObjectStore

public ObjectStore getObjectStore()
Specified by:
getObjectStore in interface InternalWorkingMemoryEntryPoint

getEntryPointNode

public EntryPointNode getEntryPointNode()
Specified by:
getEntryPointNode in interface InternalWorkingMemoryEntryPoint

getId

public int getId()
Specified by:
getId in interface org.drools.runtime.StatefulKnowledgeSession

getWorkingMemoryEntryPoint

public org.drools.runtime.rule.WorkingMemoryEntryPoint getWorkingMemoryEntryPoint(String name)
Specified by:
getWorkingMemoryEntryPoint in interface org.drools.runtime.rule.WorkingMemory

getWorkingMemoryEntryPoints

public Collection<? extends org.drools.runtime.rule.WorkingMemoryEntryPoint> getWorkingMemoryEntryPoints()
Specified by:
getWorkingMemoryEntryPoints in interface org.drools.runtime.rule.WorkingMemory

addEventListener

public void addEventListener(org.drools.event.rule.WorkingMemoryEventListener listener)
Specified by:
addEventListener in interface org.drools.event.rule.WorkingMemoryEventManager

removeEventListener

public void removeEventListener(org.drools.event.rule.WorkingMemoryEventListener listener)
Specified by:
removeEventListener in interface org.drools.event.rule.WorkingMemoryEventManager

getWorkingMemoryEventListeners

public Collection<org.drools.event.rule.WorkingMemoryEventListener> getWorkingMemoryEventListeners()
Specified by:
getWorkingMemoryEventListeners in interface org.drools.event.rule.WorkingMemoryEventManager

addEventListener

public void addEventListener(org.drools.event.rule.AgendaEventListener listener)
Specified by:
addEventListener in interface org.drools.event.rule.WorkingMemoryEventManager

getAgendaEventListeners

public Collection<org.drools.event.rule.AgendaEventListener> getAgendaEventListeners()
Specified by:
getAgendaEventListeners in interface org.drools.event.rule.WorkingMemoryEventManager

removeEventListener

public void removeEventListener(org.drools.event.rule.AgendaEventListener listener)
Specified by:
removeEventListener in interface org.drools.event.rule.WorkingMemoryEventManager

addEventListener

public void addEventListener(org.drools.event.process.ProcessEventListener listener)
Specified by:
addEventListener in interface org.drools.event.process.ProcessEventManager

getProcessEventListeners

public Collection<org.drools.event.process.ProcessEventListener> getProcessEventListeners()
Specified by:
getProcessEventListeners in interface org.drools.event.process.ProcessEventManager

removeEventListener

public void removeEventListener(org.drools.event.process.ProcessEventListener listener)
Specified by:
removeEventListener in interface org.drools.event.process.ProcessEventManager

getKnowledgeBase

public org.drools.KnowledgeBase getKnowledgeBase()
Specified by:
getKnowledgeBase in interface org.drools.runtime.KnowledgeRuntime

fireAllRules

public int fireAllRules()
Specified by:
fireAllRules in interface org.drools.runtime.rule.StatefulRuleSession

fireAllRules

public int fireAllRules(int max)
Specified by:
fireAllRules in interface org.drools.runtime.rule.StatefulRuleSession

fireAllRules

public int fireAllRules(org.drools.runtime.rule.AgendaFilter agendaFilter)
Specified by:
fireAllRules in interface org.drools.runtime.rule.StatefulRuleSession

fireAllRules

public int fireAllRules(org.drools.runtime.rule.AgendaFilter agendaFilter,
                        int max)
Specified by:
fireAllRules in interface org.drools.runtime.rule.StatefulRuleSession

fireUntilHalt

public void fireUntilHalt()
Specified by:
fireUntilHalt in interface org.drools.runtime.rule.StatefulRuleSession

fireUntilHalt

public void fireUntilHalt(org.drools.runtime.rule.AgendaFilter agendaFilter)
Specified by:
fireUntilHalt in interface org.drools.runtime.rule.StatefulRuleSession

getSessionClock

public <T extends org.drools.time.SessionClock> T getSessionClock()
Specified by:
getSessionClock in interface org.drools.runtime.KnowledgeRuntime

halt

public void halt()
Specified by:
halt in interface org.drools.runtime.rule.WorkingMemory

dispose

public void dispose()
Specified by:
dispose in interface org.drools.runtime.StatefulKnowledgeSession

insert

public org.drools.runtime.rule.FactHandle insert(Object object)
Specified by:
insert in interface org.drools.runtime.rule.WorkingMemoryEntryPoint

retract

public void retract(org.drools.runtime.rule.FactHandle factHandle)
Specified by:
retract in interface org.drools.runtime.rule.WorkingMemoryEntryPoint

update

public void update(org.drools.runtime.rule.FactHandle factHandle)

update

public void update(org.drools.runtime.rule.FactHandle factHandle,
                   Object object)
Specified by:
update in interface org.drools.runtime.rule.WorkingMemoryEntryPoint

getFactHandle

public org.drools.runtime.rule.FactHandle getFactHandle(Object object)
Specified by:
getFactHandle in interface org.drools.runtime.rule.WorkingMemoryEntryPoint

getObject

public Object getObject(org.drools.runtime.rule.FactHandle factHandle)
Specified by:
getObject in interface org.drools.runtime.rule.WorkingMemoryEntryPoint

getProcessInstance

public org.drools.runtime.process.ProcessInstance getProcessInstance(long id)
Specified by:
getProcessInstance in interface org.drools.runtime.process.ProcessRuntime

abortProcessInstance

public void abortProcessInstance(long id)
Specified by:
abortProcessInstance in interface org.drools.runtime.process.ProcessRuntime

getProcessInstances

public Collection<org.drools.runtime.process.ProcessInstance> getProcessInstances()
Specified by:
getProcessInstances in interface org.drools.runtime.process.ProcessRuntime

getWorkItemManager

public org.drools.runtime.process.WorkItemManager getWorkItemManager()
Specified by:
getWorkItemManager in interface org.drools.runtime.process.ProcessRuntime

startProcess

public org.drools.runtime.process.ProcessInstance startProcess(String processId)
Specified by:
startProcess in interface org.drools.runtime.process.ProcessRuntime

startProcess

public org.drools.runtime.process.ProcessInstance startProcess(String processId,
                                                               Map<String,Object> parameters)
Specified by:
startProcess in interface org.drools.runtime.process.ProcessRuntime

createProcessInstance

public org.drools.runtime.process.ProcessInstance createProcessInstance(String processId,
                                                                        Map<String,Object> parameters)
Specified by:
createProcessInstance in interface org.drools.runtime.process.ProcessRuntime

startProcessInstance

public org.drools.runtime.process.ProcessInstance startProcessInstance(long processInstanceId)
Specified by:
startProcessInstance in interface org.drools.runtime.process.ProcessRuntime

signalEvent

public void signalEvent(String type,
                        Object event)
Specified by:
signalEvent in interface org.drools.runtime.process.ProcessRuntime

signalEvent

public void signalEvent(String type,
                        Object event,
                        long processInstanceId)
Specified by:
signalEvent in interface org.drools.runtime.process.ProcessRuntime

setGlobal

public void setGlobal(String identifier,
                      Object object)
Specified by:
setGlobal in interface org.drools.runtime.KnowledgeRuntime

getGlobal

public Object getGlobal(String identifier)
Specified by:
getGlobal in interface org.drools.runtime.KnowledgeRuntime

getGlobals

public org.drools.runtime.Globals getGlobals()
Specified by:
getGlobals in interface org.drools.runtime.KnowledgeRuntime

getCalendars

public org.drools.runtime.Calendars getCalendars()
Specified by:
getCalendars in interface org.drools.runtime.KnowledgeRuntime

getEnvironment

public org.drools.runtime.Environment getEnvironment()
Specified by:
getEnvironment in interface org.drools.runtime.KnowledgeRuntime

getFactHandles

public <T extends org.drools.runtime.rule.FactHandle> Collection<T> getFactHandles()
Specified by:
getFactHandles in interface org.drools.runtime.rule.WorkingMemoryEntryPoint

getFactHandles

public <T extends org.drools.runtime.rule.FactHandle> Collection<T> getFactHandles(org.drools.runtime.ObjectFilter filter)
Specified by:
getFactHandles in interface org.drools.runtime.rule.WorkingMemoryEntryPoint

getObjects

public Collection<Object> getObjects()
Specified by:
getObjects in interface org.drools.runtime.rule.WorkingMemoryEntryPoint

getObjects

public Collection<Object> getObjects(org.drools.runtime.ObjectFilter filter)
Specified by:
getObjects in interface org.drools.runtime.rule.WorkingMemoryEntryPoint

retract

public void retract(FactHandle factHandle,
                    boolean removeLogical,
                    boolean updateEqualsMap,
                    Rule rule,
                    Activation activation)
             throws FactException
Specified by:
retract in interface InternalWorkingMemoryEntryPoint
Throws:
FactException

update

public void update(org.drools.runtime.rule.FactHandle factHandle,
                   Object object,
                   Rule rule,
                   Activation activation)
            throws FactException
Specified by:
update in interface InternalWorkingMemoryEntryPoint
Throws:
FactException

getEntryPoint

public EntryPoint getEntryPoint()
Specified by:
getEntryPoint in interface InternalWorkingMemoryEntryPoint

getInternalWorkingMemory

public InternalWorkingMemory getInternalWorkingMemory()
Specified by:
getInternalWorkingMemory in interface InternalWorkingMemoryEntryPoint

getFactHandleByIdentity

public FactHandle getFactHandleByIdentity(Object object)
Specified by:
getFactHandleByIdentity in interface InternalWorkingMemoryEntryPoint

getAgenda

public org.drools.runtime.rule.Agenda getAgenda()
Specified by:
getAgenda in interface org.drools.runtime.rule.WorkingMemory

registerExitPoint

@Deprecated
public void registerExitPoint(String name,
                                         org.drools.runtime.ExitPoint exitPoint)
Deprecated. Use registerChannel(String, Channel) instead.

Specified by:
registerExitPoint in interface org.drools.runtime.KnowledgeRuntime

unregisterExitPoint

@Deprecated
public void unregisterExitPoint(String name)
Deprecated. Use unregisterChannel(String) instead.

Specified by:
unregisterExitPoint in interface org.drools.runtime.KnowledgeRuntime

registerChannel

public void registerChannel(String name,
                            org.drools.runtime.Channel channel)
Specified by:
registerChannel in interface org.drools.runtime.KnowledgeRuntime

unregisterChannel

public void unregisterChannel(String name)
Specified by:
unregisterChannel in interface org.drools.runtime.KnowledgeRuntime

getChannels

public Map<String,org.drools.runtime.Channel> getChannels()
Specified by:
getChannels in interface org.drools.runtime.KnowledgeRuntime

getObjectTypeConfigurationRegistry

public ObjectTypeConfigurationRegistry getObjectTypeConfigurationRegistry()
Specified by:
getObjectTypeConfigurationRegistry in interface InternalWorkingMemoryEntryPoint

getRuleBase

public RuleBase getRuleBase()
Specified by:
getRuleBase in interface InternalWorkingMemoryEntryPoint

getQueryResults

public org.drools.runtime.rule.QueryResults getQueryResults(String query,
                                                            Object... arguments)
Specified by:
getQueryResults in interface org.drools.runtime.rule.WorkingMemory

execute

public <T> T execute(org.drools.command.Command<T> command)
Specified by:
execute in interface org.drools.runtime.CommandExecutor

execute

public <T> T execute(Context context,
                     org.drools.command.Command<T> command)

getEntryPointId

public String getEntryPointId()
Specified by:
getEntryPointId in interface org.drools.runtime.rule.WorkingMemoryEntryPoint

getFactCount

public long getFactCount()
Specified by:
getFactCount in interface org.drools.runtime.rule.WorkingMemoryEntryPoint

openLiveQuery

public org.drools.runtime.rule.LiveQuery openLiveQuery(String query,
                                                       Object[] arguments,
                                                       org.drools.runtime.rule.ViewChangedEventListener listener)
Specified by:
openLiveQuery in interface org.drools.runtime.rule.WorkingMemory

getSessionConfiguration

public org.drools.runtime.KnowledgeSessionConfiguration getSessionConfiguration()
Specified by:
getSessionConfiguration in interface org.drools.runtime.KnowledgeRuntime

getTimerService

public TimerService getTimerService()
Specified by:
getTimerService in interface InternalKnowledgeRuntime

startOperation

public void startOperation()
Specified by:
startOperation in interface InternalKnowledgeRuntime

endOperation

public void endOperation()
Specified by:
endOperation in interface InternalKnowledgeRuntime

executeQueuedActions

public void executeQueuedActions()
Specified by:
executeQueuedActions in interface InternalKnowledgeRuntime

getActionQueue

public Queue<WorkingMemoryAction> getActionQueue()
Specified by:
getActionQueue in interface InternalKnowledgeRuntime

getProcessRuntime

public InternalProcessRuntime getProcessRuntime()
Specified by:
getProcessRuntime in interface InternalKnowledgeRuntime

queueWorkingMemoryAction

public void queueWorkingMemoryAction(WorkingMemoryAction action)
Specified by:
queueWorkingMemoryAction in interface InternalKnowledgeRuntime

setId

public void setId(int id)
Specified by:
setId in interface InternalKnowledgeRuntime

setEndOperationListener

public void setEndOperationListener(EndOperationListener listener)
Specified by:
setEndOperationListener in interface InternalKnowledgeRuntime

getLastIdleTimestamp

public long getLastIdleTimestamp()
Specified by:
getLastIdleTimestamp in interface InternalKnowledgeRuntime


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