commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 11885] New: - After setting an Attribute the Notification Listener will not performed
Date Wed, 21 Aug 2002 07:50:23 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11885>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11885

After setting an Attribute the Notification Listener will not performed

           Summary: After setting an Attribute the Notification Listener
                    will not performed
           Product: Commons
           Version: 1.0 Final
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Modeler
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: Daniel.Schmidt@gp.materna.de


Description:
-----------------
After setting an Attribute the Notification Listener 
(AttributeChangeNotification) will not performed.

Cause:
----------
In the setAttribute 
Method in the Class  BaseModelMBean the  Call  sendAttributeChangeNotification is 
missing.

Solution:
-------------
The following Code in the setAttribute Method (BaseModelMBean) 
fix the problem (see   //*********  NEW **********):

 public void setAttribute(Attribute 
attribute)
        throws AttributeNotFoundException, MBeanException,
        ReflectionException {  

...

  String setMethod = (String) attrDesc.getFieldValue("setMethod");
        if 
(setMethod == null)
            throw new AttributeNotFoundException
                ("Cannot find attribute " + name 
+ " set method name");

         //*********  NEW **********
        Object currValue = 
this.getAttribute(name);
	Attribute oldAttr = new Attribute(name, currValue);
        
        // 
Invoke the specified set method and ignore any results
        invoke(setMethod,
               new Object[] { 
value },
               new String[] { attrInfo.getType() });
               
        //***** NEW ********
        
sendAttributeChangeNotification(oldAttr,attribute);

    }

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message