public void checkBreakPoint(String queryName, QueryTerminal queryTerminal, ComplexEvent complexEvent) {
        // Prevent other threads from calling this method simultaneously
        synchronized (this) {
            // Create the breakpoint name for the given query at the given endpoint
            String breakpointName = createBreakpointName(queryName, queryTerminal);

            // Get the breakpoint atomic boolean using the name
            AtomicBoolean breakpoint = acquiredBreakPointsMap.get(breakpointName);

            // Check whether this endpoint comes after the next call of another breakpoint
            boolean isNext = isNextEnabled();

            if (isNext) {
                // Reset next flag of this thread
                setNextEnabled(false);
            }

            if (breakpoint != null && breakpoint.get() || isNext) {
                // An active breakpoint is available or next method was called last time

                // Pass the debugger, query name, breakpoint and the events to the callback
                if (siddhiDebuggerCallback != null) {
                    siddhiDebuggerCallback.debugEvent(complexEvent, queryName, queryTerminal, this);
                }

                try {
                    // Lock the breakpoint so that the thread cannot progress further until it is released by next or
                    // play methods.
                    breakPointLock.acquire();

                    // After releasing the lock check how the lock was released. If it is by next, set the thread
                    // local flag to true.
                    if (this.enableNext.get()) {
                        // Must be assigned from the current thread. Do not move it to next or play methods
                        setNextEnabled(true);
                        this.enableNext.set(false);
                    }
                } catch (InterruptedException e) {
                    log.error("Error in acquiring breakpoint lock at " + breakpointName);
                }
            }
        }
    }
Check for active breakpoint at the given endpoint and if there is an active checkpoint, block the thread and
send the event for debug callback.

@param queryName     name of the Siddhi query
@param queryTerminal IN or OUT endpoint of the query
@param complexEvent  the {@link ComplexEvent} which is waiting at the endpoint
modules/siddhi-core/src/main/java/io/siddhi/core/debugger/SiddhiDebugger.java