Community
Participate
Working Groups
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
Simon or BJ, do you have any wording advice on the enabled/immediate attributes on a service component?
Created attachment 111517 [details] immediate and enabled buttons
committed to HEAD.
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."
(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?
(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).