Leo Sutic wrote:
> 
> interface StatefulComponent {
>     public void login (); // never throws any exception, ever.
>     public void doOperation (); // never throws any exception, ever.
>     public void logout (); // never throws any exception, ever.
> }
> 
> Client.java:
> 
>     StatefulComponent comp = (StatefulComponent) 
>         manager.lookup(StatefulComponent.ROLE);
>     try {
>         comp.login ();
>         // (1)
>         comp.doOperation ();
>         comp.logout ();
>     } finally {
>         manager.release (comp);
>     }
> 
> If a block reload of the implementation of StatefulComponent 
> occurs at (1), the comp proxy will be invalidated while in 
> use, and the operation will fail.
> 
> This is contrary to Avalon semantics, where a component 
> reference, once obtained, remains valid until it is released.
> 
> Of course there are ways to code around this (or ignore it) 
> in the vast majority of cases.
> 
How does the working code look like? 

Carsten

Reply via email to