public Method getSetter(String aname, BaseModelMBean bean, Object resource) 
            throws AttributeNotFoundException, MBeanException, ReflectionException {
        // Cache may be needed for getters, but it is a really bad idea for setters, this is far 
        // less frequent.
        Method m=null;//(Method)setAttMap.get( name );

        if( m==null ) {
            AttributeInfo attrInfo = (AttributeInfo)attributes.get(aname);
            if (attrInfo == null)
                throw new AttributeNotFoundException(" Cannot find attribute " + aname);

            // Look up the actual operation to be used
            String setMethod = attrInfo.getSetMethod();
            if (setMethod == null)
                throw new AttributeNotFoundException("Cannot find attribute " + aname + " set method name");

            String argType=attrInfo.getType();

            Class signature[] = new Class[] { BaseModelMBean.getAttributeClass( argType ) };

            Object object = null;
            NoSuchMethodException exception = null;
            try {
                object = bean;
                m = object.getClass().getMethod(setMethod, signature);
            } catch (NoSuchMethodException e) {
                exception = e;;
            }
            if( m== null && resource != null ) {
                try {
                    object = resource;
                    m = object.getClass().getMethod(setMethod, signature);
                    exception=null;
                } catch (NoSuchMethodException e) {
                    exception = e;
                }
            }
            if( exception != null )
                throw new ReflectionException(exception,
                                              "Cannot find setter method " + setMethod +
                        " " + resource);
            //setAttMap.put( name, m );
        }

        return m;
    }