You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bi...@apache.org on 2006/03/05 03:22:43 UTC
svn commit: r383269 -
/jakarta/commons/proper/modeler/trunk/src/java/org/apache/commons/modeler/BaseModelMBean.java
Author: billbarker
Date: Sat Mar 4 18:22:41 2006
New Revision: 383269
URL: http://svn.apache.org/viewcvs?rev=383269&view=rev
Log:
Send notification *after* an attribute has been set instead of before.
Fix for Bug #32362
Based on a Patch by: Philippe Mouawad
Modified:
jakarta/commons/proper/modeler/trunk/src/java/org/apache/commons/modeler/BaseModelMBean.java
Modified: jakarta/commons/proper/modeler/trunk/src/java/org/apache/commons/modeler/BaseModelMBean.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/modeler/trunk/src/java/org/apache/commons/modeler/BaseModelMBean.java?rev=383269&r1=383268&r2=383269&view=diff
==============================================================================
--- jakarta/commons/proper/modeler/trunk/src/java/org/apache/commons/modeler/BaseModelMBean.java (original)
+++ jakarta/commons/proper/modeler/trunk/src/java/org/apache/commons/modeler/BaseModelMBean.java Sat Mar 4 18:22:41 2006
@@ -569,16 +569,10 @@
if (attrDesc == null)
throw new AttributeNotFoundException("Cannot find attribute " + name + " descriptor");
- try {
- // XXX Is it before or after ?
- Object oldValue=null;
- if( getAttMap.get(name) != null )
- oldValue=getAttribute( name );
- sendAttributeChangeNotification(new Attribute( name, oldValue),
- attribute);
- } catch( Exception ex ) {
- log.error( "Error sending notification " + name, ex );
- }
+ Object oldValue=null;
+ if( getAttMap.get(name) != null )
+ oldValue=getAttribute( name );
+
// Extract the method from cache
Method m=(Method)setAttMap.get( name );
@@ -644,7 +638,12 @@
throw new MBeanException
(e, "Exception invoking method " + name);
}
-
+ try {
+ sendAttributeChangeNotification(new Attribute( name, oldValue),
+ attribute);
+ } catch(Exception ex) {
+ log.error("Error sending notification " + name, ex);
+ }
attributes.put( name, value );
if( source != null ) {
// this mbean is asscoiated with a source - maybe we want to persist
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org