public void switchToPlayBackMode() {
        Map<String, Map<String, SchedulerState>> allStates = stateHolder.getAllStates();
        try {
            for (Map.Entry<String, Map<String, SchedulerState>> allStatesEntry : allStates.entrySet()) {
                for (Map.Entry<String, SchedulerState> stateEntry : allStatesEntry.getValue().entrySet()) {
                    if (stateEntry.getValue().scheduledFuture != null) {
                        stateEntry.getValue().scheduledFuture.cancel(true);
                    }
                    //Make the scheduler running flag to false to make sure scheduler will schedule next time starts
                    stateEntry.getValue().running = false;
                }
            }
        } finally {
            stateHolder.returnAllStates(allStates);
        }
    }
this can be used to release
the acquired resources for processing.
modules/siddhi-core/src/main/java/io/siddhi/core/util/Scheduler.java