net.esper.core
Interface StatementLifecycleSvc

All Known Implementing Classes:
StatementLifecycleSvcImpl

public interface StatementLifecycleSvc

Handles statement management.


Method Summary
 EPStatement createAndStart(StatementSpecRaw statementSpec, String expression, boolean isPattern, String optStatementName)
          Create and start the statement.
 void destroy(String statementId)
          Destroy statement by statement id.
 void destroyAllStatements()
          Destroys all started statements.
 EPStatement getStatementByName(String name)
          Returns the statement by the given name, or null if no such statement exists.
 String[] getStatementNames()
          Returns an array of statement names.
 void init()
          Initialized the service before use.
 void start(String statementId)
          Start statement by statement id.
 void startAllStatements()
          Starts all stopped statements.
 void stop(String statementId)
          Stop statement by statement id.
 void stopAllStatements()
          Stops all started statements.
 void updatedListeners(String statementId, String statementName, EPStatementListenerSet listeners)
          Statements indicate that listeners have been added through this method.
 

Method Detail

init

void init()
Initialized the service before use.


createAndStart

EPStatement createAndStart(StatementSpecRaw statementSpec,
                           String expression,
                           boolean isPattern,
                           String optStatementName)
Create and start the statement.

Parameters:
statementSpec - is the statement definition in bean object form, raw unvalidated and unoptimized.
expression - is the expression text
isPattern - is an indicator on whether this is a pattern statement and thus the iterator must return the last result, versus for non-pattern statements the iterator returns view content.
optStatementName - is an optional statement name, null if none was supplied
Returns:
started statement

start

void start(String statementId)
Start statement by statement id.

Parameters:
statementId - of the statement to start.

stop

void stop(String statementId)
Stop statement by statement id.

Parameters:
statementId - of the statement to stop.

destroy

void destroy(String statementId)
Destroy statement by statement id.

Parameters:
statementId - statementId of the statement to destroy

getStatementByName

EPStatement getStatementByName(String name)
Returns the statement by the given name, or null if no such statement exists.

Parameters:
name - is the statement name
Returns:
statement for the given name, or null if no such statement existed

getStatementNames

String[] getStatementNames()
Returns an array of statement names. If no statement has been created, an empty array is returned.

Only returns started and stopped statements.

Returns:
statement names

startAllStatements

void startAllStatements()
                        throws EPException
Starts all stopped statements. First statement to fail supplies the exception.

Throws:
EPException - to indicate a start error.

stopAllStatements

void stopAllStatements()
                       throws EPException
Stops all started statements. First statement to fail supplies the exception.

Throws:
EPException - to indicate a start error.

destroyAllStatements

void destroyAllStatements()
                          throws EPException
Destroys all started statements. First statement to fail supplies the exception.

Throws:
EPException - to indicate a start error.

updatedListeners

void updatedListeners(String statementId,
                      String statementName,
                      EPStatementListenerSet listeners)
Statements indicate that listeners have been added through this method.

Parameters:
statementId - is the statement id for which listeners were added
statementName - is the statement name
listeners - is the set of listeners after adding the new listener