public Object getAttribute(final String attribute) throws AttributeNotFoundException, MBeanException, ReflectionException
    {
        Object value = null;

        try
        {
            boolean foundAttribute = false;

            for (final MBeanAttributeInfo mbeanAttr : attributes)
            {
                if (mbeanAttr.getName().equals(attribute))
                {
                    foundAttribute = true;

                    if (mbeanAttr.isReadable())
                    {
                        for (final Map.Entry<String, AttributeWithMethods> entry : attributeMethodMap.entrySet())
                        {
                            final String entryName = entry.getKey();
                            final AttributeWithMethods attributeWithMethods = entry.getValue();

                            if (entryName.equals(attribute))
                            {
                                final Method method = attributeWithMethods.getGetOrIsMethod();
                                final boolean isAccessible = method.isAccessible();
                                if (!isAccessible)
                                {
                                    method.setAccessible(true);
                                }

                                value = method.invoke(objInstance, null);

                                method.setAccessible(isAccessible);

                                return value;
                            }
                        }

                        //TODO maybe remove the extra reflection here
                        final Field field = objClass.getDeclaredField(attribute);

                        final boolean isAccessible = field.isAccessible();
                        if (!isAccessible)
                        {
                            field.setAccessible(true);
                        }

                        value = field.get(objInstance);

                        field.setAccessible(isAccessible);
                    }
                    else
                    {
                        throw new Exception("Attribute not readable: " + attribute);
                    }
                }
            }

            if (!foundAttribute)
            {
                throw new AttributeNotFoundException();
            }
        }
        catch (Exception e)
        {
            throw new MBeanException(e);
        }

        return value;
    }