Bug 225853 - [terminal][api][breaking] Abstract base class TerminalConnectorImpl should provide more default functionality
Summary: [terminal][api][breaking] Abstract base class TerminalConnectorImpl should pr...
Status: RESOLVED FIXED
Alias: None
Product: Target Management
Classification: Tools
Component: Terminal (show other bugs)
Version: 3.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 3.0 M6   Edit
Assignee: Martin Oberhuber CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords: api
Depends on: 200541
Blocks: 170910
  Show dependency tree
 
Reported: 2008-04-04 17:11 EDT by Martin Oberhuber CLA
Modified: 2008-04-06 15:13 EDT (History)
1 user (show)

See Also:
eclipse: review+


Attachments
Patch providing requested change (25.38 KB, patch)
2008-04-04 17:20 EDT, Martin Oberhuber CLA
mober.at+eclipse: review?
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Oberhuber CLA 2008-04-04 17:11:25 EDT
For cases like in bug 170910, where the ITerminalConnector is synthesized programmatically rather than coming from an extension, calls like loadSettings(), storeSettings() and makeSettingsPage() do not make any sense to be implemented.

Therefore, the TerminalConnectorImpl abstract base class should provide default implementations of these methods. Also, default implementations should be provided for those methods that require some functionality, such as calling IterminalControl.setState(CLOSED) on disconnect(). 

Pushing such default functionality into the abstract base class ensures consistency, ability to extend common default functionality in the future, and makes sure that required operations are always performed.

At the same time, I recommend renaming TerminalConnectorImpl#getOutputStream() to TerminalConnectorImpl#getTerminalToRemoteStream() for consistency with ITerminalConnector.
Comment 1 Martin Oberhuber CLA 2008-04-04 17:20:37 EDT
Created attachment 94931 [details]
Patch providing requested change

Attached patch makes the requested change.

Michael Please review -- two unit tests are currently failing and I don't quite see why (testIsInitialized and testGetAdapter). Perhaps these have been failing before the proposed change already.

Migration Docs for users: None
Migration Docs for providers of terminal connectors:
* Migrate according to bug 200541 first (extend TerminalConnectorImpl)
* Rename local getOutputStream() to getTerminalToRemoteStream()
* Rename local disconnect() to doDisconnect(), and get rid of 
  fControl.setState() at the end
* Add super.connect(control) at the beginning of connect(control) impl
* Get rid of fTerminalControl, it's protected now
* Get rid of any other method implementations that are now unneeded, 
  e.g. isLocalEcho()
Comment 2 Michael Scharf CLA 2008-04-04 20:24:33 EDT
the patch looks good!
Applied :-)