![]() | EPStatement Methods |
The EPStatement type exposes the following members.
Name | Description | |
---|---|---|
![]() | AddListener |
Add a listener that observes events.
(Inherited from EPListenable.) |
![]() | AddListenerWithReplay |
Add an update listener replaying current statement results to the listener.
(Inherited from EPListenable.)The listener receives current statement results as the first call to the update method of the listener, passing in the newEvents parameter the current statement results as an array of zero or more events. Subsequent calls to the update method of the listener are statement results. Current statement results are the events returned by the iterator or safeIterator methods. Delivery of current statement results in the first call is performed by the same thread invoking this method, while subsequent calls to the listener may deliver statement results by the same or other threads. Note: this is a blocking call, delivery is atomic: Events occurring during iteration and delivery to the listener are guaranteed to be delivered in a separate call and not lost. The listener implementation should minimize long-running or blocking operations. Delivery is only atomic relative to the current statement. If the same listener instance is registered with other statements it may receive other statement results simultaneously. If a statement is not started an therefore does not have current results, the listener receives a single invocation with a null value in newEvents. |
![]() | GetEnumerator | (Inherited from EPIterable.) |
![]() | GetProperty |
Returns a statement property value.
|
![]() | GetSafeEnumerator |
Returns a concurrency-safe enumerator that iterates over events representing statement results (pull API)
in the face of concurrent event processing by further threads.
(Inherited from EPIterable.)In comparison to the regular enumerator, the safe enumerator guarantees correct results even as events are being processed by other threads. The cost is that the enumerator holds one or more locks that must be released via the close method. Any locks are acquired at the time this method is called. This method is a blocking method. It may block until statement processing locks are released such that the safe enumerator can acquire any required locks. An application MUST explicitly close the safe enumerator instance using the close method, to release locks held by the enumerator. The call to the close method should be done in a finally block to make sure the enumerator gets closed. Multiple safe enumerators may be not be used at the same time by different application threads. A single application thread may hold and use multiple safe enumerators however this is discouraged. |
![]() | GetSafeEnumerator(ContextPartitionSelector) |
For use with statements that have a context declared and that may therefore have multiple context partitions,
allows to safe-iterate over context partitions selectively.
(Inherited from EPIterable.) |
![]() | RemoveAllEventHandlers |
Removes all event handlers.
(Inherited from EPListenable.) |
![]() | RemoveAllListeners |
Removes all listeners.
(Inherited from EPListenable.) |
![]() | RemoveListener |
Remove a listener that observes events.
(Inherited from EPListenable.) |
![]() | SetSubscriber(Object) |
Attaches a subscriber to receive statement results,
or removes a previously set subscriber (by providing a null value).
Note: Requires the allow-subscriber compiler options. Only a single subscriber may be set for a statement. If this method is invoked twice any previously-set subscriber is no longer used. |
![]() | SetSubscriber(Object, String) |
Attaches a subscriber to receive statement results by calling the method with the provided method name,
or removes a previously set subscriber (by providing a null value).
Note: Requires the allow-subscriber compiler options. Only a single subscriber may be set for a statement. If this method is invoked twice any previously-set subscriber is no longer used. |