use of org.jboss.tools.openshift.internal.core.server.debug.DebugLaunchConfigs in project jbosstools-openshift by jbosstools.
the class OpenShiftShutdownController method stop.
@Override
public void stop(boolean force) {
OpenShiftServerBehaviour behavior = getBehavior();
behavior.setServerStopping();
try {
DebugLaunchConfigs configs = DebugLaunchConfigs.get();
if (configs != null) {
configs.terminateRemoteDebugger(behavior.getServer());
}
// configs should only be null if workspace is shutting down, so set server to stopped anyway
behavior.setServerStopped();
} catch (CoreException ce) {
log(IStatus.ERROR, "Error shutting down server", ce);
getBehavior().setServerStarted();
}
}
use of org.jboss.tools.openshift.internal.core.server.debug.DebugLaunchConfigs in project jbosstools-openshift by jbosstools.
the class OpenShiftLaunchController method attachRemoteDebugger.
private ILaunch attachRemoteDebugger(IServer server, int localDebugPort, IProgressMonitor monitor) throws CoreException {
monitor.subTask("Attaching remote debugger...");
ILaunch ret = null;
DebugLaunchConfigs launchConfigs = DebugLaunchConfigs.get();
if (launchConfigs == null) {
throw toCoreException(NLS.bind("Could not get launch config for server {0} to attach remote debugger", server.getName()));
}
ILaunchConfiguration debuggerLaunchConfig = launchConfigs.getRemoteDebuggerLaunchConfiguration(server);
ILaunchConfigurationWorkingCopy workingCopy = getLaunchConfigWorkingCopy(server, launchConfigs, debuggerLaunchConfig);
if (workingCopy == null) {
throw toCoreException(NLS.bind("Could not modify launch config for server {0}", server.getName()));
}
IProject project = OpenShiftServerUtils.getDeployProject(server);
launchConfigs.setupRemoteDebuggerLaunchConfiguration(workingCopy, project, localDebugPort);
debuggerLaunchConfig = workingCopy.doSave();
ret = lauchDebugger(debuggerLaunchConfig, localDebugPort, monitor);
if (ret == null) {
throw toCoreException(NLS.bind("Could not start remote debugger to (forwarded) port {0} on localhost", localDebugPort));
}
monitor.worked(10);
return ret;
}
use of org.jboss.tools.openshift.internal.core.server.debug.DebugLaunchConfigs 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();
}
Aggregations