Package org.drools.core.common
Class DefaultEventHandle
- java.lang.Object
-
- org.drools.core.util.AbstractBaseLinkedListNode<DefaultFactHandle>
-
- org.drools.core.common.DefaultFactHandle
-
- org.drools.core.common.DefaultEventHandle
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.lang.Comparable<DefaultEventHandle>,InternalFactHandle,Entry<DefaultFactHandle>,LinkedListNode<DefaultFactHandle>,org.kie.api.runtime.rule.EventHandle,org.kie.api.runtime.rule.FactHandle
public class DefaultEventHandle extends DefaultFactHandle implements org.kie.api.runtime.rule.EventHandle, java.lang.Comparable<DefaultEventHandle>
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.drools.core.common.DefaultFactHandle
DefaultFactHandle.CompositeLinkedTuples, DefaultFactHandle.DummyLinkedTuples, 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, objectClassName, objectHashCode, recency, wmEntryPoint
-
-
Constructor Summary
Constructors Modifier Constructor Description DefaultEventHandle()protectedDefaultEventHandle(long id, int identityHashCode, java.lang.Object object, long recency, long timestamp, long duration, org.drools.base.rule.EntryPointId entryPointId)DefaultEventHandle(long id, java.lang.Object object, long recency, long timestamp, long duration, WorkingMemoryEntryPoint wmEntryPoint)Creates a new event fact handle.DefaultEventHandle(long id, org.drools.base.rule.EntryPointId entryPointId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddJob(DefaultJobHandle job)DefaultEventHandleclone()DefaultEventHandlecloneAndLink()intcompareTo(DefaultEventHandle e)voiddecreaseOtnCount()longgetDuration()Returns the duration of this event.longgetEndTimestamp()Returns the end timestamp for this event.protected java.lang.StringgetFormatVersion()DefaultEventHandlegetLinkedFactHandle()intgetOtnCount()longgetStartTimestamp()Returns the timestamp of the occurrence of this event.voidincreaseOtnCount()voidinvalidate()booleanisEvent()Always returns true, since the EventFactHandle is only used for Events, and not for regular FactsbooleanisExpired()booleanisPendingRemoveFromStore()booleanisValid()voidquickCloneUpdate(DefaultFactHandle clone)voidremoveJob(DefaultJobHandle job)voidsetExpired(boolean expired)voidsetOtnCount(int otnCount)voidsetPendingRemoveFromStore(boolean pendingRemove)java.lang.StringtoString()voidunscheduleAllJobs(ReteEvaluator reteEvaluator)-
Methods inherited from class org.drools.core.common.DefaultFactHandle
addFirstLeftTuple, addLastLeftTuple, addLastRightTuple, addTupleInPosition, as, clearLeftTuples, clearRightTuples, createFromExternalFormat, detachLinkedTuples, detachLinkedTuplesForPartition, determineIdentityHashCode, disconnect, equals, findFirstLeftTuple, forEachLeftTuple, forEachRightTuple, getEntryPoint, getEntryPointId, getEqualityKey, getExternalForm, getFirstLeftTuple, getFirstRightTuple, getId, getIdentityHashCode, getLinkedTuples, getObject, getObjectClassName, getObjectHashCode, getRecency, getReteEvaluator, getTraitType, hashCode, isDisconnected, isNegated, isTraitable, isTraiting, isTraitOrTraitable, removeLeftTuple, removeRightTuple, setDisconnected, setEqualityKey, setExternalForm, setIdentityHashCode, setLinkedTuples, setNegated, setObject, setObjectHashCode, 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, hasMatches
-
-
-
-
Constructor Detail
-
DefaultEventHandle
public DefaultEventHandle()
-
DefaultEventHandle
public DefaultEventHandle(long id, org.drools.base.rule.EntryPointId entryPointId)
-
DefaultEventHandle
public DefaultEventHandle(long id, java.lang.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.
-
DefaultEventHandle
protected DefaultEventHandle(long id, int identityHashCode, java.lang.Object object, long recency, long timestamp, long duration, org.drools.base.rule.EntryPointId entryPointId)
-
-
Method Detail
-
getFormatVersion
protected java.lang.String getFormatVersion()
- Overrides:
getFormatVersionin classDefaultFactHandle
-
toString
public java.lang.String toString()
- Overrides:
toStringin 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:
isEventin interfaceorg.kie.api.runtime.rule.FactHandle- Specified by:
isEventin interfaceInternalFactHandle- Overrides:
isEventin classDefaultFactHandle
-
getStartTimestamp
public long getStartTimestamp()
Returns the timestamp of the occurrence of this event.- Specified by:
getStartTimestampin interfaceorg.kie.api.runtime.rule.EventHandle- Returns:
-
getDuration
public long getDuration()
Returns the duration of this event. In case this is a primitive event, returns 0 (zero).- Specified by:
getDurationin interfaceorg.kie.api.runtime.rule.EventHandle- Returns:
-
getEndTimestamp
public long getEndTimestamp()
Returns the end timestamp for this event. This is the same as: startTimestamp + duration- Specified by:
getEndTimestampin interfaceorg.kie.api.runtime.rule.EventHandle- Returns:
-
getLinkedFactHandle
public DefaultEventHandle getLinkedFactHandle()
-
invalidate
public void invalidate()
- Specified by:
invalidatein interfaceInternalFactHandle- Overrides:
invalidatein classDefaultFactHandle
-
isValid
public boolean isValid()
- Specified by:
isValidin interfaceorg.kie.api.runtime.rule.FactHandle- Specified by:
isValidin interfaceInternalFactHandle- Overrides:
isValidin classDefaultFactHandle
-
isExpired
public boolean isExpired()
- Specified by:
isExpiredin interfaceorg.kie.api.runtime.rule.EventHandle- Specified by:
isExpiredin interfaceInternalFactHandle- Overrides:
isExpiredin classDefaultFactHandle
-
setExpired
public void setExpired(boolean expired)
-
isPendingRemoveFromStore
public boolean isPendingRemoveFromStore()
- Specified by:
isPendingRemoveFromStorein interfaceInternalFactHandle- Overrides:
isPendingRemoveFromStorein classDefaultFactHandle
-
setPendingRemoveFromStore
public void setPendingRemoveFromStore(boolean pendingRemove)
-
increaseOtnCount
public void increaseOtnCount()
-
decreaseOtnCount
public void decreaseOtnCount()
-
getOtnCount
public int getOtnCount()
-
setOtnCount
public void setOtnCount(int otnCount)
-
clone
public DefaultEventHandle clone()
- Specified by:
clonein interfaceInternalFactHandle- Overrides:
clonein classDefaultFactHandle
-
cloneAndLink
public DefaultEventHandle cloneAndLink()
-
quickCloneUpdate
public void quickCloneUpdate(DefaultFactHandle clone)
-
compareTo
public int compareTo(DefaultEventHandle e)
- Specified by:
compareToin interfacejava.lang.Comparable<DefaultEventHandle>
-
addJob
public void addJob(DefaultJobHandle job)
-
removeJob
public void removeJob(DefaultJobHandle job)
-
unscheduleAllJobs
public void unscheduleAllJobs(ReteEvaluator reteEvaluator)
-
-