本文整理匯總了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});
}
}