Knowledge API Legacy5 Adapter 6.0.0.Beta3

org.drools.impl.adapters
Class StatefulKnowledgeSessionAdapter

java.lang.Object
  extended by org.drools.impl.adapters.KnowledgeRuntimeAdapter
      extended by org.drools.impl.adapters.StatefulKnowledgeSessionAdapter
All Implemented Interfaces:
KnowledgeRuntimeEventManager, ProcessEventManager, WorkingMemoryEventManager, CommandExecutor, KnowledgeRuntime, ProcessRuntime, StatefulProcessSession, StatefulRuleSession, WorkingMemory, WorkingMemoryEntryPoint, StatefulKnowledgeSession

public class StatefulKnowledgeSessionAdapter
extends KnowledgeRuntimeAdapter
implements StatefulKnowledgeSession


Field Summary
 
Fields inherited from class org.drools.impl.adapters.KnowledgeRuntimeAdapter
delegate
 
Constructor Summary
StatefulKnowledgeSessionAdapter(org.kie.internal.runtime.StatefulKnowledgeSession delegate)
           
 
Method Summary
static List<StatefulKnowledgeSession> adaptStatefulKnowledgeSession(Collection<org.kie.internal.runtime.StatefulKnowledgeSession> sessions)
           
 void dispose()
          Releases all the current session resources, setting up the session for garbage collection.
<T> T
execute(Command<T> command)
          Execute the command and return a ExecutionResults for the results of the Command.
 int fireAllRules()
          Fire all Activations on the Agenda.
 int fireAllRules(AgendaFilter agendaFilter)
          Fire all Activations on the Agenda
 int fireAllRules(AgendaFilter agendaFilter, int max)
          Fire all Activations on the Agenda
 int fireAllRules(int max)
          Fire Activations on the Agenda up to the given maximum number of activations, before returning the control to the application.
 void fireUntilHalt()
          Keeps firing activations until a halt is called.
 void fireUntilHalt(AgendaFilter agendaFilter)
          Keeps firing activations until a halt is called.
 int getId()
           
 
Methods inherited from class org.drools.impl.adapters.KnowledgeRuntimeAdapter
abortProcessInstance, addEventListener, addEventListener, addEventListener, createProcessInstance, getAgenda, getAgendaEventListeners, getCalendars, getChannels, getEntryPointId, getEnvironment, getFactCount, getFactHandle, getFactHandles, getFactHandles, getGlobal, getGlobals, getKnowledgeBase, getObject, getObjects, getObjects, getProcessEventListeners, getProcessInstance, getProcessInstances, getQueryResults, getSessionClock, getSessionConfiguration, getWorkingMemoryEntryPoint, getWorkingMemoryEntryPoints, getWorkingMemoryEventListeners, getWorkItemManager, halt, insert, openLiveQuery, registerChannel, registerExitPoint, removeEventListener, removeEventListener, removeEventListener, retract, setGlobal, signalEvent, signalEvent, startProcess, startProcess, startProcessInstance, unregisterChannel, unregisterExitPoint, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.drools.runtime.KnowledgeRuntime
getCalendars, getChannels, getEnvironment, getGlobal, getGlobals, getKnowledgeBase, getSessionClock, getSessionConfiguration, registerChannel, registerExitPoint, setGlobal, unregisterChannel, unregisterExitPoint
 
Methods inherited from interface org.drools.runtime.rule.WorkingMemory
getAgenda, getQueryResults, getWorkingMemoryEntryPoint, getWorkingMemoryEntryPoints, halt, openLiveQuery
 
Methods inherited from interface org.drools.runtime.rule.WorkingMemoryEntryPoint
getEntryPointId, getFactCount, getFactHandle, getFactHandles, getFactHandles, getObject, getObjects, getObjects, insert, retract, update
 
Methods inherited from interface org.drools.runtime.process.ProcessRuntime
abortProcessInstance, createProcessInstance, getProcessInstance, getProcessInstances, getWorkItemManager, signalEvent, signalEvent, startProcess, startProcess, startProcessInstance
 
Methods inherited from interface org.drools.event.rule.WorkingMemoryEventManager
addEventListener, addEventListener, getAgendaEventListeners, getWorkingMemoryEventListeners, removeEventListener, removeEventListener
 
Methods inherited from interface org.drools.event.process.ProcessEventManager
addEventListener, getProcessEventListeners, removeEventListener
 

Constructor Detail

StatefulKnowledgeSessionAdapter

public StatefulKnowledgeSessionAdapter(org.kie.internal.runtime.StatefulKnowledgeSession delegate)
Method Detail

getId

public int getId()
Specified by:
getId in interface StatefulKnowledgeSession

dispose

public void dispose()
Description copied from interface: StatefulKnowledgeSession
Releases all the current session resources, setting up the session for garbage collection. This method must always be called after finishing using the session, or the engine will not free the memory used by the session.

Specified by:
dispose in interface StatefulKnowledgeSession

execute

public <T> T execute(Command<T> command)
Description copied from interface: CommandExecutor
Execute the command and return a ExecutionResults for the results of the Command.

Specified by:
execute in interface CommandExecutor
Returns:

fireAllRules

public int fireAllRules()
Description copied from interface: StatefulRuleSession
Fire all Activations on the Agenda.

Specified by:
fireAllRules in interface StatefulRuleSession
Returns:
returns the number of rules fired

fireAllRules

public int fireAllRules(int max)
Description copied from interface: StatefulRuleSession
Fire Activations on the Agenda up to the given maximum number of activations, before returning the control to the application. In case the application wants to continue firing the rules later, from the point where it stopped, it just needs to call fireAllRules() again.

Specified by:
fireAllRules in interface StatefulRuleSession
Parameters:
max - the maximum number of rules that should be fired
Returns:
returns the number of rules fired

fireAllRules

public int fireAllRules(AgendaFilter agendaFilter)
Description copied from interface: StatefulRuleSession
Fire all Activations on the Agenda

Specified by:
fireAllRules in interface StatefulRuleSession
Parameters:
agendaFilter - filters the activations that may fire
Returns:
returns the number of rules fired

fireAllRules

public int fireAllRules(AgendaFilter agendaFilter,
                        int max)
Description copied from interface: StatefulRuleSession
Fire all Activations on the Agenda

Specified by:
fireAllRules in interface StatefulRuleSession
Parameters:
agendaFilter - filters the activations that may fire
max - the maximum number of rules that should be fired
Returns:
returns the number of rules fired

fireUntilHalt

public void fireUntilHalt()
Description copied from interface: StatefulRuleSession
Keeps firing activations until a halt is called. If in a given moment, there is no activation to fire, it will wait for an activation to be added to an active agenda group or rule flow group. This blocks the thread until halt is called.

Specified by:
fireUntilHalt in interface StatefulRuleSession

fireUntilHalt

public void fireUntilHalt(AgendaFilter agendaFilter)
Description copied from interface: StatefulRuleSession
Keeps firing activations until a halt is called. If in a given moment, there is no activation to fire, it will wait for an activation to be added to an active agenda group or rule flow group. This blocks the thread until halt is called.

Specified by:
fireUntilHalt in interface StatefulRuleSession
Parameters:
agendaFilter - filters the activations that may fire

adaptStatefulKnowledgeSession

public static List<StatefulKnowledgeSession> adaptStatefulKnowledgeSession(Collection<org.kie.internal.runtime.StatefulKnowledgeSession> sessions)

Knowledge API Legacy5 Adapter 6.0.0.Beta3

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