public interface StatementLifecycleSvc
Modifier and Type | Method and Description |
---|---|
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)
Statements indicate that listeners have been added through this method.
|
void init()
void addObserver(StatementLifecycleObserver observer)
The observers list is backed by a Set.
observer
- to addvoid removeObserver(StatementLifecycleObserver observer)
observer
- to removevoid dispatchStatementLifecycleEvent(StatementLifecycleEvent theEvent)
theEvent
- to dispatchEPStatement 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)
statementSpec
- is the statement definition in bean object form, raw unvalidated and unoptimized.expression
- is the expression textisPattern
- 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 supplieduserObject
- the application define user object associated to each statement, if suppliedisolationUnitServices
- isolated service servicesvoid start(java.lang.String statementId)
statementId
- of the statement to start.void stop(java.lang.String statementId)
statementId
- of the statement to stop.void destroy(java.lang.String statementId)
statementId
- statementId of the statement to destroyEPStatement getStatementByName(java.lang.String name)
name
- is the statement namejava.lang.String[] getStatementNames()
Only returns started and stopped statements.
void startAllStatements() throws EPException
EPException
- to indicate a start error.void stopAllStatements() throws EPException
EPException
- to indicate a start error.void destroyAllStatements() throws EPException
EPException
- to indicate a start error.void updatedListeners(EPStatement stmt, EPStatementListenerSet listeners)
stmt
- is the statement for which listeners were addedlisteners
- is the set of listeners after adding the new listenervoid destroy()
java.lang.String getStatementNameById(java.lang.String id)
EPStatementSPI getStatementById(java.lang.String id)
java.util.Map<java.lang.String,EPStatement> getStmtNameToStmt()
StatementSpecCompiled getStatementSpec(java.lang.String statementName)