DM/ Annotations should allow to enable or disable auto-configuration mode.
--------------------------------------------------------------------------

                 Key: FELIX-2965
                 URL: https://issues.apache.org/jira/browse/FELIX-2965
             Project: Felix
          Issue Type: Improvement
            Reporter: Pierre De Rop
            Assignee: Pierre De Rop
            Priority: Minor


This issue only concerns dependency manager annotations, not the core API.

Currently, when using dependency manager annotations, components are 
automatically injected with the following 
objects (in class fields):

- BundleContext
- Component
- DependencyManager
- ServiceRegsitration.

A new annotation "@Inject" should allow to enable/disable such 
auto-configuration mode.

For example:

@Component 
class MyComponent; {
   @Inject
   BundleContext bc;

   @Inject
   DependencyManager dm;

   @Inject
   Component component;
}

By default, auto-configuration should be disabled, unless the @Inject 
annotation is used. (but for backward compat, the auto-config mode should be 
enabled by default if the osgi bundle context  "dm.runtime.autoconfig" property 
is set to true).

The ServiceRegistration should be provided in a callback method, in order to 
notify the component that it has been registered.
This callback method can be annotated with the @Registered annotation, and the 
method may then take a "ServiceRegistration" parameter, which is the object 
that was used to register the service.
Likewise, @Unregistered annotation should also be added to the annotation API, 
in order to notify the component that is has been unregistered from the 
registry.
@Unregistered can be useful if the component is using the @LifecycleController, 
or if it is using some "instance-bound" extra dependencies (using the API).



--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to