Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 245999 - [ds] need a way to set enabled and immediate fields on overview page
Summary: [ds] need a way to set enabled and immediate fields on overview page
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.5   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: 3.5 M2   Edit
Assignee: Rafael Oliveira Nóbrega CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-02 14:13 EDT by Chris Aniszczyk CLA
Modified: 2008-09-02 15:42 EDT (History)
2 users (show)

See Also:


Attachments
immediate and enabled buttons (4.81 KB, text/plain)
2008-09-02 14:55 EDT, Rafael Oliveira Nóbrega CLA
caniszczyk: iplog+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Aniszczyk CLA 2008-09-02 14:13:29 EDT
On the overview page, we have no way to set whether a component is immediate or enabled. I recommend that we have two checkboxes, similar to what we do with the MANIFEST.MF and lazy activation.

[x] This service component is enabled when started
[x] This service component is immediately activated
Comment 1 Chris Aniszczyk CLA 2008-09-02 14:14:12 EDT
Simon or BJ, do you have any wording advice on the enabled/immediate attributes on a service component? 
Comment 2 Rafael Oliveira Nóbrega CLA 2008-09-02 14:55:27 EDT
Created attachment 111517 [details]
immediate and enabled buttons
Comment 3 Chris Aniszczyk CLA 2008-09-02 15:10:32 EDT
committed to HEAD.
Comment 4 BJ Hargrave CLA 2008-09-02 15:18:24 EDT
immediate: the wording here will be a bit awkward. There was a clarification
made to the spec. See https://www.osgi.org/bugzilla/show_bug.cgi?id=34 for the
updated description for the immediate attribute.

"Controls whether component configurations must be immediately
activated after becoming satisfied or whether activation should be delayed. The
default value is false if the factory attribute or if the service element is
specified and true otherwise. If this attribute is specified, its value must be
false if the factory attribute is also specified or must be true unless the
service element is also specified."

So whether the user is allowed to chose true or false depends on the presence
or settings of other information in the description.

enabled: see section 112.4.3 in the spec. 

"Controls whether the component is enabled when the bundle 
is started. The default value is true. If enabled is set to false, the com- 
ponent is disabled until the method enableComponent is called on the 
ComponentContext object. This allows some initialization to be per- 
formed by some other component in the bundle before this component 
can become satisfied."

Comment 5 Chris Aniszczyk CLA 2008-09-02 15:22:49 EDT
(In reply to comment #4)
> immediate: the wording here will be a bit awkward. There was a clarification
> made to the spec. See https://www.osgi.org/bugzilla/show_bug.cgi?id=34 for the
> updated description for the immediate attribute.
> 
> "Controls whether component configurations must be immediately
> activated after becoming satisfied or whether activation should be delayed. The
> default value is false if the factory attribute or if the service element is
> specified and true otherwise. If this attribute is specified, its value must be
> false if the factory attribute is also specified or must be true unless the
> service element is also specified."
> 
> So whether the user is allowed to chose true or false depends on the presence
> or settings of other information in the description.

So wait a minute, is there any control over this attribute or is this just inferred whether or not you have a factory or referenced services?

Comment 6 BJ Hargrave CLA 2008-09-02 15:42:45 EDT
(In reply to comment #5) 
> So wait a minute, is there any control over this attribute or is this just
> inferred whether or not you have a factory or referenced services?
> 

Yes there is control but only in certain circumstances.

The default value is implied by other information.

If factory is specified, immediate must be false (or unspecified in which case it defaults to false). So don't even ask the user for how to set immediate if factory is specified.

If the service elements is NOT specified, then immediate must be true (or unspecified in which case it defaults to true). Having a component which is not immediate and not a service means that it will never be activated. There is no trigger to activate it. So don't even ask the user for how to set immediate if service is NOT specified.

So immediate is really only interesting for the user to set if service IS specified (and factory is NOT specified).