public class SlidingTimeWindow extends Object implements Externalizable, Behavior
Modifier and Type | Class and Description |
---|---|
static class |
SlidingTimeWindow.BehaviorExpireWMAction |
static class |
SlidingTimeWindow.BehaviorJob |
static class |
SlidingTimeWindow.BehaviorJobContext |
static class |
SlidingTimeWindow.BehaviorJobContextTimerInputMarshaller |
static class |
SlidingTimeWindow.BehaviorJobContextTimerOutputMarshaller |
static class |
SlidingTimeWindow.SlidingTimeWindowContext |
Behavior.BehaviorType, Behavior.Context
Modifier and Type | Field and Description |
---|---|
protected int |
nodeId |
protected long |
size |
Constructor and Description |
---|
SlidingTimeWindow() |
SlidingTimeWindow(long size) |
Modifier and Type | Method and Description |
---|---|
boolean |
assertFact(Object context,
InternalFactHandle fact,
PropagationContext pctx,
InternalWorkingMemory workingMemory)
Makes the behavior aware of the new fact entering behavior's scope
|
Behavior.Context |
createContext()
Creates the context object associated with this behavior.
|
void |
expireFacts(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
|
protected boolean |
isExpired(long currentTime,
EventFactHandle handle) |
void |
readExternal(ObjectInput in) |
void |
retractFact(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() |
protected void |
updateNextExpiration(InternalFactHandle fact,
InternalWorkingMemory workingMemory,
Behavior.Context context,
int nodeId) |
void |
writeExternal(ObjectOutput out) |
public SlidingTimeWindow()
public SlidingTimeWindow(long size)
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
Externalizable.readExternal(java.io.ObjectInput)
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
Externalizable.writeExternal(java.io.ObjectOutput)
public Behavior.BehaviorType getType()
Behavior
public void setWindowNode(WindowNode windowNode)
public long getSize()
public void setSize(long size)
size
- the size to setpublic Behavior.Context createContext()
Behavior
createContext
in interface Behavior
public boolean assertFact(Object context, InternalFactHandle fact, PropagationContext pctx, InternalWorkingMemory workingMemory)
Behavior
assertFact
in interface Behavior
context
- The behavior context objectfact
- The new fact entering behavior's scopeworkingMemory
- The working memory session referencepublic void retractFact(Object context, InternalFactHandle fact, PropagationContext pctx, InternalWorkingMemory workingMemory)
Behavior
retractFact
in interface Behavior
context
- The behavior context objectfact
- The fact leaving the behavior's scopeworkingMemory
- The working memory session referencepublic void expireFacts(Object context, PropagationContext pctx, InternalWorkingMemory workingMemory)
Behavior
expireFacts
in interface Behavior
protected boolean isExpired(long currentTime, EventFactHandle handle)
protected void updateNextExpiration(InternalFactHandle fact, InternalWorkingMemory workingMemory, Behavior.Context context, int nodeId)
public long getExpirationOffset()
Behavior
getExpirationOffset
in interface Behavior
Copyright © 2001–2020 JBoss by Red Hat. All rights reserved.