|
|
|
|
Re: name of the active bundle [message #1733731 is a reply to message #1733702] |
Tue, 31 May 2016 09:38 |
Erik Vande Velde Messages: 82 Registered: September 2012 |
Member |
|
|
1) Let's start with the use case:
- Our e4 client has a JMS connector to a server application
- sometimes the server goes down, and then we land up in the 'onException' method of our connector
- there we want to show the user, in a message box, that the connection is lost
2) Technical challenges
- It seems logical that the jms connector is a service, and my present task is to convert it from a class in the eclipse context to a dynamic service
- The connector uses a 'GeneralErrorHandler' class (which was annotated with Creatable), invoking its handleException method to show the message to the user
- Before my task we used the eclipse context to inject the handler in the connector
- Because I'm using DS I'm also trying to convert the GeneralErrorHandler into a dynamic service
- Stumbling block: GeneralErrorHandler has an injected field of type BundleContext (NOT a dynamic service), with as only purpose to find a plug-in identifier
- That identifier is needed because in the end we use ErrorDialog.openError(activeShell, "Error", message, status)
- status is of type IStatus, which has a required field 'plug-in identifier'
3) current status
- Thanks to Christoph's contribution I succeeded in making GeneralErrorHandler a DS: the bundle id is dynamically obtained when constructing the status
- But we still have a 'code smell' here: the dynamic service GeneralErrorHandler wants to do something in the presentation layer
- So my current question is: how would you propagate a jms connection error message from the OSGi services layer to the presentation layer ?
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04405 seconds