On 10.10.2010, at 18:59, Richard S. Hall wrote: > On 10/8/10 17:38, sam lee wrote: >> Hey, >> >> I can get a Service instance from another Service by using: >> @Reference >> private MyService myService; >> >> But, how can I get a reference to MyService instance from a POJO? >> Since the POJO will be used in some other service, should I get MyService >> reference from the service POJO is being used and pass to it? >> >> Or, is there some factory POJO can use? > > If I understand correctly, you want to use a service in a POJO that is not an > iPOJO component (i.e., no @Component). In that case, assuming you are using a > recent version of iPOJO that injects proxies by default, you should just pass > the injected reference from your component to the POJO.
For iPOJO, it's exactly what Richard has described, but is this question about SCR or iPOJO ? iPOJO do not have @Reference (at least not as core annotations) Regards, Clement > > -> richard > >> Thanks. >> Sam >> > > --------------------------------------------------------------------- > 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]

