net.esper.client
Interface EPStatement

All Superinterfaces:
EPIterable, EPListenable
All Known Subinterfaces:
EPStatementSPI
All Known Implementing Classes:
EPStatementImpl

public interface EPStatement
extends EPListenable, EPIterable

Statement interface that provides methods to start, stop and destroy a statement as well as get statement information such as statement name, expression text and current state.

Statements have 3 states: STARTED, STOPPED and DESTROYED.

In started state, statements are actively evaluating event streams according to the statement expression. Started statements can be stopped and destroyed.

In stopped state, statements are inactive. Stopped statements can either be started, in which case they begin to actively evaluate event streams, or destroyed.

Destroyed statements have relinguished all statement resources and cannot be started or stopped.


Method Summary
 void destroy()
          Destroy the statement releasing all statement resources.
 String getName()
          Returns the statement name.
 EPStatementState getState()
          Returns the statement's current state.
 String getText()
          Returns the underlying expression text.
 long getTimeLastStateChange()
          Returns the system time in milliseconds of when the statement last change state.
 boolean isDestroyed()
          Returns true if the statement state is destroyed.
 boolean isStarted()
          Returns true if the statement state is started.
 boolean isStopped()
          Returns true if the statement state is stopped.
 void start()
          Start the statement.
 void stop()
          Stop the statement.
 
Methods inherited from interface net.esper.client.EPListenable
addListener, addListener, getStatementAwareListeners, getUpdateListeners, removeAllListeners, removeListener, removeListener
 
Methods inherited from interface net.esper.client.EPIterable
getEventType, iterator, safeIterator
 

Method Detail

start

void start()
Start the statement.


stop

void stop()
Stop the statement.


destroy

void destroy()
Destroy the statement releasing all statement resources.

A destroyed statement cannot be started again.


getState

EPStatementState getState()
Returns the statement's current state.

Returns:
state enum

isStarted

boolean isStarted()
Returns true if the statement state is started.

Returns:
true for started statements, false for stopped or destroyed statements.

isStopped

boolean isStopped()
Returns true if the statement state is stopped.

Returns:
true for stopped statements, false for started or destroyed statements.

isDestroyed

boolean isDestroyed()
Returns true if the statement state is destroyed.

Returns:
true for destroyed statements, false for started or stopped statements.

getText

String getText()
Returns the underlying expression text.

Returns:
expression text

getName

String getName()
Returns the statement name.

Returns:
statement name

getTimeLastStateChange

long getTimeLastStateChange()
Returns the system time in milliseconds of when the statement last change state.

Returns:
time in milliseconds of last statement state change

© 2007 EsperTech Inc.
All rights reserved.
Visit us at espertech.com