Return-Path: Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: (qmail 36074 invoked from network); 8 May 2006 17:23:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 8 May 2006 17:23:41 -0000 Received: (qmail 86190 invoked by uid 500); 8 May 2006 17:23:25 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 85612 invoked by uid 500); 8 May 2006 17:23:23 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 85601 invoked by uid 500); 8 May 2006 17:23:23 -0000 Delivered-To: apmail-jakarta-tomcat-dev@jakarta.apache.org Received: (qmail 85597 invoked by uid 99); 8 May 2006 17:23:23 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 May 2006 10:23:23 -0700 X-ASF-Spam-Status: No, hits=-9.4 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.29) with SMTP; Mon, 08 May 2006 10:23:22 -0700 Received: (qmail 35788 invoked by uid 65534); 8 May 2006 17:22:59 -0000 Message-ID: <20060508172259.35787.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r405097 - /tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/session/StandardSession.java Date: Mon, 08 May 2006 17:22:58 -0000 To: tomcat-dev@jakarta.apache.org From: fhanik@apache.org X-Mailer: svnmailer-1.0.8 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: fhanik Date: Mon May 8 10:22:55 2006 New Revision: 405097 URL: http://svn.apache.org/viewcvs?rev=405097&view=rev Log: Make the StandardSession extensible by allowing control whether the listeners should be notified by a setAttribute command. Modified: tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/session/StandardSession.java Modified: tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/session/StandardSession.java URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/session/StandardSession.java?rev=405097&r1=405096&r2=405097&view=diff ============================================================================== --- tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/session/StandardSession.java (original) +++ tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/session/StandardSession.java Mon May 8 10:22:55 2006 @@ -1230,6 +1230,10 @@ * invalidated session */ public void setAttribute(String name, Object value) { + setAttribute(name,value,true); + } + + public void setAttribute(String name, Object value, boolean notify) { // Name cannot be null if (name == null) @@ -1255,7 +1259,7 @@ HttpSessionBindingEvent event = null; // Call the valueBound() method if necessary - if (value instanceof HttpSessionBindingListener) { + if (value instanceof HttpSessionBindingListener && notify) { // Don't call any notification if replacing with the same value Object oldValue = attributes.get(name); if (value != oldValue) { @@ -1274,7 +1278,7 @@ // Call the valueUnbound() method if necessary if ((unbound != null) && (unbound != value) && - (unbound instanceof HttpSessionBindingListener)) { + (unbound instanceof HttpSessionBindingListener) && notify) { try { ((HttpSessionBindingListener) unbound).valueUnbound (new HttpSessionBindingEvent(getSession(), name)); @@ -1283,6 +1287,8 @@ (sm.getString("standardSession.bindingEvent"), t); } } + + if ( !notify ) return; // Notify interested application event listeners Context context = (Context) manager.getContainer(); --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org