org.drools.rule
Class SlidingTimeWindow
java.lang.Object
org.drools.rule.SlidingTimeWindow
- All Implemented Interfaces:
- Externalizable, Serializable, Cloneable, Behavior, RuleComponent
public class SlidingTimeWindow
- extends Object
- implements Externalizable, Behavior
- See Also:
- Serialized Form
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:
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:
assertRightTuple
public boolean assertRightTuple(PropagationContext pctx,
Object context,
RightTuple rightTuple,
InternalWorkingMemory workingMemory)
- Description copied from interface:
Behavior
- Makes the behavior aware of the new fact entering behavior's scope
- Specified by:
assertRightTuple
in interface Behavior
context
- The behavior context objectrightTuple
- 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.
- See Also:
org.drools.rule.Behavior#assertRightTuple(java.lang.Object, org.drools.reteoo.RightTuple, org.drools.common.InternalWorkingMemory)
retractRightTuple
public void retractRightTuple(Object context,
RightTuple rightTuple,
InternalWorkingMemory workingMemory)
- Description copied from interface:
Behavior
- Removes a right tuple from the behavior's scope
- Specified by:
retractRightTuple
in interface Behavior
- Parameters:
context
- The behavior context objectrightTuple
- The tuple leaving the behavior's scopeworkingMemory
- The working memory session reference- See Also:
Behavior.retractRightTuple(java.lang.Object, org.drools.reteoo.RightTuple, org.drools.common.InternalWorkingMemory)
expireTuples
public void expireTuples(Object context,
InternalWorkingMemory workingMemory)
- Description copied from interface:
Behavior
- A callback method that allows behaviors to expire tuples
- Specified by:
expireTuples
in interface Behavior
- Parameters:
context
- 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-2012 JBoss by Red Hat. All Rights Reserved.