On Tue, 2010-06-29 at 18:08 +0200, Clement Escoffier wrote:
> Hi,
>
>
> On 29.06.2010, at 16:28, LongkerDandy wrote:
>
> > Hi
> >
> > I've problem to inject the LogService with iPOJO.
> > My environment is:
> > Framwork 3.0.1 with Gogo Shell
> > org.apache.felix.log-1.0.0
> > iPOJO 1.6.2
> >
> > I'm trying to inject the LogService with a field:
> > "private transient LogService logger;"
> > And with iPOJO metadata.xml configured
> >
> >
> > <ipojo>
> > <component name="disks-service"
> > classname="net.redrabbit.homecenter.system.DisksService">
> > <requires field="logger"/>
> > <provides />
> > <callback transition="validate" method="start"/>
> > <callback transition="invalidate" method="stop"/>
> > </component>
> > <instance name="disks-instance" component="disks-service"/>
> > </ipojo>
> >
> >
> > But the logger turned out to be NULL when executing.
> > I can't understand.
>
> This should work. I tried:
> @Component
> @Instantiate
> public class Test {
>
> @Requires
> private transient LogService logger;
>
> @Validate
> public void start() {
> logger.log(LogService.LOG_INFO, "Hello");
> }
> }
>
> And I got the expected result.
>
> Could to post the code of your component ?
>
> Regards,
>
> Clement
>
>
> >
> > Regards
> > LongkerDandy
> >
> >
>
Thanks Clement.
I think you're right.
I made some test and the log service is fine.
It's my component dependency problem,
I will start another thread with that .
Thanks
LongkerDandy
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]