Bug 193110 - [ErrorHandling] StatusManager cannot be used in headless applications
Summary: [ErrorHandling] StatusManager cannot be used in headless applications
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Krzysztof Daniel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 220557 282157
Blocks:
  Show dependency tree
 
Reported: 2007-06-18 10:09 EDT by Michael Scharf CLA
Modified: 2019-12-29 04:38 EST (History)
14 users (show)

See Also:


Attachments
some work in progress (even does not compile) (28.45 KB, patch)
2009-02-24 09:03 EST, Krzysztof Daniel CLA
no flags Details | Diff
mylyn/context/zip (115.98 KB, application/octet-stream)
2009-02-24 09:03 EST, Krzysztof Daniel CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Scharf CLA 2007-06-18 10:09:39 EDT
StatusManager is part of the UI and can not be used in headless applications. 

The API only uses non UI classes and interfaces. But the class is defined in eclipse.ui.workbench. This prevents us from using it in headless applications.

Is there a reason why it ended up in platform UI?

I think it should be part of Platform Runtime!

==> now, we have to implement our own status manager that can be used for headless applications :-(
Comment 1 Szymon Brandys CLA 2007-06-20 14:33:04 EDT
We should consider moving the facility to the Platform Runtime.
Comment 2 Krzysztof Daniel CLA 2008-02-18 05:37:42 EST
How this can be achieved (API)?
Comment 3 Stefan Liebig CLA 2009-02-10 03:31:15 EST
In Riena (http://www.eclipse.org/riena/) we have something similar called ExceptionHandlerManager that is responsible for handling exceptions. The exception handler manager (service) asks registered exception handlers (extension point) to handle the exception (using the chain of command pattern).
The exception handler manager will be called from execution roots to handle uncaught exceptions.
We use this mechanism on both client and server side and it is independent of UI. However, a specific handler can contain UI code.

We should explore if there is a possibility for joining.
Comment 4 Krzysztof Daniel CLA 2009-02-12 09:51:40 EST
Stefan, 
could you please point me which classes (and projects) I should look at?

Comment 5 Stefan Liebig CLA 2009-02-12 10:03:12 EST
Christopher,

sure, start with the SimpleExceptionHandlerManager in bundle org.eclipse.riena.core. This is a service implementation that is used here:
- ApplicationAdvisor in bundle org.eclipse.riena.navigation.ui.swt
  This covers uncaught errors in the UI
- StartupsSafeRunnable in bundle org.eclipse.riena.core
  This covers uncaught errors for bundles that get started eagerly
- RienaHessianDispatcherServlet in bundle org.eclipse.riena.communication.publisher.hessian
    This covers uncaught errors on the sever side

The exception handler manager uses instances of IExceptionHandler (bundle org.eclipse.riana.core) to handle the uncaught exceptions.

hth

Stefan

Comment 6 Krzysztof Daniel CLA 2009-02-24 09:03:31 EST
Created attachment 126556 [details]
some work in progress (even does not compile)
Comment 7 Krzysztof Daniel CLA 2009-02-24 09:03:55 EST
Created attachment 126557 [details]
mylyn/context/zip
Comment 8 Szymon Brandys CLA 2009-07-01 18:55:39 EDT
Next time when you move a bug to yourself, please at least add me to the cc list, please.

Looking at the patch, your idea is quite different from what I think is the right fix for this issue. You can be right though. Could you explain what is your plan for the bug?

Some thoughts on the bug:
1) We should consider creating a separate core status handlers plug-in. This plug-in could provide the status handler ext. point and the mechanism to manage it. core.runtime could have an optional dependency to it. This is the purpose of bug 282157.

2) IMO, this bug is a duplicate of bug 282157. This bug could perhaps be used to re-implement the status handler mechanism in the ui plug-in to use the one implemented in the core.

3) John A. should be added here.
Comment 9 Krzysztof Daniel CLA 2009-07-02 03:00:33 EDT
Sorry for this assignement change. 

My plan of work currently is limited to opening bug 282157. Below is my vision:

In this bug I'd like to introduce OSGI-integrated logging service, which could be later adopter by other products. I know it looks like duplicate, but it is not. Subsequent work needs to be done:
1. Further integration of ui.StatusManager and Equinox StatusHandler with separation of "reporting" and "handling" facilities. 
1a. Progress needs new solution of error handling to solve bug 279748 (jobs are not kept after the dialog is shown) and correctly resolve double error reporting (one issue is logged from core.jobs, another one, wrapped in different class[2] is reported by ProgressUI).
2. Currently we have 3 classes that act for the same thing: IStatus, StatusAdapter, FrameworkLogEntry. They need to be unified into one item (IExtendedStatus) which would be flexible enough to serve all purposes. This work is partially done in 282157.
3. Removing RuntimeLog. In bug 282157 it is deprecated, but actually it needs to be fully removed at the end of 3.6 cycle. This should be easy, because we will have Equinox StatusHandler at this point.
4. IExtendedStatus derived from IStatus will allow for (finally!) hijacking jface ErrorDialog.openError. One consistency issue less.
5. StatusAdapter should be deprecated (to avoid containerism containerism) and IStatus should be discouraged (and recommend IExtendedStatus). Full compatibility with IStatus-based JFace can be achieved (no need to wrap in StatusAdapter).
6. Deprecating StatusManager if possible.

I believe that those 5 issues allows for proper use of StatusHandling in OSGI apps.

Comment 10 Pawel Pogorzelski CLA 2009-07-29 07:57:46 EDT
One more reason for the refactoring can be found at bug 173272, comment 5.
Comment 11 Eclipse Webmaster CLA 2019-09-06 16:06:54 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.
Comment 12 Alexander Fedorov CLA 2019-12-29 04:38:36 EST
It was reported long ago but I think it is still actual. Do we have a clear vision about error reporting best practices at the moment?