当前位置: 首页>>代码示例>>Java>>正文


Java QueryNotExistException类代码示例

本文整理汇总了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();
}
 
开发者ID:redBorder,项目名称:rb-bi,代码行数:26,代码来源:CallbackTestCase.java

示例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);
}
 
开发者ID:redBorder,项目名称:rb-bi,代码行数:10,代码来源:SiddhiManager.java

示例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);
}
 
开发者ID:wso2,项目名称:siddhi,代码行数:10,代码来源:SiddhiAppRuntime.java

示例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();
}
 
开发者ID:wso2,项目名称:siddhi,代码行数:29,代码来源:CallbackTestCase.java

示例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);
}
 
开发者ID:sacjaya,项目名称:siddhi-3,代码行数:8,代码来源:ExecutionPlanRuntime.java

示例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);

    }
 
开发者ID:sacjaya,项目名称:siddhi-3,代码行数:11,代码来源:ExecutionPlanRuntime.java


注:本文中的org.wso2.siddhi.core.exception.QueryNotExistException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。