Click or drag to resize

EPStatement Interface

The statement is the means to attach callbacks to receive statement results (push, observer) and to object current results using pull.

Namespace:  com.espertech.esper.runtime.client
Assembly:  NEsper.Runtime (in NEsper.Runtime.dll) Version: 8.0.0.0
Syntax
C#
public interface EPStatement : EPListenable, 
	EPIterable, IEnumerable, IEnumerable

The EPStatement type exposes the following members.

Properties
  NameDescription
Public propertyAnnotations
Returns statement annotations.

See the annotation package for available annotations. Application can define their own annotations.

Public propertyDeploymentId
Returns the deployment id.
Public propertyEventType
Returns the type of events the statement pushes to listeners or returns for iterator.
Public propertyIsDestroyed
Returns true if the statement has been undeployed.
Public propertyName
Returns the statement name.
Public propertySubscriber
Returns the current subscriber instance that receives statement results.
Public propertyUpdateListeners
Returns any listeners that have been registered.
(Inherited from EPListenable.)
Public propertyUserObjectCompileTime
Returns the application defined user data object associated with the statement at compile time, or null if none was supplied at time of statement compilation.

The user object is a single, unnamed field that is stored with every statement. Applications may put arbitrary objects in this field or a null value.

User objects are passed at time of statement compilation via options.

Public propertyUserObjectRuntime
Returns the application defined user data object associated with the statement at deployment time, or null if none was supplied at time of deployment.

The user object is a single, unnamed field that is stored with every statement. Applications may put arbitrary objects in this field or a null value.

User objects are passed at time of deployment via options.

Top
Methods
  NameDescription
Public methodAddListener
Add a listener that observes events.
(Inherited from EPListenable.)
Public methodAddListenerWithReplay
Add an update listener replaying current statement results to the listener.

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.

(Inherited from EPListenable.)
Public methodGetEnumerator (Inherited from EPIterable.)
Public methodGetProperty
Returns a statement property value.
Public methodGetSafeEnumerator
Returns a concurrency-safe enumerator that iterates over events representing statement results (pull API) in the face of concurrent event processing by further threads.

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.

(Inherited from EPIterable.)
Public methodGetSafeEnumerator(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.)
Public methodRemoveAllEventHandlers
Removes all event handlers.
(Inherited from EPListenable.)
Public methodRemoveAllListeners
Removes all listeners.
(Inherited from EPListenable.)
Public methodRemoveListener
Remove a listener that observes events.
(Inherited from EPListenable.)
Public methodSetSubscriber(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.

Public methodSetSubscriber(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.

Top
Events
  NameDescription
Public eventEvents
Occurs whenever new events are available or old events are removed.
(Inherited from EPListenable.)
Top
See Also