Search in sources :

Example 1 with CamelStackFrame

use of com.github.cameltooling.idea.runner.debugger.stack.CamelStackFrame in project camel-idea-plugin by camel-tooling.

the class CamelDebugProcess method init.

public void init() {
    camelDebuggerSession.setXDebugSession(this.getSession());
    camelDebuggerSession.connect(javaProcessHandler);
    camelDebuggerSession.addMessageReceivedListener(new MessageReceivedListener() {

        @Override
        public void onNewMessageReceived(CamelMessageInfo camelMessageInfo) {
            XSourcePosition topPosition = getSession().getTopFramePosition();
            if (forceRefresh || topPosition == null || !topPosition.equals(camelMessageInfo.getXSourcePosition())) {
                forceRefresh = false;
                // List frames
                List<CamelStackFrame> stackFrames = new ArrayList<CamelStackFrame>();
                for (CamelMessageInfo info : camelMessageInfo.getStack()) {
                    CamelStackFrame nextFrame = new CamelStackFrame(getSession().getProject(), camelDebuggerSession, info);
                    stackFrames.add(nextFrame);
                }
                getSession().positionReached(new CamelSuspendContext(stackFrames.toArray(new CamelStackFrame[stackFrames.size()])));
            }
        }
    });
}
Also used : CamelMessageInfo(com.github.cameltooling.idea.runner.debugger.stack.CamelMessageInfo) ArrayList(java.util.ArrayList) List(java.util.List) XSourcePosition(com.intellij.xdebugger.XSourcePosition) CamelStackFrame(com.github.cameltooling.idea.runner.debugger.stack.CamelStackFrame)

Aggregations

CamelMessageInfo (com.github.cameltooling.idea.runner.debugger.stack.CamelMessageInfo)1 CamelStackFrame (com.github.cameltooling.idea.runner.debugger.stack.CamelStackFrame)1 XSourcePosition (com.intellij.xdebugger.XSourcePosition)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1