Return-Path: X-Original-To: apmail-struts-user-archive@www.apache.org Delivered-To: apmail-struts-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 70B60750F for ; Mon, 1 Aug 2011 07:40:27 +0000 (UTC) Received: (qmail 64926 invoked by uid 500); 1 Aug 2011 07:40:23 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 64686 invoked by uid 500); 1 Aug 2011 07:40:19 -0000 Mailing-List: contact user-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list user@struts.apache.org Received: (qmail 64668 invoked by uid 99); 1 Aug 2011 07:40:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Aug 2011 07:40:15 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of maurizio.cucchiara@gmail.com designates 209.85.213.176 as permitted sender) Received: from [209.85.213.176] (HELO mail-yx0-f176.google.com) (209.85.213.176) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Aug 2011 07:40:08 +0000 Received: by yxl11 with SMTP id 11so4347075yxl.35 for ; Mon, 01 Aug 2011 00:39:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=YkuAg0jmY4FWVHBnJ5nOXlDman/YG+Y35Zff8TsYjus=; b=snGdThnENDYj5glUj1/4fZhglmS5rFyNl0na2rYBzAAuqIkpkZIzOjh+Q1DmV/BFYO hPC9/GK7mduyxbrpP+YNfzTh7vyWPFegsYumIpNWEslqBAZ+DJiB3SS2BWnIcFLUwENg cmifvMF/nHjw12pvwO4+2YY3InJWVFYVdC/jQ= MIME-Version: 1.0 Received: by 10.142.192.15 with SMTP id p15mr1003706wff.224.1312184386411; Mon, 01 Aug 2011 00:39:46 -0700 (PDT) Sender: maurizio.cucchiara@gmail.com Received: by 10.142.172.11 with HTTP; Mon, 1 Aug 2011 00:39:46 -0700 (PDT) In-Reply-To: References: Date: Mon, 1 Aug 2011 09:39:46 +0200 X-Google-Sender-Auth: D5Wp6eT10Hn5uaOTsgD2CQ1J5so Message-ID: Subject: Re: Destroy an Action in Struts2? From: Maurizio Cucchiara To: Struts Users Mailing List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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 wrote: > Hi, > =A0 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. Wh= at > I don't know is if the instance is 'destroyed' in some way, or Struts jus= t > 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, Li= st, > 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 implem= ent > an Interceptor to do that, but I don't know if this is already covered in > Struts. Any thoughts? > > TIA > > Jose Luis > --=20 Maurizio Cucchiara --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org