Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 311943 - Implementation of CommandServiceCreationFunction
Summary: Implementation of CommandServiceCreationFunction
Status: CLOSED WONTFIX
Alias: None
Product: e4
Classification: Eclipse Project
Component: UI (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact: Paul Webster CLA
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-06 14:01 EDT by Oleg Besedin CLA
Modified: 2019-06-02 01:36 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Oleg Besedin CLA 2010-05-06 14:01:26 EDT
Please reconsider implementation of the CommandServiceCreationFunction.

It stores CommandServiceImpl both in a local variable and in the "root" context.  The CommandServiceCreationFunction is essentially a singleton hence after it is called once, the CommandServiceImpl will always be taken from a local variable.

Is there some reason why this function has to have such strange implementation? If it has some special requirements, I'd be happy to assist; but from a quick looks we just need CommandServiceImpl added to the application context like other services.
Comment 1 Paul Webster CLA 2010-07-09 13:45:28 EDT
it needs to provide 2 things for the commands/handlers to work, ECommandService and CommandManager in the context.  But yes, they need to be singletons.

ECommandService is an interface, so I guess I could turn that into an OSGi service by itself.

If CommandManager is a class, can I still make that an OSGi service?

PW
Comment 2 Oleg Besedin CLA 2010-07-09 13:52:19 EDT
How about addding them in the E4Application#createDefaultContext() ? 

(I don't see any benefit from adding extra layers by using DS, but I am not familiar with the commands code.)
Comment 3 Paul Webster CLA 2010-07-12 13:11:44 EDT
(In reply to comment #2)
> How about addding them in the E4Application#createDefaultContext() ? 
> 

Everything that was added in there was failure ... i.e. we were supposed to create a modular set of services, but we added them there when we couldn't figure out the lifecycle stuff correctly.

PW
Comment 4 Eclipse Genie CLA 2019-06-02 01:36:18 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.

--
The automated Eclipse Genie.