public abstract class Event extends Entity
Modifier and Type | Field and Description |
---|---|
protected static java.lang.Boolean |
_DEFAULT_RETRY_ON_EXCEPTION |
protected static java.lang.Long |
_DEFAULT_TIME_TO_LIVE |
protected static java.lang.String |
_INVALID_TIMER_IDENTIFIER |
protected static java.lang.String |
_TIME_TO_LIVE_UNITS_DEFAULT |
static java.lang.String |
TIME_TO_LIVE_UNITS_DAYS
TimeToLiveUnits value, in days.
|
static java.lang.String |
TIME_TO_LIVE_UNITS_HOURS
TimeToLiveUnits value, in hours.
|
static java.lang.String |
TIME_TO_LIVE_UNITS_MILLISECONDS
TimeToLiveUnits value, in milliseconds.
|
static java.lang.String |
TIME_TO_LIVE_UNITS_MINUTES
TimeToLiveUnits value, in minutes.
|
static java.lang.String |
TIME_TO_LIVE_UNITS_SECONDS
TimeToLiveUnits value, in seconds.
|
INVALID_TYPE_IDENTIFIER
Constructor and Description |
---|
Event() |
Modifier and Type | Method and Description |
---|---|
protected void |
assertEvent()
Assert an event.
|
abstract void |
delete()
Delete this event
|
protected void |
enforceDispatchState()
Enforce that setters cannot change fields once event has
been asserted
|
void |
generate()
Deprecated.
|
abstract java.lang.String |
getDestination()
Get the event destination
|
protected abstract java.lang.Boolean |
getDispatched()
Get the current dispatch state
|
java.lang.String |
getPayload()
Deprecated.
|
abstract PayLoad |
getPayLoad()
Get the event payload
|
abstract java.lang.Boolean |
getRetryOnException()
Get the retry-on-exception value for this event.
|
abstract java.lang.Long |
getTimeToLive()
Get the Time-To-Live value for this event.
|
abstract java.lang.String |
getTimeToLiveUnits()
Get the Time-To-Live units for this event.
|
abstract void |
setDestination(java.lang.String destination)
Set the event destination
|
protected abstract void |
setDispatched()
Set dispatched to true
|
void |
setPayLoad(PayLoad payload)
Set the event payload.
|
void |
setPayload(java.lang.String payload)
Deprecated.
|
protected abstract void |
setRetryOnException(java.lang.Boolean retryOnException)
Set retry on exception
|
protected abstract void |
setTimeToLive(java.lang.Long timeToLive)
Set the time to live for this event
|
protected abstract void |
setTimeToLiveUnits(java.lang.String timeToLiveUnits)
Set time to live units
|
java.lang.String |
toString() |
protected abstract void |
updatePayLoad(PayLoad payload)
Update the internal payload
|
protected abstract void |
updateProperties()
Update event handle properties from shared memory
|
assertEntity, checkActive, getExtId, getHandle, getHandle, getId, load, mapArray, mapHandle, mapHandleArray, register
public static final java.lang.String TIME_TO_LIVE_UNITS_DAYS
public static final java.lang.String TIME_TO_LIVE_UNITS_HOURS
public static final java.lang.String TIME_TO_LIVE_UNITS_MINUTES
public static final java.lang.String TIME_TO_LIVE_UNITS_SECONDS
public static final java.lang.String TIME_TO_LIVE_UNITS_MILLISECONDS
protected static final java.lang.Boolean _DEFAULT_RETRY_ON_EXCEPTION
protected static final java.lang.String _INVALID_TIMER_IDENTIFIER
protected static final java.lang.Long _DEFAULT_TIME_TO_LIVE
protected static final java.lang.String _TIME_TO_LIVE_UNITS_DEFAULT
public Event()
@Deprecated public final void generate()
assertEvent()
instead.protected void assertEvent() throws ObjectNotUniqueError, ResourceUnavailableException
This method starts a new run-to-completion (RTC) cycle if one is not already active. If there is already an active RTC, this event is added to the current RTC agenda.
If this method started a new RTC cycle, it is complete when this method returns. If there is already an active RTC cycle, this event is just added to the current agenda and it will be executed at the end of the current conflict resolution cycle.
A new transaction is started if one is not already active.
RETE working memory is cleared at the end of the RTC cycle.
ObjectNotUniqueError
- Duplicate external identifierResourceUnavailableException
- Rules engine not running@Deprecated public final void setPayload(java.lang.String payload) throws java.lang.IllegalArgumentException
setPayLoad(PayLoad)
instead.payload
- Payloadjava.lang.IllegalArgumentException
- Null payload specifiedpublic final void setPayLoad(PayLoad payload) throws java.lang.IllegalArgumentException
The payload cannot be changed after an event has been asserted.
payload
- A non-null payload to store in this event.java.lang.IllegalArgumentException
- Null payload specifiedpublic abstract void delete()
@Deprecated public java.lang.String getPayload()
getPayLoad()
instead.public abstract PayLoad getPayLoad()
public abstract void setDestination(java.lang.String destination) throws java.lang.IllegalArgumentException
The destination cannot be changed after an event has been asserted.
Destination cannot be null.
destination
- Destination valuejava.lang.IllegalArgumentException
- Illegal destination specifiedpublic abstract java.lang.String getDestination()
public abstract java.lang.Boolean getRetryOnException()
public abstract java.lang.Long getTimeToLive()
public abstract java.lang.String getTimeToLiveUnits()
protected abstract void setRetryOnException(java.lang.Boolean retryOnException)
retryOnException
- Retry on exception valueprotected abstract void updatePayLoad(PayLoad payload)
payload
- Payload valueprotected abstract void setTimeToLive(java.lang.Long timeToLive)
timeToLive
- Time to live value.protected abstract void setTimeToLiveUnits(java.lang.String timeToLiveUnits)
timeToLiveUnits
- Time to live unitsprotected abstract java.lang.Boolean getDispatched()
protected abstract void setDispatched()
protected abstract void updateProperties()
protected final void enforceDispatchState() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- Event already asserted