Method getGetter(String aname, BaseModelMBean mbean, Object resource) 
            throws AttributeNotFoundException, MBeanException, ReflectionException {
        // TODO: do we need caching ? JMX is for management, it's not supposed to require lots of performance.
        Method m=null; // (Method)getAttMap.get( name );

        if( m==null ) {
            AttributeInfo attrInfo = (AttributeInfo)attributes.get(aname);
            // Look up the actual operation to be used
            if (attrInfo == null)
                throw new AttributeNotFoundException(" Cannot find attribute " + aname + " for " + resource);
            
            String getMethod = attrInfo.getGetMethod();
            if (getMethod == null)
                throw new AttributeNotFoundException("Cannot find attribute " + aname + " get method name");

            Object object = null;
            NoSuchMethodException exception = null;
            try {
                object = mbean;
                m = object.getClass().getMethod(getMethod, NO_ARGS_PARAM_SIG);
            } catch (NoSuchMethodException e) {
                exception = e;;
            }
            if( m== null && resource != null ) {
                try {
                    object = resource;
                    m = object.getClass().getMethod(getMethod, NO_ARGS_PARAM_SIG);
                    exception=null;
                } catch (NoSuchMethodException e) {
                    exception = e;
                }
            }
            if( exception != null )
                throw new ReflectionException(exception,
                                              "Cannot find getter method " + getMethod);
            //getAttMap.put( name, m );
        }

        return m;
    }