cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carsten Ziegeler" <cziege...@s-und-n.de>
Subject RE: [Kernel22] How to develop a component?
Date Thu, 08 Apr 2004 14:15:04 GMT
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


Mime
View raw message