org.drools.core.rule
Class SlidingTimeWindow
java.lang.Object
org.drools.core.rule.SlidingTimeWindow
- All Implemented Interfaces:
- Externalizable, Serializable, Cloneable, Behavior, RuleComponent
public class SlidingTimeWindow
- extends Object
- implements Externalizable, Behavior
- See Also:
- Serialized Form
|
Method Summary |
boolean |
assertFact(WindowNode.WindowMemory memory,
Object context,
InternalFactHandle fact,
PropagationContext pctx,
InternalWorkingMemory workingMemory)
Makes the behavior aware of the new fact entering behavior's scope |
Object |
createContext()
Creates the context object associated with this behavior. |
void |
expireFacts(WindowNode.WindowMemory memory,
Object context,
PropagationContext pctx,
InternalWorkingMemory workingMemory)
A callback method that allows behaviors to expire facts |
long |
getExpirationOffset()
Some behaviors might change the expiration offset for the
associated fact type. |
long |
getSize()
|
Behavior.BehaviorType |
getType()
Returns the type of the behavior |
void |
readExternal(ObjectInput in)
|
void |
retractFact(WindowNode.WindowMemory memory,
Object context,
InternalFactHandle fact,
PropagationContext pctx,
InternalWorkingMemory workingMemory)
Removes a right tuple from the behavior's scope |
void |
setSize(long size)
|
void |
setWindowNode(WindowNode windowNode)
|
String |
toString()
|
void |
writeExternal(ObjectOutput out)
|
job
public static final SlidingTimeWindow.BehaviorJob job
SlidingTimeWindow
public SlidingTimeWindow()
SlidingTimeWindow
public SlidingTimeWindow(long size)
- Parameters:
size -
readExternal
public void readExternal(ObjectInput in)
throws IOException,
ClassNotFoundException
- Specified by:
readExternal in interface Externalizable
- Throws:
IOException
ClassNotFoundException- See Also:
Externalizable.readExternal(java.io.ObjectInput)
writeExternal
public void writeExternal(ObjectOutput out)
throws IOException
- Specified by:
writeExternal in interface Externalizable
- Throws:
IOException- See Also:
Externalizable.writeExternal(java.io.ObjectOutput)
getType
public Behavior.BehaviorType getType()
- Description copied from interface:
Behavior
- Returns the type of the behavior
- Specified by:
getType in interface Behavior
- Returns:
setWindowNode
public void setWindowNode(WindowNode windowNode)
getSize
public long getSize()
- Returns:
- the size
setSize
public void setSize(long size)
- Parameters:
size - the size to set
createContext
public Object createContext()
- Description copied from interface:
Behavior
- Creates the context object associated with this behavior.
The object is given as a parameter in all behavior call backs.
- Specified by:
createContext in interface Behavior
- Returns:
assertFact
public boolean assertFact(WindowNode.WindowMemory memory,
Object context,
InternalFactHandle fact,
PropagationContext pctx,
InternalWorkingMemory workingMemory)
- Description copied from interface:
Behavior
- Makes the behavior aware of the new fact entering behavior's scope
- Specified by:
assertFact in interface Behavior
- Parameters:
memory - The window node memorycontext - The behavior context objectfact - The new fact entering behavior's scopeworkingMemory - The working memory session reference
- Returns:
- true if the propagation should continue, false otherwise. I.e.,
the behaviour has veto power over the fact propagation, and prevents
the propagation to continue if returns false on this method.
retractFact
public void retractFact(WindowNode.WindowMemory memory,
Object context,
InternalFactHandle fact,
PropagationContext pctx,
InternalWorkingMemory workingMemory)
- Description copied from interface:
Behavior
- Removes a right tuple from the behavior's scope
- Specified by:
retractFact in interface Behavior
- Parameters:
memory - The window node memorycontext - The behavior context objectfact - The fact leaving the behavior's scopeworkingMemory - The working memory session reference
expireFacts
public void expireFacts(WindowNode.WindowMemory memory,
Object context,
PropagationContext pctx,
InternalWorkingMemory workingMemory)
- Description copied from interface:
Behavior
- A callback method that allows behaviors to expire facts
- Specified by:
expireFacts in interface Behavior
- Parameters:
memory - The window node memorycontext - The behavior context objectworkingMemory - The working memory session reference
getExpirationOffset
public long getExpirationOffset()
- Description copied from interface:
Behavior
- Some behaviors might change the expiration offset for the
associated fact type. Example: time sliding windows.
For these behaviors, this method must return the expiration
offset associated to them.
- Specified by:
getExpirationOffset in interface Behavior
- Returns:
- the expiration offset for this behavior or -1 if
they don't have a time based expiration offset.
toString
public String toString()
- Overrides:
toString in class Object
Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.