org.drools.io
Class SerializableRuleBaseProxy

java.lang.Object
  extended by org.drools.io.SerializableRuleBaseProxy
All Implemented Interfaces:
java.io.Serializable, RuleBase

public class SerializableRuleBaseProxy
extends java.lang.Object
implements RuleBase

This wraps a rulebase, and makes it serializable by storing the binary ruleset data.

See Also:
Serialized Form

Constructor Summary
SerializableRuleBaseProxy()
           
SerializableRuleBaseProxy(RuleBase ruleBase, java.util.List ruleSetBinaries)
           
 
Method Summary
 ConflictResolver getConflictResolver()
          Retrieve the ConflictResolver.
 WorkingMemory getCurrentThreadWorkingMemory()
          Get or create a WorkingMemory session for this RuleBase and the current thread.
 RuleBaseContext getRuleBaseContext()
           
 java.util.List getRuleSets()
           
 RuleBase getWrappedRuleBase()
           
 WorkingMemory newWorkingMemory()
          Create a new WorkingMemory session for this RuleBase.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SerializableRuleBaseProxy

public SerializableRuleBaseProxy()

SerializableRuleBaseProxy

public SerializableRuleBaseProxy(RuleBase ruleBase,
                                 java.util.List ruleSetBinaries)
Method Detail

newWorkingMemory

public WorkingMemory newWorkingMemory()
Description copied from interface: RuleBase
Create a new WorkingMemory session for this RuleBase.

The created WorkingMemory uses the default conflict resolution strategy.

Specified by:
newWorkingMemory in interface RuleBase
Returns:
A newly initialized WorkingMemory.
See Also:
WorkingMemory, DefaultConflictResolver

getConflictResolver

public ConflictResolver getConflictResolver()
Description copied from interface: RuleBase
Retrieve the ConflictResolver.

Specified by:
getConflictResolver in interface RuleBase
Returns:
The conflict resolution strategy.

getRuleSets

public java.util.List getRuleSets()
Specified by:
getRuleSets in interface RuleBase

getRuleBaseContext

public RuleBaseContext getRuleBaseContext()
Specified by:
getRuleBaseContext in interface RuleBase

getCurrentThreadWorkingMemory

public WorkingMemory getCurrentThreadWorkingMemory()
Description copied from interface: RuleBase
Get or create a WorkingMemory session for this RuleBase and the current thread.

This is useful for web application users, and allows a long running working memory that will be garbage collected when the thread ends. Uses a ThreadLocal instance.

The created WorkingMemory uses the default conflict resolution strategy.

Specified by:
getCurrentThreadWorkingMemory in interface RuleBase
Returns:
the current threads WorkingMemory or a new one if the current thread did not have a working memory assigned.
See Also:
WorkingMemory, DefaultConflictResolver

getWrappedRuleBase

public RuleBase getWrappedRuleBase()