Author: dain Date: Sat Oct 30 10:44:02 2004 New Revision: 56050 Modified: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/jmx/GBeanMBean.java Log: Raw invoker and gbean data should be hidden
Modified: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/jmx/GBeanMBean.java ============================================================================== --- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/jmx/GBeanMBean.java (original) +++ geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/jmx/GBeanMBean.java Sat Oct 30 10:44:02 2004 @@ -663,21 +663,20 @@ * @throws AttributeNotFoundException if the attribute name is not found in the map */ public Object getAttribute(String attributeName) throws ReflectionException, AttributeNotFoundException { - GBeanMBeanAttribute attribute = getAttributeByName(attributeName); - if (attribute != null) { - return attribute.getValue(); - } + try { + return getAttributeByName(attributeName).getValue(); + } catch (AttributeNotFoundException e) { + if (attributeName.equals(RAW_INVOKER)) { + return rawInvoker; + } - if (attributeName.equals(RAW_INVOKER)) { - return rawInvoker; - } + if (attributeName.equals(GBEAN_DATA)) { + return getGBeanData(); - if (attributeName.equals(GBEAN_DATA)) { - return getGBeanData(); + } + throw e; } - - throw new AttributeNotFoundException(attributeName); } /** @@ -936,28 +935,6 @@ this, "kernel", Kernel.class, - null)); - - attributesMap.put(RAW_INVOKER, - new GBeanMBeanAttribute(this, - RAW_INVOKER, - RawInvoker.class, - new MethodInvoker() { - public Object invoke(Object target, Object[] arguments) { - return rawInvoker; - } - }, - null)); - - attributesMap.put(GBEAN_DATA, - new GBeanMBeanAttribute(this, - GBEAN_DATA, - GBeanData.class, - new MethodInvoker() { - public Object invoke(Object target, Object[] arguments) { - return getGBeanData(); - } - }, null)); //