}
public synchronized void addStatement(ContextManagedStatementBase statement) throws ExprValidationException {
// validation
StatementSpecCompiledAnalyzerResult streamAnalysis = StatementSpecCompiledAnalyzer.analyzeFilters(statement.getStatementSpec());
validateStatementForContext(statement, streamAnalysis);
if (statements.isEmpty()) {
activate();
}
ContextManagerPartitionedStatementDesc desc = new ContextManagerPartitionedStatementDesc(statement, streamAnalysis.getFilters());
statements.put(statement.getStatementContext().getStatementId(), desc);
// retro-actively create contexts for that statement
for (Map.Entry<Object, Integer> entry : partitionKeys.entrySet()) {
Object key = entry.getKey();