private Event[] query(OnDemandQuery onDemandQuery, String onDemandQueryString) {
        try {
            if (Level.BASIC.compareTo(siddhiAppContext.getRootMetricsLevel()) <= 0 &&
                    onDemandQueryLatencyTracker != null) {
                onDemandQueryLatencyTracker.markIn();
            }
            OnDemandQueryRuntime onDemandQueryRuntime;
            synchronized (this) {
                onDemandQueryRuntime = onDemandQueryRuntimeMap.remove(onDemandQuery);
                if (onDemandQueryRuntime == null) {
                    onDemandQueryRuntime = OnDemandQueryParser.parse(onDemandQuery, onDemandQueryString,
                            siddhiAppContext, tableMap, windowMap, aggregationMap);
                } else {
                    onDemandQueryRuntime.reset();
                }
                onDemandQueryRuntimeMap.put(onDemandQuery, onDemandQueryRuntime);
                if (onDemandQueryRuntimeMap.size() > 50) {
                    Iterator i = onDemandQueryRuntimeMap.entrySet().iterator();
                    if (i.hasNext()) {
                        i.next();
                        i.remove();
                    }
                }
            }
            return onDemandQueryRuntime.execute();
        } catch (RuntimeException e) {
            if (e instanceof SiddhiAppContextException) {
                throw new OnDemandQueryCreationException(((SiddhiAppContextException) e).getMessageWithOutContext(), e,
                        ((SiddhiAppContextException) e).getQueryContextStartIndex(),
                        ((SiddhiAppContextException) e).getQueryContextEndIndex(), null, onDemandQueryString);
            }
            throw new OnDemandQueryCreationException(e.getMessage(), e);
        } finally {
            if (Level.BASIC.compareTo(siddhiAppContext.getRootMetricsLevel()) <= 0 &&
                    onDemandQueryLatencyTracker != null) {
                onDemandQueryLatencyTracker.markOut();
            }
        }
    }
Get the names of the available queries.

@return string set of query names.
modules/siddhi-core/src/main/java/io/siddhi/core/SiddhiAppRuntimeImpl.java