org.drools
Interface RuleBase

All Superinterfaces:
java.io.Serializable
All Known Subinterfaces:
InternalRuleBase
All Known Implementing Classes:
AbstractRuleBase

public interface RuleBase
extends java.io.Serializable

Active collection of Rules.

From a RuleBase many WorkingMemory rule sessions may be instantiated. Additionally, it may be inspected to determine which Package s it contains.

See Also:
WorkingMemory
 

Field Summary
static int LEAPS
           
static int RETEOO
           
 
Method Summary
 void addPackage(Package pkg)
           
 Package[] getPackages()
           
 java.util.Set getWorkingMemories()
           
 WorkingMemory newWorkingMemory()
          Create a new WorkingMemory session for this RuleBase.
 WorkingMemory newWorkingMemory(boolean keepReference)
          Create a new WorkingMemory session for this RuleBase.
 WorkingMemory newWorkingMemory(java.io.InputStream stream)
          RuleBases handle the returning of a Serialized WorkingMemory pass as an InputStream.
 WorkingMemory newWorkingMemory(java.io.InputStream stream, boolean keepReference)
          RuleBases handle the returning of a Serialized WorkingMemory pass as an InputStream.
 void removePackage(java.lang.String packageName)
           
 void removeRule(java.lang.String packageName, java.lang.String ruleName)
           
 

Field Detail

RETEOO

public static final int RETEOO
See Also:
Constant Field Values

LEAPS

public static final int LEAPS
See Also:
Constant Field Values
Method Detail

newWorkingMemory

public WorkingMemory newWorkingMemory()
Create a new WorkingMemory session for this RuleBase. By default the RuleBase retains a weak reference to returned WorkingMemory.

The created WorkingMemory uses the default conflict resolution strategy.

Returns:
A newly initialized WorkingMemory.
See Also:
WorkingMemory, DefaultConflictResolver

newWorkingMemory

public WorkingMemory newWorkingMemory(boolean keepReference)
Create a new WorkingMemory session for this RuleBase. Optionally the RuleBase retains a weak reference to returned WorkingMemory.

The created WorkingMemory uses the default conflict resolution strategy.

Returns:
A newly initialized WorkingMemory.
See Also:
WorkingMemory, DefaultConflictResolver

newWorkingMemory

public WorkingMemory newWorkingMemory(java.io.InputStream stream)
                               throws java.io.IOException,
                                      java.lang.ClassNotFoundException
RuleBases handle the returning of a Serialized WorkingMemory pass as an InputStream. If the reference is a byte[] then wrap with new ByteArrayInputStream. By default the RuleBase retains a weak reference to returned WorkingMemory.

The created WorkingMemory uses the default conflict resolution strategy.

Throws:
java.io.IOException
java.lang.ClassNotFoundException
Returns:
A serialised initialized WorkingMemory.
See Also:
WorkingMemory, DefaultConflictResolver

newWorkingMemory

public WorkingMemory newWorkingMemory(java.io.InputStream stream,
                                      boolean keepReference)
                               throws java.io.IOException,
                                      java.lang.ClassNotFoundException
RuleBases handle the returning of a Serialized WorkingMemory pass as an InputStream. If the reference is a byte[] then wrap with new ByteArrayInputStream. Optionally the RuleBase retains a weak reference to returned WorkingMemory.

The created WorkingMemory uses the default conflict resolution strategy.

Throws:
java.io.IOException
java.lang.ClassNotFoundException
Returns:
A serialised initialized WorkingMemory.
See Also:
WorkingMemory, DefaultConflictResolver

getPackages

public Package[] getPackages()

addPackage

public void addPackage(Package pkg)
                throws java.lang.Exception
Throws:
java.lang.Exception

removePackage

public void removePackage(java.lang.String packageName)

removeRule

public void removeRule(java.lang.String packageName,
                       java.lang.String ruleName)

getWorkingMemories

public java.util.Set getWorkingMemories()