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;
}
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);
}
Aggregations