in plugins/org.apache.karaf.eik.ui/src/main/java/org/apache/karaf/eik/ui/workbench/internal/GenericKarafWorkbenchService.java [111:158]
public void launchChanged(final ILaunch launch) {
if (!isKarafLaunch(launch)) {
return;
}
for (final IProcess process : launch.getProcesses()) {
if (getConsoleDocument(process) != null) {
continue;
}
if (process.getStreamsProxy() == null) {
continue;
}
final String encoding = launch.getAttribute(DebugPlugin.ATTR_CONSOLE_ENCODING);
final KarafPlatformModel karafPlatform =
(KarafPlatformModel) launch.getLaunchConfiguration().getAdapter(KarafPlatformModel.class);
final KarafSshConnectionUrl sshConnectionUrl =
(KarafSshConnectionUrl) karafPlatform.getAdapter(KarafSshConnectionUrl.class);
final KarafSshShellConnection.Credentials credentials;
try {
final String username =
launch.getLaunchConfiguration().getAttribute(KarafLaunchConfigurationConstants.KARAF_REMOTE_CONSOLE_USERNAME, "karaf");
final String password =
launch.getLaunchConfiguration().getAttribute(KarafLaunchConfigurationConstants.KARAF_REMOTE_CONSOLE_PASSWORD, "karaf");
credentials = new KarafSshShellConnection.Credentials(username, password);
} catch (final CoreException e) {
throw new AssertionError(e);
}
final KarafRemoteConsole remoteConsole = new KarafRemoteConsole(
process,
sshConnectionUrl,
credentials,
new ConsoleColorProvider(),
launch.getLaunchConfiguration().getName(),
encoding);
remoteConsole.setAttribute(IDebugUIConstants.ATTR_CONSOLE_PROCESS, process);
ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[]{remoteConsole});
}
}