當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。