Search in sources :

Example 1 with DefinitionNotExistException

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

the class SiddhiAppRuntimeImpl method addCallback.

public void addCallback(String streamId, StreamCallback streamCallback) {
    streamCallback.setStreamId(streamId);
    StreamJunction streamJunction = streamJunctionMap.get(streamId);
    if (streamJunction == null) {
        throw new DefinitionNotExistException("No stream found with name: " + streamId);
    }
    streamCallback.setStreamDefinition(streamDefinitionMap.get(streamId));
    streamCallback.setContext(siddhiAppContext);
    streamJunction.subscribe(streamCallback);
}
Also used : StreamJunction(io.siddhi.core.stream.StreamJunction) DefinitionNotExistException(io.siddhi.core.exception.DefinitionNotExistException)

Example 2 with DefinitionNotExistException

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

the class InputManager method constructTableInputHandler.

public synchronized TableInputHandler constructTableInputHandler(String tableId) {
    Table correspondingTable = tableMap.get(tableId);
    if (correspondingTable == null) {
        throw new DefinitionNotExistException("Table with table ID " + tableId + " has not been defined");
    }
    TableInputHandler tableInputHandler = new TableInputHandler(correspondingTable, siddhiAppContext);
    tableInputHandlerMap.put(tableId, tableInputHandler);
    return tableInputHandler;
}
Also used : Table(io.siddhi.core.table.Table) DefinitionNotExistException(io.siddhi.core.exception.DefinitionNotExistException)

Example 3 with DefinitionNotExistException

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

the class InputManager method constructInputHandler.

public synchronized InputHandler constructInputHandler(String streamId) {
    InputHandler inputHandler = new InputHandler(streamId, inputHandlerMap.size(), inputEntryValve, siddhiAppContext);
    StreamJunction streamJunction = streamJunctionMap.get(streamId);
    if (streamJunction == null) {
        throw new DefinitionNotExistException("Stream with stream ID " + streamId + " has not been defined");
    }
    inputDistributor.addInputProcessor(streamJunctionMap.get(streamId).constructPublisher());
    inputHandlerMap.put(streamId, inputHandler);
    return inputHandler;
}
Also used : StreamJunction(io.siddhi.core.stream.StreamJunction) DefinitionNotExistException(io.siddhi.core.exception.DefinitionNotExistException)

Aggregations

DefinitionNotExistException (io.siddhi.core.exception.DefinitionNotExistException)3 StreamJunction (io.siddhi.core.stream.StreamJunction)2 Table (io.siddhi.core.table.Table)1