Search in sources :

Example 1 with QueryNotExistException

use of io.siddhi.core.exception.QueryNotExistException in project siddhi by wso2.

the class SiddhiAppRuntimeImpl method addCallback.

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

Aggregations

QueryNotExistException (io.siddhi.core.exception.QueryNotExistException)1 OnDemandQueryRuntime (io.siddhi.core.query.OnDemandQueryRuntime)1 QueryRuntime (io.siddhi.core.query.QueryRuntime)1 QueryRuntimeImpl (io.siddhi.core.query.QueryRuntimeImpl)1