use of org.jboss.tools.openshift.internal.core.server.debug.OpenShiftDebugMode 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();
}
use of org.jboss.tools.openshift.internal.core.server.debug.OpenShiftDebugMode 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();
}
use of org.jboss.tools.openshift.internal.core.server.debug.OpenShiftDebugMode in project jbosstools-openshift by jbosstools.
the class OpenShiftLaunchController method launch.
@Override
public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
OpenShiftServerBehaviour beh = OpenShiftServerUtils.getOpenShiftServerBehaviour(configuration);
String currentMode = beh.getServer().getMode();
beh.setServerStarting();
launchServerProcess(beh, launch, monitor);
try {
if (waitForDeploymentConfigReady(beh.getServer(), monitor)) {
DebugContext context = createDebugContext(beh, monitor);
toggleDebugging(mode, beh, context, monitor);
if (!isDebugMode(mode)) {
// enable devmode if we're not in debug mode. Debug mode has dev mode enabled
// anyhow
enableDevMode(context);
}
new OpenShiftDebugMode(context).execute(monitor);
}
} catch (Exception e) {
mode = currentMode;
throw new CoreException(StatusFactory.errorStatus(OpenShiftCoreActivator.PLUGIN_ID, NLS.bind("Could not launch server {0}", beh.getServer().getName()), e));
} finally {
setServerState(beh, mode, monitor);
}
}
use of org.jboss.tools.openshift.internal.core.server.debug.OpenShiftDebugMode 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();
}
Aggregations