Package org.jitterbit.integration.debug.client

Examples of org.jitterbit.integration.debug.client.DebugSession


    private void addDebugListeners() {
        DebugService svc = model.getDebugService();
        synchronized (svc) {
            svc.addListener(debugServiceListener);
            DebugSession session = svc.getCurrentSession();
            if (session != null) {
                session.addListener(sessionListener);
            }
        }
    }
View Full Code Here


    public void dispose() {
        model.removePropertyChangeListener(modelListener);
        DebugService svc = model.getDebugService();
        synchronized (svc) {
            svc.removeListener(debugServiceListener);
            DebugSession session = svc.getCurrentSession();
            if (session != null) {
                session.removeListener(sessionListener);
            }
        }
    }
View Full Code Here

            public void run() {
                clear();
                if (itemLookup != null) {
                    DebugService svc = model.getDebugService();
                    synchronized (svc) {
                        DebugSession session = svc.getCurrentSession();
                        if (session != null) {
                            decorateWithSessionInfo(session);
                        }
                    }
                }
            }

            private void decorateWithSessionInfo(DebugSession session) {
                IntegrationEntity debuggee = itemLookup.getEntity(session.getDebugeeId());
                if (debuggee != null) {
                    setDebuggee(debuggee);
                    switch (session.getState()) {
                    case PAUSED:
                        writePausedInfo(session);
                        break;
                    case RUNNING:
                        writeRunning();
                        break;
                    case DONE:
                    case IDLE:
                        // Nothing to do
                    }
                }
            }

            private void writeRunning() {
                postfix.setText("[running]");
            }

            private void writePausedInfo(DebugSession session) {
                String text = "[" + getBreakLocationInfo(session) + "]";
                postfix.setText(text);
            }

            private String getBreakLocationInfo(DebugSession session) {
                return getLabelBuilder(session).build();
            }

            private BreakLocation getBreakLocation(DebugSession session) {
                TestResult result = session.getResult();
                if (result != null) {
                    BreakLocation[] callstack = result.getCallStack();
                    if (callstack != null && callstack.length > 0) {
                        return callstack[0];
                    }
View Full Code Here

        testProviderId.set(id);
    }

    private void setInitialState() {
        synchronized (debugService) {
            DebugSession session = debugService.getCurrentSession();
            if (session != null) {
                setDisableBreakpoints(!session.getParams().isObservingBreakpoints());
                updateTestProviderId(session);
            }
        }
    }
View Full Code Here

            };
            debugSvcListener = new DebugServiceListener() {

                @Override
                public void newDebugSessionStarted(DebugServiceEvent evt) {
                    DebugSession session = evt.getSession();
                    setSession(session);
                    session.addListener(debugSessionListener);
                }

                @Override
                public void debugSessionEnded(DebugServiceEvent evt) {
                    setSession(null);
                    setLineNumber(-1);
                    dataElementsModel.stopTest();
                }
            };
            deListener = new PropertyChangeListener() {

                @Override
                public void propertyChange(PropertyChangeEvent evt) {
                    updateDebuggingParamsDataElements();
                }

                private void updateDebuggingParamsDataElements() {
                    DebugSession session = getSession();
                    if (session != null) {
                        DebuggingParametersBuilder paramsBuilder = new DebuggingParametersBuilder(session.getParams());
                        paramsBuilder.setDataElements(dataElementsModel.getDataElements());
                        session.setParams(paramsBuilder.build());
                    }
                }
            };
        }
View Full Code Here

            };
        }

        public synchronized void install() {
            debugState = debugService.getState();
            DebugSession currentSession = debugService.getCurrentSession();
      setSession(currentSession);
      if (currentSession != null) {
        currentSession.addListener(debugSessionListener);
      }
            update();
            expressionArea.getDocument().addDocumentListener(docListener);
            debugService.addListener(debugSvcListener);
            dataElementsModel.addPropertyChangeListener(ScriptDataElementsModel.DATA_ELEMENTS, deListener);
View Full Code Here

            updateStartActionState();
            updateDataElements();
        }

        private void updateDataElements() {
            DebugSession session = getSession();
            if (session != null) {
                TestResult result = session.getResult();
                if (result != null) {
                    dataElementsModel.setDataElementsReturnedFromServer(result.getDataElements());
                }
            }
        }
View Full Code Here

        this.callback = callback;
    }

    public void stop() {
        synchronized (service) {
            DebugSession session = service.getCurrentSession();
            if (session == null) {
                callback.succeeded(null);
                return;
            }
            latch = new CountDownLatch(1);
            listener = new StopListener();
            service.addListener(listener);
            session.getController().stop();
        }
        waitForTermination();
    }
View Full Code Here

        });
    }

    private void openUiIfSessionStillActive() {
        synchronized (service) {
            DebugSession session = service.getCurrentSession();
            if (session == null) {
                // The session was terminated during the invokeLater.
                requestNewSession();
            } else {
                TestInProgressMessage message = new TestInProgressMessage(session, entityLookup, new ContinueHandler(),
View Full Code Here

    private class ContinueHandler implements ActionListener {

        @Override
        public void actionPerformed(ActionEvent e) {
            synchronized (service) {
                DebugSession session = service.getCurrentSession();
                if (session != null) {
                    session.getController().resume(session.getParams());
                }
            }
        }
View Full Code Here

TOP

Related Classes of org.jitterbit.integration.debug.client.DebugSession

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.