本文整理汇总了Java中org.wso2.siddhi.core.exception.QueryNotExistException类的典型用法代码示例。如果您正苦于以下问题:Java QueryNotExistException类的具体用法?Java QueryNotExistException怎么用?Java QueryNotExistException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
QueryNotExistException类属于org.wso2.siddhi.core.exception包,在下文中一共展示了QueryNotExistException类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testQuery4
import org.wso2.siddhi.core.exception.QueryNotExistException; //导入依赖的package包/类
@Test(expected = QueryNotExistException.class)
public void testQuery4() throws InterruptedException, SiddhiParserException {
log.info("QueryNotExistException for Callback assignment test");
SiddhiManager siddhiManager = new SiddhiManager();
InputHandler inputHandler = siddhiManager.defineStream("define stream cseStream ( symbol string, price float, volume int )");
siddhiManager.addCallback("test", new QueryCallback() {
@Override
public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
EventPrinter.print(timeStamp, inEvents, removeEvents);
Assert.assertTrue("IBM".equals(inEvents[0].getData(0)) || "WSO2".equals(inEvents[0].getData(0)));
count++;
}
});
String queryReference = siddhiManager.addQuery("from cseStream[price>10] " +
"select symbol, price, volume " +
"insert into outStream;");
siddhiManager.shutdown();
}
示例2: addCallback
import org.wso2.siddhi.core.exception.QueryNotExistException; //导入依赖的package包/类
public void addCallback(String queryReference, QueryCallback callback) {
QueryManager queryManager = queryProcessorMap.get(queryReference);
if (queryManager == null) {
throw new QueryNotExistException("No query fund for " + queryReference);
}
callback.setStreamDefinition(queryManager.getOutputStreamDefinition());
callback.setSiddhiContext(siddhiContext);
queryManager.addCallback(callback);
}
示例3: addCallback
import org.wso2.siddhi.core.exception.QueryNotExistException; //导入依赖的package包/类
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);
}
示例4: callbackTest2
import org.wso2.siddhi.core.exception.QueryNotExistException; //导入依赖的package包/类
@Test(expectedExceptions = QueryNotExistException.class)
public void callbackTest2() throws InterruptedException {
log.info("callback test2");
SiddhiManager siddhiManager = new SiddhiManager();
String siddhiApp = "" +
"@app:name('callbackTest1') " +
"" +
"define stream StockStream (symbol string, price float, volume long);" +
"" +
"@info(name = 'query1') " +
"from StockStream[70 > price] " +
"select symbol, price " +
"insert into outputStream;";
SiddhiAppRuntime siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(siddhiApp);
siddhiAppRuntime.addCallback("query3", new QueryCallback() {
@Override
public void receive(long timestamp, Event[] inEvents, Event[] removeEvents) {
EventPrinter.print(timestamp, inEvents, removeEvents);
}
});
siddhiAppRuntime.shutdown();
}
示例5: addCallback
import org.wso2.siddhi.core.exception.QueryNotExistException; //导入依赖的package包/类
public void addCallback(String queryName, QueryCallback callback) {
QueryRuntime queryRuntime = queryProcessorMap.get(queryName);
if (queryRuntime == null) {
throw new QueryNotExistException("No query fund for " + queryName);
}
queryRuntime.addCallback(callback);
}
示例6: addCallback
import org.wso2.siddhi.core.exception.QueryNotExistException; //导入依赖的package包/类
public void addCallback(String queryName, QueryCallback callback) {
QueryRuntime queryRuntime = queryProcessorMap.get(queryName);
if (queryRuntime == null) {
throw new QueryNotExistException("No query fund for " + queryName);
}
callback.setStreamDefinition(queryRuntime.getOutputStreamDefinition());
queryRuntime.addCallback(callback);
}