Drools :: Core 6.0.0.Beta5

org.drools.core.impl
Class StatefulKnowledgeSessionImpl

java.lang.Object
  extended by org.drools.core.impl.StatefulKnowledgeSessionImpl
All Implemented Interfaces:
InternalKnowledgeRuntime, InternalWorkingMemoryEntryPoint, org.kie.api.event.KieRuntimeEventManager, org.kie.api.event.process.ProcessEventManager, org.kie.api.event.rule.WorkingMemoryEventManager, org.kie.api.runtime.CommandExecutor, org.kie.api.runtime.KieRuntime, org.kie.api.runtime.KieSession, org.kie.api.runtime.process.ProcessRuntime, org.kie.api.runtime.process.StatefulProcessSession, org.kie.api.runtime.rule.Session, org.kie.api.runtime.rule.SessionEntryPoint, org.kie.api.runtime.rule.StatefulRuleSession, org.kie.internal.event.KnowledgeRuntimeEventManager, org.kie.internal.process.CorrelationAwareProcessRuntime, org.kie.internal.runtime.KnowledgeRuntime, org.kie.internal.runtime.StatefulKnowledgeSession

public class StatefulKnowledgeSessionImpl
extends Object
implements org.kie.internal.runtime.StatefulKnowledgeSession, InternalWorkingMemoryEntryPoint, InternalKnowledgeRuntime, org.kie.api.runtime.KieSession, org.kie.internal.process.CorrelationAwareProcessRuntime


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.kie.internal.KnowledgeBase kbase
           
 ReteooWorkingMemoryInterface session
           
 
Constructor Summary
StatefulKnowledgeSessionImpl(ReteooWorkingMemory session)
           
StatefulKnowledgeSessionImpl(ReteooWorkingMemory session, org.kie.internal.KnowledgeBase kbase)
           
 
Method Summary
 void abortProcessInstance(long id)
           
 void addEventListener(org.kie.api.event.rule.AgendaEventListener listener)
           
 void addEventListener(org.kie.api.event.process.ProcessEventListener listener)
           
 void addEventListener(org.kie.api.event.rule.WorkingMemoryEventListener listener)
           
 org.kie.api.runtime.process.ProcessInstance createProcessInstance(String processId, org.kie.internal.process.CorrelationKey correlationKey, Map<String,Object> parameters)
           
 org.kie.api.runtime.process.ProcessInstance createProcessInstance(String processId, Map<String,Object> parameters)
           
 void delete(org.kie.api.runtime.rule.FactHandle factHandle)
           
 void delete(FactHandle factHandle, Rule rule, Activation activation)
           
 void destroy()
           
 void dispose()
           
 void endOperation()
           
<T> T
execute(org.kie.api.command.Command<T> command)
           
<T> T
execute(org.kie.internal.command.Context context, org.kie.api.command.Command<T> command)
           
 void executeQueuedActions()
           
 int fireAllRules()
           
 int fireAllRules(org.kie.api.runtime.rule.AgendaFilter agendaFilter)
           
 int fireAllRules(org.kie.api.runtime.rule.AgendaFilter agendaFilter, int max)
           
 int fireAllRules(int max)
           
 void fireUntilHalt()
           
 void fireUntilHalt(org.kie.api.runtime.rule.AgendaFilter agendaFilter)
           
 Queue<WorkingMemoryAction> getActionQueue()
           
 org.kie.api.runtime.rule.Agenda getAgenda()
           
 Collection<org.kie.api.event.rule.AgendaEventListener> getAgendaEventListeners()
           
 org.kie.api.runtime.Calendars getCalendars()
           
 Map<String,org.kie.api.runtime.Channel> getChannels()
           
 EntryPoint getEntryPoint()
           
 org.kie.api.runtime.rule.SessionEntryPoint getEntryPoint(String name)
           
 String getEntryPointId()
           
 EntryPointNode getEntryPointNode()
           
 Collection<? extends org.kie.api.runtime.rule.SessionEntryPoint> getEntryPoints()
           
 org.kie.api.runtime.Environment getEnvironment()
           
 long getFactCount()
           
 org.kie.api.runtime.rule.FactHandle getFactHandle(Object object)
           
 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)
           
 Object getGlobal(String identifier)
           
 org.kie.api.runtime.Globals getGlobals()
           
 int getId()
           
 InternalWorkingMemory getInternalWorkingMemory()
           
 org.kie.internal.KnowledgeBase getKieBase()
           
 long getLastIdleTimestamp()
           
 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()
           
 Collection<org.kie.api.event.process.ProcessEventListener> getProcessEventListeners()
           
 org.kie.api.runtime.process.ProcessInstance getProcessInstance(org.kie.internal.process.CorrelationKey correlationKey)
           
 org.kie.api.runtime.process.ProcessInstance getProcessInstance(long id)
           
 org.kie.api.runtime.process.ProcessInstance getProcessInstance(long id, boolean readOnly)
           
 Collection<org.kie.api.runtime.process.ProcessInstance> getProcessInstances()
           
 InternalProcessRuntime getProcessRuntime()
           
 org.kie.api.runtime.rule.QueryResults getQueryResults(String query, Object... arguments)
           
 RuleBase getRuleBase()
           
