public interface EventTrigger
Title: Service Event Fabric Runtime
Description: This interface defines the general characteristics of an Event Trigger.
Event Triggers are special event handler mechanisms that allow users to expose events raised by components as real
events to the Service Event Fabric and perform event processing on such events. By default all component
processing within the fabric results in some type of Actionable Events being generated. For example, the
invocation of a service method via the DII mechanism may result in an actionable event that contains the result
object of the method's execution. The inserting or update of a row in a Table
data collection may
result in an actionable event that contains a new or modified row. By default, all such events are considered
Actionable but not physical in the sense that they occur but may not be seen or processed by Event Consumers
.
An event trigger may be defined on an arbitrary actionable event and allows for the setting of an Event Selector
to further filter and narrow the scope of the actionable event the user wishes to expose. Hence multiple triggers
may be defined on the same actionable event with varying selectors, thereby allowing any component to engage in event
routing and filtering.
Trigger implementations are typed and may perform some event processing. A particular trigger implementation may
provide the ability to invoke an event processing action defined by the trigger's Action Script
. The
action script is a text command string that allows the implementing EventTriggerAction
to perform some
processing on the Event Datagram
. The actual syntax and logic of the trigger action is implementation
specific. It is expectd that implementations will contain parsers that resolve the script commands into trigger
logic.
All triggers support the ability to raise an EventTriggerAdvisory
in response to the actionable events
they process. Trigger syntax supports the RAISE ADVISORY
option which allows users to register event
consumers that listen for trigger-specific advisories. This is an optional directive.
Triggers also support the ability to raise the initial actionable event, thereby making it visible to the fabric.
Specifying the RAISE EVENT
option allows the event to be published using the default eventId
.
The user may also specify the RAISE EVENT ON <new Event Id>
option which allows for alternate
eventId
to be used when raising the event.
Trigger definitions have the following syntax:
CREATE EVENT TRIGGER 'Trigger Name' TYPE Trigger Type * [CONSTRAINED BY Semantic Type] AFTER EVENT Actionable EventId BEFORE Event Handler Name [WHEN (Event Selector)] ACTION(<trigger specific script>) [RAISE ADVISORY] [RAISE EVENT] [ON eventId] ;
It should be noted that event triggers are not intended for explicit event processing. Rather the main purpose of the event trigger is to make the event available to downstream consumers. Event triggers always execute synchronously (using Direct Dispatch mode) and ensure the lowest possible latency when raising events and advisories. Consumers of the events may use any dispatch mode they desire. However, users should keep in mind that creating direct consumers on event triggers will push back on the trigger's source component inducing flow control and blocking other event consumers.
Copyright: Copyright (c) 2010/p>
Company: StreamScape Technologies
Modifier and Type | Method and Description |
---|---|
void |
disable()
Disables the trigger, performing implementation specific actions.
|
void |
enable()
Enables the trigger, performing implementation specific actions.
|
java.lang.String |
getActionableEventId()
Returns the
eventId of the actionable event that this trigger is
configured to process. |
EventScope |
getEventScope() |
java.lang.String |
getEventSelector()
Returns the
Event Selector associated with this trigger. |
java.lang.String |
getLastError()
Returns last error which happened during last trigger invocation.
|
java.lang.String |
getName()
Returns the name of the event trigger.
|
EventTriggerState |
getState()
Returns state of the trigger.
|
TriggerActionTime |
getTriggerActionTime()
Returns trigger action time
|
java.util.List |
getTriggerEventIds()
Returns the
eventIds that can be raised from the trigger. |
boolean |
hasEventSelector()
Returns
true if the event selector is set. |
boolean |
isAdvisoryCapable()
Returns
true if this trigger should generate an advisory as part of it's
procesing. |
boolean |
isEventCapable()
Returns
true if this trigger instance will raise an event as a result of it's processing. |
java.lang.String getName()
EventTriggerState getState()
java.lang.String getLastError()
TriggerActionTime getTriggerActionTime()
java.lang.String getActionableEventId()
eventId
of the actionable event that this trigger is
configured to process.EventScope getEventScope()
java.util.List getTriggerEventIds()
eventIds
that can be raised from the trigger.java.lang.String getEventSelector()
Event Selector
associated with this trigger.
It is expected that the trigger uses implementation specific methods
to specify the filter.boolean hasEventSelector()
true
if the event selector is set.boolean isAdvisoryCapable()
true
if this trigger should generate an advisory as part of it's
procesing. A trigger capable of supporting advisories will support the RAISE ADVISORY
directive.boolean isEventCapable()
true
if this trigger instance will raise an event as a result of it's processing.
A trigger capable of supporting events will support the RAISE EVENT
directive.void enable()
void disable()
Copyright © 2015-2024 StreamScape Technologies. All rights reserved.