On 4/9/10 8:07, Bengt Rodehav wrote:
> I'm using iPOJO to publish OSGI service on Felix. For logging purposes
> (and for some other purposes as well), I need access to the started
> service's ServiceReference. How can I get hold of the ServiceReference
> from an iPOJO component? Intuitively it makes sense to start using it
> in the method marked with @Validate since I assume that the service
> has then just been started.
>
> How can I accomplish this?
>
Actually, there is no automatic way for a component to get this
information about itself. You'd need to get the bundle context in your
constructor and then manually publish your services in the @Validate method.
I suppose it would be possible to support this by allowing the @Validate
method to receive a set of service references. Although this hasn't been
needed up until now, feel free to open a feature request if you think it
is necessary.
Thanks.
-> richard
> /Bengt
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org
|