本文整理汇总了Java中org.eclipse.debug.core.model.IProcess.getStreamsProxy方法的典型用法代码示例。如果您正苦于以下问题:Java IProcess.getStreamsProxy方法的具体用法?Java IProcess.getStreamsProxy怎么用?Java IProcess.getStreamsProxy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.debug.core.model.IProcess
的用法示例。
在下文中一共展示了IProcess.getStreamsProxy方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkErrorMessage
import org.eclipse.debug.core.model.IProcess; //导入方法依赖的package包/类
/**
* Checks and forwards an error from the specified process
*
* @param process
* @throws CoreException
*/
private void checkErrorMessage( IProcess process ) throws CoreException
{
IStreamsProxy streamsProxy = process.getStreamsProxy( );
if ( streamsProxy != null )
{
String errorMessage = streamsProxy.getErrorStreamMonitor( )
.getContents( );
if ( errorMessage.length( ) == 0 )
{
errorMessage = streamsProxy.getOutputStreamMonitor( )
.getContents( );
}
if ( errorMessage.length( ) != 0 )
{
abort( errorMessage,
null,
IJavaLaunchConfigurationConstants.ERR_VM_LAUNCH_ERROR );
}
}
}
示例2: checkErrorMessage
import org.eclipse.debug.core.model.IProcess; //导入方法依赖的package包/类
protected void checkErrorMessage(IProcess process) throws CoreException {
IStreamsProxy streamsProxy = process.getStreamsProxy();
if (streamsProxy != null) {
String errorMessage = streamsProxy.getErrorStreamMonitor()
.getContents();
if (errorMessage.length() == 0) {
errorMessage = streamsProxy.getOutputStreamMonitor()
.getContents();
}
if (errorMessage.length() != 0) {
abort(errorMessage, null,
IJavaLaunchConfigurationConstants.ERR_VM_LAUNCH_ERROR);
}
}
}
示例3: launchChanged
import org.eclipse.debug.core.model.IProcess; //导入方法依赖的package包/类
@Override
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});
}
}