Return-Path:
Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org
Received: (qmail 68400 invoked from network); 2 Sep 2004 00:15:15 -0000
Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199)
by minotaur-2.apache.org with SMTP; 2 Sep 2004 00:15:15 -0000
Received: (qmail 51783 invoked by uid 500); 2 Sep 2004 00:15:10 -0000
Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org
Received: (qmail 51751 invoked by uid 500); 2 Sep 2004 00:15:10 -0000
Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm
Precedence: bulk
List-Unsubscribe:
List-Subscribe:
List-Help:
List-Post:
List-Id: "Jakarta Commons Developers List"
Reply-To: "Jakarta Commons Developers List"
Delivered-To: mailing list commons-dev@jakarta.apache.org
Received: (qmail 51738 invoked by uid 500); 2 Sep 2004 00:15:09 -0000
Received: (qmail 51734 invoked by uid 99); 2 Sep 2004 00:15:09 -0000
X-ASF-Spam-Status: No, hits=-2.8 required=10.0
tests=ALL_TRUSTED,NO_REAL_NAME
X-Spam-Check-By: apache.org
Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194)
by apache.org (qpsmtpd/0.28) with SMTP; Wed, 01 Sep 2004 17:15:09 -0700
Received: (qmail 68254 invoked by uid 1431); 2 Sep 2004 00:15:08 -0000
Date: 2 Sep 2004 00:15:08 -0000
Message-ID: <20040902001508.68253.qmail@minotaur.apache.org>
From: dion@apache.org
To: jakarta-commons-cvs@apache.org
Subject: cvs commit:
jakarta-commons/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing
ComponentTag.java
X-Virus-Checked: Checked
X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N
dion 2004/09/01 17:15:08
Modified: jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing
ComponentTag.java
Log:
Jelly-122
Revision Changes Path
1.18 +25 -0 jakarta-commons/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/ComponentTag.java
Index: ComponentTag.java
===================================================================
RCS file: /home/cvs/jakarta-commons/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/ComponentTag.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- ComponentTag.java 25 Feb 2004 01:31:56 -0000 1.17
+++ ComponentTag.java 2 Sep 2004 00:15:07 -0000 1.18
@@ -49,6 +49,12 @@
* This tag creates a Swing component and adds it to its parent tag, optionally declaring this
* component as a variable if the var attribute is specified.
*
+ * This tag clears the reference to it's bean after doTag runs.
+ * This means that child tags can access the component (bean) normally
+ * during execution but should not hold a reference to this
+ * tag after their doTag completes.
+ *
+ *
* @author James Strachan
* @version $Revision$
*/
@@ -405,5 +411,24 @@
protected Object getConstraint() {
return null;
+ }
+
+ /**Overrides the default UseBean functionality to clear the bean after the
+ * tag runs. This prevents us from keeping references to heavy Swing objects
+ * around for longer than they are needed.
+ * @see org.apache.commons.jelly.Tag#doTag(org.apache.commons.jelly.XMLOutput)
+ */
+ public void doTag(XMLOutput output) throws JellyTagException {
+ super.doTag(output);
+ clearBean();
+ }
+
+ /** Sets the bean to null, to prevent it from
+ * sticking around in the event that this tag instance is
+ * cached. This method is called at the end of doTag.
+ *
+ */
+ protected void clearBean() {
+ setBean(null);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org