public static class Accumulator.SafeAccumulator extends Object implements Accumulator
Accumulator.SafeAccumulator
Constructor and Description |
---|
Accumulator.SafeAccumulator(Accumulator delegate) |
Modifier and Type | Method and Description |
---|---|
void |
accumulate(Object workingMemoryContext,
Object context,
Tuple leftTuple,
InternalFactHandle handle,
Declaration[] declarations,
Declaration[] innerDeclarations,
WorkingMemory workingMemory)
Executes the accumulate (action) code for the given fact handle
|
Serializable |
createContext()
Creates the context object for an accumulator session.
|
Object |
createWorkingMemoryContext()
Creates and return a context object for each working memory instance
|
Object |
getResult(Object workingMemoryContext,
Object context,
Tuple leftTuple,
Declaration[] declarations,
WorkingMemory workingMemory)
Gets the result of the accummulation
|
void |
init(Object workingMemoryContext,
Object context,
Tuple leftTuple,
Declaration[] declarations,
WorkingMemory workingMemory)
Executes the initialization block of code
|
void |
reverse(Object workingMemoryContext,
Object context,
Tuple leftTuple,
InternalFactHandle handle,
Declaration[] declarations,
Declaration[] innerDeclarations,
WorkingMemory workingMemory)
Reverses the accumulate action for the given fact handle
|
boolean |
supportsReverse()
Returns true if this accumulator supports operation reversal
|
public Accumulator.SafeAccumulator(Accumulator delegate)
public Object createWorkingMemoryContext()
Accumulator
createWorkingMemoryContext
in interface Accumulator
public Serializable createContext()
Accumulator
createContext
in interface Accumulator
public void init(Object workingMemoryContext, Object context, Tuple leftTuple, Declaration[] declarations, WorkingMemory workingMemory) throws Exception
Accumulator
init
in interface Accumulator
leftTuple
- tuple causing the rule firedeclarations
- previous declarationsException
public void accumulate(Object workingMemoryContext, Object context, Tuple leftTuple, InternalFactHandle handle, Declaration[] declarations, Declaration[] innerDeclarations, WorkingMemory workingMemory) throws Exception
Accumulator
accumulate
in interface Accumulator
Exception
public boolean supportsReverse()
Accumulator
supportsReverse
in interface Accumulator
public void reverse(Object workingMemoryContext, Object context, Tuple leftTuple, InternalFactHandle handle, Declaration[] declarations, Declaration[] innerDeclarations, WorkingMemory workingMemory) throws Exception
Accumulator
reverse
in interface Accumulator
Exception
public Object getResult(Object workingMemoryContext, Object context, Tuple leftTuple, Declaration[] declarations, WorkingMemory workingMemory) throws Exception
Accumulator
getResult
in interface Accumulator
Exception
Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.