clement escoffier wrote:
> That is not directly possible. However, you can do this as following:
> public class ConsumerImpl {
> // Temporal dependency on FooService
> FooService fs;
>
> // An helper object
> ConsumerHelper helper;
>
>
> public ConsumerImpl() {
> helper = new ConsumerHelper(new FooService() {
> public void doSomething() {
> System.out.println("Delegate on fs");
> // Use the temporal dependency
> fs.doSomething();
> }
> });
>
> }
> }
>
> So, you create a kind of smart proxy delegating on the temporal dependency
> (on regular dependency). By doing this:
> - The helper object inherits of the dependency behavior
> (default-implementation, nullable ...)
> - You can control the delegation policy
According to this FAQ item:
http://felix.apache.org/site/accessing-services-inside-inner-and-anonymous-classes.html
the above example will not work unless a getFooService() method is added to the
outer component.
Than the anonymous proxy must delegate to the service using the getter:
getFooService().doSomething(). Did you make an innocent mistake or iPojo now
instruments the
internal classes as well as the component class? (I certainly hope so :)
Cheers,
Todor
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]