public interface StatementLifecycleSvc extends StatementLifecycleStmtContextResolver
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,
String expression,
boolean isPattern,
String optStatementName,
Object userObject,
EPIsolationUnitServices isolationUnitServices,
Integer optionalStatementId,
EPStatementObjectModel optionalModel)
Create and start the statement.
|
void |
destroy()
Destroy the service.
|
void |
destroy(int statementId)
Destroy statement by statement id.
|
void |
destroyAllStatements()
Destroys all started statements.
|
void |
dispatchStatementLifecycleEvent(StatementLifecycleEvent theEvent)
Dispatch event to observers.
|
EPStatementSPI |
getStatementById(int statementId) |
EPStatement |
getStatementByName(String name)
Returns the statement by the given name, or null if no such statement exists.
|
String |
getStatementNameById(int statementId) |
String[] |
getStatementNames()
Returns an array of statement names.
|
StatementSpecCompiled |
getStatementSpec(int statementId) |
Map<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(int statementId)
Start statement by statement id.
|
void |
startAllStatements()
Starts all stopped statements.
|
void |
stop(int 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.
|
getStatementContextById
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, String expression, boolean isPattern, String optStatementName, Object userObject, EPIsolationUnitServices isolationUnitServices, Integer optionalStatementId, 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 servicesoptionalStatementId
- the statement idoptionalModel
- modelvoid start(int statementId)
statementId
- of the statement to start.void stop(int statementId)
statementId
- of the statement to stop.void destroy(int statementId)
statementId
- statementId of the statement to destroyEPStatement getStatementByName(String name)
name
- is the statement nameString[] 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, boolean isRecovery)
stmt
- is the statement for which listeners were addedlisteners
- is the set of listeners after adding the new listenerisRecovery
- indicator whether recoveringvoid destroy()
String getStatementNameById(int statementId)
Map<String,EPStatement> getStmtNameToStmt()
EPStatementSPI getStatementById(int statementId)
StatementSpecCompiled getStatementSpec(int statementId)