|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.esper.core.StatementLifecycleSvcImpl
public class StatementLifecycleSvcImpl
Provides statement lifecycle services.
Nested Class Summary | |
---|---|
class |
StatementLifecycleSvcImpl.EPStatementDesc
Statement information. |
Field Summary | |
---|---|
protected EPServicesContext |
services
Services context for statement lifecycle management. |
protected Map<String,StatementLifecycleSvcImpl.EPStatementDesc> |
stmtIdToDescMap
Maps of statement id to descriptor. |
protected Map<String,EPStatement> |
stmtNameToStmtMap
Map of statement name to statement. |
Constructor Summary | |
---|---|
StatementLifecycleSvcImpl(EPServiceProvider epServiceProvider,
EPServicesContext services)
Ctor. |
Method Summary | |
---|---|
EPStatement |
createAndStart(StatementSpecRaw statementSpec,
String expression,
boolean isPattern,
String optStatementName)
Create and start the statement. |
protected EPStatement |
createAndStart(StatementSpecRaw statementSpec,
String expression,
boolean isPattern,
String optStatementName,
String statementId)
Creates and starts statement. |
protected EPStatement |
createStarted(StatementSpecRaw statementSpec,
String expression,
boolean isPattern,
String statementName,
String statementId)
Creates a started statement. |
protected StatementLifecycleSvcImpl.EPStatementDesc |
createStopped(StatementSpecRaw statementSpec,
String expression,
boolean isPattern,
String statementName,
String statementId)
Create stopped statement. |
void |
destroy(String statementId)
Destroy statement by statement id. |
void |
destroyAllStatements()
Destroys all started statements. |
EPStatementSPI |
getStatementById(String id)
Returns the statement given a statement id. |
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 |
start(String statementId,
StatementLifecycleSvcImpl.EPStatementDesc desc)
Start the given statement. |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final EPServicesContext services
protected final Map<String,StatementLifecycleSvcImpl.EPStatementDesc> stmtIdToDescMap
protected final Map<String,EPStatement> stmtNameToStmtMap
Constructor Detail |
---|
public StatementLifecycleSvcImpl(EPServiceProvider epServiceProvider, EPServicesContext services)
epServiceProvider
- is the engine instance to hand to statement-aware listenersservices
- is engine servicesMethod Detail |
---|
public void init()
StatementLifecycleSvc
init
in interface StatementLifecycleSvc
public EPStatement createAndStart(StatementSpecRaw statementSpec, String expression, boolean isPattern, String optStatementName)
StatementLifecycleSvc
createAndStart
in interface StatementLifecycleSvc
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 supplied
protected EPStatement createAndStart(StatementSpecRaw statementSpec, String expression, boolean isPattern, String optStatementName, String statementId)
statementSpec
- defines the statementexpression
- is the EQLisPattern
- is true for patternsoptStatementName
- is the optional statement namestatementId
- is the statement id
protected EPStatement createStarted(StatementSpecRaw statementSpec, String expression, boolean isPattern, String statementName, String statementId)
statementSpec
- is the statement defexpression
- is the expression textisPattern
- is true for patterns,statementName
- is the statement namestatementId
- is the statement id
protected StatementLifecycleSvcImpl.EPStatementDesc createStopped(StatementSpecRaw statementSpec, String expression, boolean isPattern, String statementName, String statementId)
statementSpec
- - statement definitionexpression
- is the expression textisPattern
- is true for patterns, false for non-patternsstatementName
- is the statement name assigned or givenstatementId
- is the statement id
public void start(String statementId)
StatementLifecycleSvc
start
in interface StatementLifecycleSvc
statementId
- of the statement to start.public void start(String statementId, StatementLifecycleSvcImpl.EPStatementDesc desc)
statementId
- is the statement iddesc
- is the cached statement infopublic void stop(String statementId)
StatementLifecycleSvc
stop
in interface StatementLifecycleSvc
statementId
- of the statement to stop.public void destroy(String statementId)
StatementLifecycleSvc
destroy
in interface StatementLifecycleSvc
statementId
- statementId of the statement to destroypublic EPStatement getStatementByName(String name)
StatementLifecycleSvc
getStatementByName
in interface StatementLifecycleSvc
name
- is the statement name
public EPStatementSPI getStatementById(String id)
id
- is the statement id
public String[] getStatementNames()
StatementLifecycleSvc
Only returns started and stopped statements.
getStatementNames
in interface StatementLifecycleSvc
public void startAllStatements() throws EPException
StatementLifecycleSvc
startAllStatements
in interface StatementLifecycleSvc
EPException
- to indicate a start error.public void stopAllStatements() throws EPException
StatementLifecycleSvc
stopAllStatements
in interface StatementLifecycleSvc
EPException
- to indicate a start error.public void destroyAllStatements() throws EPException
StatementLifecycleSvc
destroyAllStatements
in interface StatementLifecycleSvc
EPException
- to indicate a start error.public void updatedListeners(String statementId, String statementName, EPStatementListenerSet listeners)
StatementLifecycleSvc
updatedListeners
in interface StatementLifecycleSvc
statementId
- is the statement id for which listeners were addedstatementName
- is the statement namelisteners
- is the set of listeners after adding the new listener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |