Search in sources :

Example 1 with IDebugListener

use of org.jboss.tools.openshift.internal.core.server.debug.IDebugListener in project jbosstools-openshift by jbosstools.

the class OpenShiftLaunchController method startDebugging.

protected void startDebugging(OpenShiftServerBehaviour behaviour, DebugContext context, IProgressMonitor monitor) {
    IDebugListener listener = new IDebugListener() {

        @Override
        public void onDebugChange(DebugContext context, IProgressMonitor monitor) throws CoreException {
            int localPort = mapPortForwarding(context, monitor);
            ILaunch debuggerLaunch = attachRemoteDebugger(behaviour.getServer(), localPort, monitor);
            if (debuggerLaunch != null) {
                overrideHotcodeReplace(behaviour.getServer(), debuggerLaunch);
            }
        }

        @Override
        public void onPodRestart(DebugContext debuggingContext, IProgressMonitor monitor) throws CoreException {
            onDebugChange(debuggingContext, monitor);
        }
    };
    context.setDebugListener(listener);
    new OpenShiftDebugMode(context).enableDebugging();
}
Also used : OpenShiftDebugMode(org.jboss.tools.openshift.internal.core.server.debug.OpenShiftDebugMode) IDebugListener(org.jboss.tools.openshift.internal.core.server.debug.IDebugListener) IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) ILaunch(org.eclipse.debug.core.ILaunch) DebugContext(org.jboss.tools.openshift.internal.core.server.debug.DebugContext)

Example 2 with IDebugListener

use of org.jboss.tools.openshift.internal.core.server.debug.IDebugListener in project jbosstools-openshift by jbosstools.

the class OpenShiftLaunchController method stopDebugging.

private void stopDebugging(DebugContext context, IProgressMonitor monitor) {
    IDebugListener listener = new IDebugListener() {

        @Override
        public void onDebugChange(DebugContext context, IProgressMonitor monitor) throws CoreException {
            DebugLaunchConfigs configs = DebugLaunchConfigs.get();
            if (configs != null) {
                configs.terminateRemoteDebugger(getServer());
            }
            unMapPortForwarding(context.getPod());
        }

        @Override
        public void onPodRestart(DebugContext debuggingContext, IProgressMonitor monitor) throws CoreException {
        }
    };
    context.setDebugListener(listener);
    new OpenShiftDebugMode(context).disableDebugging();
}
Also used : OpenShiftDebugMode(org.jboss.tools.openshift.internal.core.server.debug.OpenShiftDebugMode) IDebugListener(org.jboss.tools.openshift.internal.core.server.debug.IDebugListener) IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) DebugLaunchConfigs(org.jboss.tools.openshift.internal.core.server.debug.DebugLaunchConfigs) DebugContext(org.jboss.tools.openshift.internal.core.server.debug.DebugContext)

Example 3 with IDebugListener

use of org.jboss.tools.openshift.internal.core.server.debug.IDebugListener in project jbosstools-openshift by jbosstools.

the class OpenShiftNodejsLaunchController method startDebugging.

@Override
protected void startDebugging(OpenShiftServerBehaviour beh, DebugContext context, IProgressMonitor monitor) {
    IDebugListener listener = new IDebugListener() {

        @Override
        public void onDebugChange(DebugContext debuggingContext, IProgressMonitor monitor) throws CoreException {
            int localPort = mapPortForwarding(debuggingContext, monitor);
            NodeDebugLauncher.launch(beh.getServer(), localPort);
        }

        @Override
        public void onPodRestart(DebugContext debuggingContext, IProgressMonitor monitor) throws CoreException {
            onDebugChange(debuggingContext, monitor);
        }
    };
    context.setDebugListener(listener);
    new OpenShiftDebugMode(context).enableDebugging();
}
Also used : OpenShiftDebugMode(org.jboss.tools.openshift.internal.core.server.debug.OpenShiftDebugMode) IDebugListener(org.jboss.tools.openshift.internal.core.server.debug.IDebugListener) IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) DebugContext(org.jboss.tools.openshift.internal.core.server.debug.DebugContext)

Aggregations

IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)3 DebugContext (org.jboss.tools.openshift.internal.core.server.debug.DebugContext)3 IDebugListener (org.jboss.tools.openshift.internal.core.server.debug.IDebugListener)3 OpenShiftDebugMode (org.jboss.tools.openshift.internal.core.server.debug.OpenShiftDebugMode)3 ILaunch (org.eclipse.debug.core.ILaunch)1 DebugLaunchConfigs (org.jboss.tools.openshift.internal.core.server.debug.DebugLaunchConfigs)1