com.espertech.esper.core.service
Interface StatementLifecycleSvc

All Known Implementing Classes:
StatementLifecycleSvcImpl

public interface StatementLifecycleSvc

Handles statement management.


Method Summary
 void addObserver(StatementLifecycleObserver observer)
          Add an observer to be called back when statement-state or listener/subscriber changes are registered.
 EPStatement createAndStart(StatementSpecRaw statementSpec, java.lang.String expression, boolean isPattern, java.lang.String optStatementName, java.lang.Object userObject, EPIsolationUnitServices isolationUnitServices, java.lang.String statementId, EPStatementObjectModel optionalModel)
          Create and start the statement.
 void destroy()
          Destroy the service.
 void destroy(java.lang.String statementId)
          Destroy statement by statement id.
 void destroyAllStatements()
          Destroys all started statements.
 void dispatchStatementLifecycleEvent(StatementLifecycleEvent theEvent)
          Dispatch event to observers.
 EPStatementSPI getStatementById(java.lang.String id)
           
 EPStatement getStatementByName(java.lang.String name)
          Returns the statement by the given name, or null if no such statement exists.
 java.lang.String getStatementNameById(java.lang.String id)
           
 java.lang.String[] getStatementNames()
          Returns an array of statement names.
 StatementSpecCompiled getStatementSpec(java.lang.String statementName)
           
 java.util.Map<java.lang.String,EPStatement> getStmtNameToStmt()
           
 void init()
          Initialized the service before use.
 void removeObserver(StatementLifecycleObserver observer)
          Remove an observer to be called back when statement-state or listener/subscriber changes are registered.
 void start(java.lang.String statementId)
          Start statement by statement id.
 void startAllStatements()
          Starts all stopped statements.
 void stop(java.lang.String statementId)
          Stop statement by statement id.
 void stopAllStatements()
          Stops all started statements.
 void updatedListeners(EPStatement stmt, EPStatementListenerSet listeners, boolean isRecovery)
          Statements indicate that listeners have been added through this method.
 

Method Detail

init

void init()
Initialized the service before use.


addObserver

void addObserver(StatementLifecycleObserver observer)
Add an observer to be called back when statement-state or listener/subscriber changes are registered.

The observers list is backed by a Set.

Parameters:
observer - to add

removeObserver

void removeObserver(StatementLifecycleObserver observer)
Remove an observer to be called back when statement-state or listener/subscriber changes are registered.

Parameters:
observer - to remove

dispatchStatementLifecycleEvent

void dispatchStatementLifecycleEvent(StatementLifecycleEvent theEvent)
Dispatch event to observers.

Parameters:
theEvent - to dispatch

createAndStart

EPStatement createAndStart(StatementSpecRaw statementSpec,
                           java.lang.String expression,
                           boolean isPattern,
                           java.lang.String optStatementName,
                           java.lang.Object userObject,
                           EPIsolationUnitServices isolationUnitServices,
                           java.lang.String statementId,
                           EPStatementObjectModel optionalModel)
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
userObject - the application define user object associated to each statement, if supplied
isolationUnitServices - isolated service services
Returns:
started statement

start

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

Parameters:
statementId - of the statement to start.

stop

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

Parameters:
statementId - of the statement to stop.

destroy

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

Parameters:
statementId - statementId of the statement to destroy

getStatementByName

EPStatement getStatementByName(java.lang.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

java.lang.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(EPStatement stmt,
                      EPStatementListenerSet listeners,
                      boolean isRecovery)
Statements indicate that listeners have been added through this method.

Parameters:
stmt - is the statement for which listeners were added
listeners - is the set of listeners after adding the new listener

destroy

void destroy()
Destroy the service.


getStatementNameById

java.lang.String getStatementNameById(java.lang.String id)

getStatementById

EPStatementSPI getStatementById(java.lang.String id)

getStmtNameToStmt

java.util.Map<java.lang.String,EPStatement> getStmtNameToStmt()

getStatementSpec

StatementSpecCompiled getStatementSpec(java.lang.String statementName)

© 2006-2015 EsperTech Inc.
All rights reserved.
Visit us at espertech.com