You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Ruben de Gooijer <r....@onehippo.com> on 2009/05/05 23:18:39 UTC

Valve

Hi all,

Can someone explain to me why the Valve interface has an initialize method
but no destroy method?

Thanks!

Kind regards,
Ruben

Re: Valve

Posted by Mansour Al Akeel <ma...@gmail.com>.
Ruben:

There might be many reasons, but this is not related to jetspeed. This
would be more java programming and OO design.  

If an object can be created but it's expensive to initialize "for
exmaple" then it could have an init method to delay the initialization.
Another way to deal with this, the Builder Pattern. 

In java, objects are destroyed by the garbage collector then there is no more refrence
(variable) pointing to them in the current scope. So not necessary to
have a destroy method if we have an init method.

Again, we don't discuss OO here. 


On Tue May 05,2009 02:18 pm, Ruben de Gooijer wrote:
> Hi all,
> 
> Can someone explain to me why the Valve interface has an initialize method
> but no destroy method?
> 
> Thanks!
> 
> Kind regards,
> Ruben

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: Valve

Posted by Ruben de Gooijer <r....@onehippo.com>.
Mansour and Woosan both thank you both for you responses.

Woosan, this was exactly the answer I was hoping for, thanks!

Kind regards,
Ruben

On Thu, May 7, 2009 at 1:53 AM, Woonsan Ko <wo...@yahoo.com> wrote:

>
> Hi Ruben,
>
> I don't know why exactly.
> My guess is that we can use spring configuration to invoke initialize() and
> destroy() of the valve bean for the purpose, so it hasn't be regarded as
> necessary.
> Currently a valve's life cycle is managed by spring bean factory, not by
> pipeline.
> If we add destroy() method in Valve interface, then we need to make
> Pipeline invoke the lifecycle methods of Valve. It is meaningful in a sense,
> but I cannot find any pragmatic benefit now.
>
> Regards.
>
> Woonsan
>
> --- On Tue, 5/5/09, Ruben de Gooijer <r....@onehippo.com> wrote:
>
> > From: Ruben de Gooijer <r....@onehippo.com>
> > Subject: Valve
> > To: jetspeed-user@portals.apache.org
> > Date: Tuesday, May 5, 2009, 11:18 PM
> > Hi all,
> >
> > Can someone explain to me why the Valve interface has an
> > initialize method
> > but no destroy method?
> >
> > Thanks!
> >
> > Kind regards,
> > Ruben
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>

Re: Valve

Posted by Woonsan Ko <wo...@yahoo.com>.
Hi Ruben,

I don't know why exactly.
My guess is that we can use spring configuration to invoke initialize() and destroy() of the valve bean for the purpose, so it hasn't be regarded as necessary.
Currently a valve's life cycle is managed by spring bean factory, not by pipeline.
If we add destroy() method in Valve interface, then we need to make Pipeline invoke the lifecycle methods of Valve. It is meaningful in a sense, but I cannot find any pragmatic benefit now.

Regards.

Woonsan

--- On Tue, 5/5/09, Ruben de Gooijer <r....@onehippo.com> wrote:

> From: Ruben de Gooijer <r....@onehippo.com>
> Subject: Valve
> To: jetspeed-user@portals.apache.org
> Date: Tuesday, May 5, 2009, 11:18 PM
> Hi all,
> 
> Can someone explain to me why the Valve interface has an
> initialize method
> but no destroy method?
> 
> Thanks!
> 
> Kind regards,
> Ruben


      

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org