Package org.drools.core.common
Class EventFactHandle
- java.lang.Object
-
- org.drools.core.util.AbstractBaseLinkedListNode<DefaultFactHandle>
-
- org.drools.core.common.DefaultFactHandle
-
- org.drools.core.common.EventFactHandle
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable<EventFactHandle>
,InternalFactHandle
,Entry<DefaultFactHandle>
,LinkedListNode<DefaultFactHandle>
,org.kie.api.runtime.rule.FactHandle
public class EventFactHandle extends DefaultFactHandle implements Comparable<EventFactHandle>
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.drools.core.common.DefaultFactHandle
DefaultFactHandle.CompositeLinkedTuples, DefaultFactHandle.SingleLinkedTuples
-
Nested classes/interfaces inherited from interface org.kie.api.runtime.rule.FactHandle
org.kie.api.runtime.rule.FactHandle.State
-
Nested classes/interfaces inherited from interface org.drools.core.common.InternalFactHandle
InternalFactHandle.DummyFactHandle, InternalFactHandle.LinkedTuples
-
-
Field Summary
-
Fields inherited from class org.drools.core.common.DefaultFactHandle
entryPointId, id, identityHashCode, linkedTuples, object, recency, traitType, wmEntryPoint
-
-
Constructor Summary
Constructors Modifier Constructor Description EventFactHandle()
protected
EventFactHandle(long id, int identityHashCode, Object object, long recency, long timestamp, long duration, EntryPointId entryPointId, TraitTypeEnum traitType)
EventFactHandle(long id, Object object, long recency, long timestamp, long duration, WorkingMemoryEntryPoint wmEntryPoint)
Creates a new event fact handle.EventFactHandle(long id, Object object, long recency, long timestamp, long duration, WorkingMemoryEntryPoint wmEntryPoint, boolean isTraitOrTraitable)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addJob(JobHandle job)
EventFactHandle
clone()
EventFactHandle
cloneAndLink()
int
compareTo(EventFactHandle e)
void
decreaseActivationsCount()
void
decreaseOtnCount()
boolean
expirePartition()
long
getActivationsCount()
long
getDuration()
Returns the duration of this event.long
getEndTimestamp()
Returns the end timestamp for this event.protected String
getFormatVersion()
EventFactHandle
getLinkedFactHandle()
int
getOtnCount()
long
getStartTimestamp()
Returns the timestamp of the occurrence of this event.void
increaseActivationsCount()
void
increaseOtnCount()
void
invalidate()
boolean
isEvent()
Always returns true, since the EventFactHandle is only used for Events, and not for regular Factsboolean
isExpired()
boolean
isPendingRemoveFromStore()
boolean
isValid()
void
quickCloneUpdate(DefaultFactHandle clone)
void
removeJob(JobHandle job)
void
setActivationsCount(long activationsCount)
void
setExpired(boolean expired)
void
setOtnCount(int otnCount)
void
setPendingRemoveFromStore(boolean pendingRemove)
String
toString()
void
unscheduleAllJobs(InternalWorkingMemory workingMemory)
-
Methods inherited from class org.drools.core.common.DefaultFactHandle
addFirstLeftTuple, addFirstRightTuple, addLastLeftTuple, addLastRightTuple, addTupleInPosition, as, clearLeftTuples, clearRightTuples, createFromExternalFormat, detachLinkedTuples, detachLinkedTuplesForPartition, determineIdentityHashCode, determineTraitType, disconnect, equals, findFirstLeftTuple, findFirstRightTuple, forEachLeftTuple, forEachRightTuple, getEntryPoint, getEntryPointId, getEqualityKey, getExternalForm, getFirstLeftTuple, getFirstRightTuple, getId, getIdentityHashCode, getLinkedTuples, getObject, getObjectClassName, getObjectHashCode, getParentHandle, getRecency, getTraitType, getWorkingMemory, hashCode, isDisconnected, isNegated, isTraitable, isTraiting, isTraitOrTraitable, removeLeftTuple, removeRightTuple, setDisconnected, setEqualityKey, setExternalForm, setFirstLeftTuple, setIdentityHashCode, setLinkedTuples, setNegated, setObject, setObjectHashCode, setParentHandle, setRecency, setTraitType, toExternalForm
-
Methods inherited from class org.drools.core.util.AbstractBaseLinkedListNode
getNext, getPrevious, nullPrevNext, setNext, setPrevious
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.drools.core.common.InternalFactHandle
getEntryPointName
-
-
-
-
Constructor Detail
-
EventFactHandle
public EventFactHandle()
-
EventFactHandle
public EventFactHandle(long id, Object object, long recency, long timestamp, long duration, WorkingMemoryEntryPoint wmEntryPoint)
Creates a new event fact handle.- Parameters:
id
- this event fact handle IDobject
- the event object encapsulated in this event fact handlerecency
- the recency of this event fact handletimestamp
- the timestamp of the occurrence of this eventduration
- the duration of this event. May be 0 (zero) in case this is a primitive event.
-
EventFactHandle
public EventFactHandle(long id, Object object, long recency, long timestamp, long duration, WorkingMemoryEntryPoint wmEntryPoint, boolean isTraitOrTraitable)
-
EventFactHandle
protected EventFactHandle(long id, int identityHashCode, Object object, long recency, long timestamp, long duration, EntryPointId entryPointId, TraitTypeEnum traitType)
-
-
Method Detail
-
getFormatVersion
protected String getFormatVersion()
- Overrides:
getFormatVersion
in classDefaultFactHandle
-
toString
public String toString()
- Overrides:
toString
in classDefaultFactHandle
- See Also:
Object
-
isEvent
public boolean isEvent()
Always returns true, since the EventFactHandle is only used for Events, and not for regular Facts- Specified by:
isEvent
in interfaceInternalFactHandle
- Overrides:
isEvent
in classDefaultFactHandle
- Returns:
-
getStartTimestamp
public long getStartTimestamp()
Returns the timestamp of the occurrence of this event.- Returns:
-
getDuration
public long getDuration()
Returns the duration of this event. In case this is a primitive event, returns 0 (zero).- Returns:
-
getEndTimestamp
public long getEndTimestamp()
Returns the end timestamp for this event. This is the same as: startTimestamp + duration- Returns:
-
getLinkedFactHandle
public EventFactHandle getLinkedFactHandle()
-
invalidate
public void invalidate()
- Specified by:
invalidate
in interfaceInternalFactHandle
- Overrides:
invalidate
in classDefaultFactHandle
-
isValid
public boolean isValid()
- Specified by:
isValid
in interfaceInternalFactHandle
- Overrides:
isValid
in classDefaultFactHandle
-
isExpired
public boolean isExpired()
- Specified by:
isExpired
in interfaceInternalFactHandle
- Overrides:
isExpired
in classDefaultFactHandle
-
expirePartition
public boolean expirePartition()
-
setExpired
public void setExpired(boolean expired)
-
isPendingRemoveFromStore
public boolean isPendingRemoveFromStore()
- Specified by:
isPendingRemoveFromStore
in interfaceInternalFactHandle
- Overrides:
isPendingRemoveFromStore
in classDefaultFactHandle
-
setPendingRemoveFromStore
public void setPendingRemoveFromStore(boolean pendingRemove)
-
getActivationsCount
public long getActivationsCount()
-
setActivationsCount
public void setActivationsCount(long activationsCount)
-
increaseActivationsCount
public void increaseActivationsCount()
-
decreaseActivationsCount
public void decreaseActivationsCount()
-
increaseOtnCount
public void increaseOtnCount()
-
decreaseOtnCount
public void decreaseOtnCount()
-
getOtnCount
public int getOtnCount()
-
setOtnCount
public void setOtnCount(int otnCount)
-
clone
public EventFactHandle clone()
- Specified by:
clone
in interfaceInternalFactHandle
- Overrides:
clone
in classDefaultFactHandle
-
cloneAndLink
public EventFactHandle cloneAndLink()
-
quickCloneUpdate
public void quickCloneUpdate(DefaultFactHandle clone)
-
compareTo
public int compareTo(EventFactHandle e)
- Specified by:
compareTo
in interfaceComparable<EventFactHandle>
-
addJob
public void addJob(JobHandle job)
-
removeJob
public void removeJob(JobHandle job)
-
unscheduleAllJobs
public void unscheduleAllJobs(InternalWorkingMemory workingMemory)
-
-