struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maurizio Cucchiara <mcucchi...@apache.org>
Subject Re: Destroy an Action in Struts2?
Date Mon, 01 Aug 2011 07:39:46 GMT
Doing what you are looking for through an interceptor is quite
trivial: you should simply check  (after the invocation.invoke() call)
if an action implements Destroyable IF and then call the destroy
method.
Anyway, I think that the garbage collector in this specific case is
able to do a good work, why don't you trust it?

On 1 August 2011 08:44, JOSE L MARTINEZ-AVIAL <jlmagc@gmail.com> wrote:
> Hi,
>   Is there a way to destroy correctly an Action? I know that a instance of
> an Action is created every time it is needed, and it is alive during the
> processing of the request until the response is sent back to the user. What
> I don't know is if the instance is 'destroyed' in some way, or Struts just
> sets to null the references to it, and that's it. I'm used to implement a
> Destroyable interface in all my classes, which I use to clear any Map, List,
> etc, and set to null any field in the object, in order to avoid memory
> leaks. I would like to do the same with the action. I know I could implement
> an Interceptor to do that, but I don't know if this is already covered in
> Struts. Any thoughts?
>
> TIA
>
> Jose Luis
>



-- 
Maurizio Cucchiara

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


Mime
View raw message