Search in sources :

Example 1 with DefinitionNotExistException

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

the class InputManager method constructInputHandler.

public InputHandler constructInputHandler(String streamId) {
    InputHandler inputHandler = new InputHandler(streamId, inputHandlerMap.size(), inputEntryValve);
    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(org.wso2.siddhi.core.stream.StreamJunction) DefinitionNotExistException(org.wso2.siddhi.core.exception.DefinitionNotExistException)

Example 2 with DefinitionNotExistException

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

the class SiddhiAppRuntime 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(org.wso2.siddhi.core.stream.StreamJunction) DefinitionNotExistException(org.wso2.siddhi.core.exception.DefinitionNotExistException)

Aggregations

DefinitionNotExistException (org.wso2.siddhi.core.exception.DefinitionNotExistException)2 StreamJunction (org.wso2.siddhi.core.stream.StreamJunction)2