<T extends org.kie.api.time.SessionClock>
T
getSessionClock()
           
 org.kie.api.runtime.KieSessionConfiguration getSessionConfiguration()
           
 TimerService getTimerService()
           
 Collection<org.kie.api.event.rule.WorkingMemoryEventListener> getWorkingMemoryEventListeners()
           
 org.kie.api.runtime.process.WorkItemManager getWorkItemManager()
           
 void halt()
           
 org.kie.api.runtime.rule.FactHandle insert(Object object)
           
 org.kie.api.runtime.rule.LiveQuery openLiveQuery(String query, Object[] arguments, org.kie.api.runtime.rule.ViewChangedEventListener listener)
           
 void queueWorkingMemoryAction(WorkingMemoryAction action)
           
 void registerChannel(String name, org.kie.api.runtime.Channel channel)
           
 void removeEventListener(org.kie.api.event.rule.AgendaEventListener listener)
           
 void removeEventListener(org.kie.api.event.process.ProcessEventListener listener)
           
 void removeEventListener(org.kie.api.event.rule.WorkingMemoryEventListener listener)
           
 void reset()
           
 void retract(org.kie.api.runtime.rule.FactHandle factHandle)
           
 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.kie.api.runtime.process.ProcessInstance startProcess(String processId)
           
 org.kie.api.runtime.process.ProcessInstance startProcess(String processId, org.kie.internal.process.CorrelationKey correlationKey, Map<String,Object> parameters)
           
 org.kie.api.runtime.process.ProcessInstance startProcess(String processId, Map<String,Object> parameters)
           
 org.kie.api.runtime.process.ProcessInstance startProcessInstance(long processInstanceId)
           
 void unregisterChannel(String name)
           
 void update(org.kie.api.runtime.rule.FactHandle factHandle)
           
 void update(org.kie.api.runtime.rule.FactHandle factHandle, Object object)
           
 void update(org.kie.api.runtime.rule.FactHandle factHandle, Object object, long mask, Class<?> modifiedClass, 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.kie.internal.KnowledgeBase kbase
Constructor Detail

StatefulKnowledgeSessionImpl

public StatefulKnowledgeSessionImpl(ReteooWorkingMemory session)

StatefulKnowledgeSessionImpl

public StatefulKnowledgeSessionImpl(ReteooWorkingMemory session,
                                    org.kie.internal.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.kie.api.runtime.KieSession

getEntryPoint

public org.kie.api.runtime.rule.SessionEntryPoint getEntryPoint(String name)
Specified by:
getEntryPoint in interface org.kie.api.runtime.rule.Session

getEntryPoints

public Collection<? extends org.kie.api.runtime.rule.SessionEntryPoint> getEntryPoints()
Specified by:
getEntryPoints in interface org.kie.api.runtime.rule.Session

addEventListener

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

removeEventListener

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

getWorkingMemoryEventListeners

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

addEventListener

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

getAgendaEventListeners

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

removeEventListener

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

addEventListener

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

getProcessEventListeners

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

removeEventListener

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

getKieBase

public org.kie.internal.KnowledgeBase getKieBase()
Specified by:
getKieBase in interface org.kie.api.runtime.KieRuntime
Specified by:
getKieBase in interface org.kie.internal.runtime.StatefulKnowledgeSession

fireAllRules

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

fireAllRules

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

fireAllRules

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

fireAllRules

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

fireUntilHalt

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

fireUntilHalt

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

getSessionClock

public <T extends org.kie.api.time.SessionClock> T getSessionClock()
Specified by:
getSessionClock in interface org.kie.api.runtime.KieRuntime

halt

public void halt()
Specified by:
halt in interface org.kie.api.runtime.rule.Session

dispose

public void dispose()
Specified by:
dispose in interface org.kie.api.runtime.KieSession

destroy

public void destroy()
Specified by:
destroy in interface org.kie.api.runtime.KieSession

insert

public org.kie.api.runtime.rule.FactHandle insert(Object object)
Specified by:
insert in interface org.kie.api.runtime.rule.SessionEntryPoint

retract

public void retract(org.kie.api.runtime.rule.FactHandle factHandle)
Specified by:
retract in interface org.kie.api.runtime.rule.SessionEntryPoint

delete

public void delete(org.kie.api.runtime.rule.FactHandle factHandle)
Specified by:
delete in interface org.kie.api.runtime.rule.SessionEntryPoint

update

public void update(org.kie.api.runtime.rule.FactHandle factHandle)

update

public void update(org.kie.api.runtime.rule.FactHandle factHandle,
                   Object object)
Specified by:
update in interface org.kie.api.runtime.rule.SessionEntryPoint

getFactHandle

public org.kie.api.runtime.rule.FactHandle getFactHandle(Object object)
Specified by:
getFactHandle in interface org.kie.api.runtime.rule.SessionEntryPoint

getObject

public Object getObject(org.kie.api.runtime.rule.FactHandle factHandle)
Specified by:
getObject in interface org.kie.api.runtime.rule.SessionEntryPoint

getProcessInstance

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

getProcessInstance

public org.kie.api.runtime.process.ProcessInstance getProcessInstance(long id,
                                                                      boolean readOnly)
Specified by:
getProcessInstance in interface org.kie.api.runtime.process.ProcessRuntime

abortProcessInstance

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

getProcessInstances

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

getWorkItemManager

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

startProcess

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

startProcess

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

createProcessInstance

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

startProcessInstance

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

signalEvent

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

signalEvent

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

setGlobal

public void setGlobal(String identifier,
                      Object object)
Specified by:
setGlobal in interface org.kie.api.runtime.KieRuntime

getGlobal

public Object getGlobal(String identifier)
Specified by:
getGlobal in interface org.kie.api.runtime.KieRuntime

getGlobals

public org.kie.api.runtime.Globals getGlobals()
Specified by:
getGlobals in interface org.kie.api.runtime.KieRuntime

getCalendars

public org.kie.api.runtime.Calendars getCalendars()
Specified by:
getCalendars in interface org.kie.api.runtime.KieRuntime

getEnvironment

public org.kie.api.runtime.Environment getEnvironment()
Specified by:
getEnvironment in interface org.kie.api.runtime.KieRuntime

getFactHandles

public <T extends org.kie.api.runtime.rule.FactHandle> Collection<T> getFactHandles()
Specified by:
getFactHandles in interface org.kie.api.runtime.rule.SessionEntryPoint

getFactHandles

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

getObjects

public Collection<? extends Object> getObjects()
Specified by:
getObjects in interface org.kie.api.runtime.rule.SessionEntryPoint

getObjects

public Collection<? extends Object> getObjects(org.kie.api.runtime.ObjectFilter filter)
Specified by:
getObjects in interface org.kie.api.runtime.rule.SessionEntryPoint

delete

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

update

public void update(org.kie.api.runtime.rule.FactHandle factHandle,
                   Object object,
                   long mask,
                   Class<?> modifiedClass,
                   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.kie.api.runtime.rule.Agenda getAgenda()
Specified by:
getAgenda in interface org.kie.api.runtime.rule.Session

registerChannel

public void registerChannel(String name,
                            org.kie.api.runtime.Channel channel)
Specified by:
registerChannel in interface org.kie.api.runtime.KieRuntime

unregisterChannel

public void unregisterChannel(String name)
Specified by:
unregisterChannel in interface org.kie.api.runtime.KieRuntime

getChannels

public Map<String,org.kie.api.runtime.Channel> getChannels()
Specified by:
getChannels in interface org.kie.api.runtime.KieRuntime

getObjectTypeConfigurationRegistry

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

getRuleBase

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

getQueryResults

public org.kie.api.runtime.rule.QueryResults getQueryResults(String query,
                                                             Object... arguments)
Specified by:
getQueryResults in interface org.kie.api.runtime.rule.Session

execute

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

execute

public <T> T execute(org.kie.internal.command.Context context,
                     org.kie.api.command.Command<T> command)

getEntryPointId

public String getEntryPointId()
Specified by:
getEntryPointId in interface org.kie.api.runtime.rule.SessionEntryPoint

getFactCount

public long getFactCount()
Specified by:
getFactCount in interface org.kie.api.runtime.rule.SessionEntryPoint

openLiveQuery

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

getSessionConfiguration

public org.kie.api.runtime.KieSessionConfiguration getSessionConfiguration()
Specified by:
getSessionConfiguration in interface org.kie.api.runtime.KieRuntime

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

startProcess

public org.kie.api.runtime.process.ProcessInstance startProcess(String processId,
                                                                org.kie.internal.process.CorrelationKey correlationKey,
                                                                Map<String,Object> parameters)
Specified by:
startProcess in interface org.kie.internal.process.CorrelationAwareProcessRuntime

createProcessInstance

public org.kie.api.runtime.process.ProcessInstance createProcessInstance(String processId,
                                                                         org.kie.internal.process.CorrelationKey correlationKey,
                                                                         Map<String,Object> parameters)
Specified by:
createProcessInstance in interface org.kie.internal.process.CorrelationAwareProcessRuntime

getProcessInstance

public org.kie.api.runtime.process.ProcessInstance getProcessInstance(org.kie.internal.process.CorrelationKey correlationKey)
Specified by:
getProcessInstance in interface org.kie.internal.process.CorrelationAwareProcessRuntime

Drools :: Core 6.0.0.Beta5

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