On 6/2/10 12:22 PM, Felix Meschberger wrote: > Hi, > > On 02.06.2010 13:58, Norbert Somlai wrote: >> >> Hi, >> >> I know how to use FileInstall or the Web Console to reconfigure a component. >> What I could not find is a way to declaratively configure a component >> instance in component.xml, so I could keep the reference and the >> configuration at the same place. Something like >> >> <reference interface="com.acme.IInterface" bind="setInterface" >> unbind="unsetInterface" policy="dynamic" cardinality="1..1" > >> >> <property name="param1" value="value1"/> >> ... >> </reference> >> >> and the ComponentContext on activation would contain this property so the >> new instance could initialize itself with it. >> >> Is there a way to achieve something like this with DS or DS+CM? > > I think there is a misconception here: > > The reference element is used to declare that the component uses a > service from the service registry. The attributes define further > requirements, e.g. the target property can be used to select the actual > services. > > The property element is used to configure the component itself. > > The configuration of the referenced service, which I assume is what you > are referring to, is not the task of the component. That service must > care for its configuration itself. ...and this is exactly the same as Spring DM.
> > Regards > Felix > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]

