Search in sources :

Example 1 with QueryNotExistException

use of org.ballerinalang.siddhi.core.exception.QueryNotExistException in project ballerina by ballerina-lang.

the class SiddhiAppRuntime method addCallback.

public void addCallback(String queryName, QueryCallback callback) {
    callback.setContext(siddhiAppContext);
    QueryRuntime queryRuntime = queryProcessorMap.get(queryName);
    if (queryRuntime == null) {
        throw new QueryNotExistException("No query found with name: " + queryName);
    }
    callback.setQuery(queryRuntime.getQuery());
    queryRuntime.addCallback(callback);
}
Also used : QueryNotExistException(org.ballerinalang.siddhi.core.exception.QueryNotExistException) StoreQueryRuntime(org.ballerinalang.siddhi.core.query.StoreQueryRuntime) QueryRuntime(org.ballerinalang.siddhi.core.query.QueryRuntime)

Aggregations

QueryNotExistException (org.ballerinalang.siddhi.core.exception.QueryNotExistException)1 QueryRuntime (org.ballerinalang.siddhi.core.query.QueryRuntime)1 StoreQueryRuntime (org.ballerinalang.siddhi.core.query.StoreQueryRuntime)1