public void setStateEventFactory(StateEventFactory stateEventFactory) {
        this.stateEventFactory = stateEventFactory;
    }
This method sets a state event pool for on-demand Query runtime.

@param stateEventFactory stateEventFactory for the on-demand Query runtime
modules/siddhi-core/src/main/java/io/siddhi/core/query/OnDemandQueryRuntime.java