You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Henri Yandell (JIRA)" <ji...@apache.org> on 2006/07/12 07:12:34 UTC

[jira] Updated: (MODELER-14) After setting an Attribute the Notification Listener will not performed

     [ http://issues.apache.org/jira/browse/MODELER-14?page=all ]

Henri Yandell updated MODELER-14:
---------------------------------

    Bugzilla Id:   (was: 11885)
    Fix Version: 1.1

> After setting an Attribute the Notification Listener will not performed
> -----------------------------------------------------------------------
>
>          Key: MODELER-14
>          URL: http://issues.apache.org/jira/browse/MODELER-14
>      Project: Commons Modeler
>         Type: Bug

>     Versions: 1.0
>  Environment: Operating System: other
> Platform: Other
>     Reporter: Daniel Schmidt
>      Fix For: 1.1

>
> 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);
>     }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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