cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jorg Heymans ...@domek.be>
Subject Re: How to initialize a component coming from the pool?
Date Tue, 10 Feb 2004 08:38:26 GMT
Looking at
http://avalon.apache.org/framework/principals/lifecycle.html

Does implementing Startable and Stoppable work?

Jorg

Stephan Coboos wrote:
> Hello,
> 
> I do not understand how to initialize a component which comes from the 
> pool. Please have a look at the following example:
> 
> public class AnotherComponent implements ... {
> 
>   private MyComponent myComponent:
>   private ServiceManager serviceManager;
> 
>   public void recycle() {
> 
>      this.serviceManager.release(this.myComponent);
>   }
> 
>   public void serice(ServiceManager manager) throws ServiceException {
> 
>      this.serviceManager = manager;
>   }
> 
>   public void initialize() throws Exception {
> 
>      this.myComponet = (MyComponent)this.manager.lookup(MyComponent.ROLE);
>   }
> }
> 
> The "AnotherComponent" is pooled. What I want to do is to get an new 
> "MyComponent" from the serviceManager like in initialize() but 
> initialize() is only called once at instanciation time. So how can I get 
> a new component "MyComponent" from the serviceManager? Is there another 
> method avaiable which will be called between the pool and the lookup of 
> the serviceManager so I can get "MyComponent" there?
> 
> Thank you very much!
> 
> Regards
> Stephan


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message