Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Target Management » Doesn't get event ISystemResourceChangeEvents.EVENT_COMMAND_SHELL_FINISHED(Cannot finish ssh task (script))
icon1.gif  Doesn't get event ISystemResourceChangeEvents.EVENT_COMMAND_SHELL_FINISHED [message #1625327] Fri, 20 February 2015 09:52 Go to next message
Alex Prybytkouski is currently offline Alex PrybytkouskiFriend
Messages: 2
Registered: February 2015
Location: Minsk
Junior Member

Hi,
I have internal plugin for Eclipse for working by ssh with others computers (by openSSH).
Current plugin working on Eclipse 3.3.2, RSE 2.0.3 and working normally.

Now I should upgrade it till Eclipse 4.3.2 and RSE 3.0.7. And I faced a problem.
In 98% situation I cannot finish my task. I to debug it and compare results of debug (on each step) and I found problem.
Method
org.eclipse.rse.internal.subsystems.shells.servicesubsystem.OutputRefreshJob.runInUIThread(IProgressMonitor)


	public IStatus runInUIThread(IProgressMonitor monitor)
	{
		try
		{
		ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry();
		if (_outputs != null)
		{
			if ((_outputs.length > 0) && (_outputs[0] != null)) {
				registry.fireEvent(
						new SystemResourceChangeEvent(_outputs, ISystemResourceChangeEvents.EVENT_REFRESH, _command));
			}
			
			if (_cwdChanged)
			{
				registry.fireEvent(
						new SystemResourceChangeEvent(_command, ISystemResourceChangeEvents.EVENT_PROPERTY_CHANGE, _command.getCommandSubSystem()));
			}
			
			//Bug 197848: Artificial event for shell termination
			if (_outputs.length == 0 && !_command.isActive()) {
				ISubSystem subsys = _command.getCommandSubSystem();
				//update action states in commands view
				registry.fireEvent(
						new SystemResourceChangeEvent(_command, ISystemResourceChangeEvents.EVENT_COMMAND_SHELL_FINISHED, subsys));
				//update "connected" overlay in SystemView
				registry.fireEvent(
						new SystemResourceChangeEvent(_command, ISystemResourceChangeEvents.EVENT_REFRESH, subsys));
			}
		}
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
		_isComplete= true;
		return Status.OK_STATUS;
	}


What I found. In first input to method the variable
_outputs
contains the needed output. We go in first 'if'
	if ((_outputs.length > 0) && (_outputs[0] != null)) {
		registry.fireEvent(new SystemResourceChangeEvent(_outputs, ISystemResourceChangeEvents.EVENT_REFRESH, _command));
	}

This event to call my method, which outputs all from
_output
to eclipse console. It's normal and all ok.

But what happened in second call this method
runInUIThread
.
In eclipse 3.3.2 the variable '_outputs' not contain anything and I go in
	if (_outputs.length == 0 && !_command.isActive()) {
		ISubSystem subsys = _command.getCommandSubSystem();
		//update action states in commands view
		registry.fireEvent(
				new SystemResourceChangeEvent(_command, ISystemResourceChangeEvents.EVENT_COMMAND_SHELL_FINISHED, subsys));
		//update "connected" overlay in SystemView
		registry.fireEvent(
				new SystemResourceChangeEvent(_command, ISystemResourceChangeEvents.EVENT_REFRESH, subsys));
	}

and initiate "EVENT_COMMAND_SHELL_FINISHED"

But in E4.3.2 '_output' contain my previous output and cannot to initiate "EVENT_COMMAND_SHELL_FINISHED"

Maybe you can suggest anything?
Re: Doesn't get event ISystemResourceChangeEvents.EVENT_COMMAND_SHELL_FINISHED [message #1632398 is a reply to message #1625327] Tue, 24 February 2015 08:46 Go to previous message
Alex Prybytkouski is currently offline Alex PrybytkouskiFriend
Messages: 2
Registered: February 2015
Location: Minsk
Junior Member

Fixed by changing the logic in
org.eclipse.rse.internal.subsystems.shells.servicesubsystem.OutputRefreshJob.java


topic can be closed.
Previous Topic: PyDev code analysis with Eclipse RSE not working due to folder names
Next Topic:RSE + profiling issue
Goto Forum:
  


Current Time: Fri Apr 26 11:40:42 GMT 2024

Powered by FUDForum. Page generated in 0.03151 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top