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

I need to have a getter method, which the smart proxy must call and than 
delegate to the returned
instance. Otherwise I will jump over all the nice instrumentation iPojo has 
added for the
"FooService fs;" field. Is this FAQ still valid or does iPojo now instrument 
the inner classes as
well? (I certainly hope it does :)

Cheers,
Todor

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to