Yes, I understand your point. But for me is like where you need to resolve the dependencies of a bundle. It is true that the bundle cannot work without having its dependencies resolved and thus, is blocking for the bundle initialization.
The same thing (but at different level) is for me the configuration of the bean. If one bean in the bundle is a singleton, and that bean needs a configuration. I don't see the point to having the bean initialized without the configuration.
Talking with xml, you configure a singleton with managed props like this:
Code:
<bean id="managedComponent" class="MessageTank">
<osgix:managed-properties persistent-id="com.xyz.messageservice"/>
</bean>
My complain is that the bean is created without configuration.
What would be great is to have something (similar to factory) like:
Code:
<osgix:managed-propeties pid="com.xyz.messageservice" auto-export="interface"> ·
<bean class="com.xyz.MessageTank"/> ¸
</osgix:managed-properties>
Which would mean: Instantiate a singleton "com.xyz.MessageTank" when the configuration with pid com.xyz.messageservice arrives. If the configuration does not arrives, the service will not be available.
This way we know the singleton is there, and available as a service, only when its configuration arrives.