[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: JBREFLECT-50, determining need for setAccessible bug
scott.stark@jboss.org
do-not-reply at jboss.com
Tue Feb 17 13:36:16 EST 2009
A problem with the workaround of obtaining the BeanInfo using the interface the bean implements is that the IntrospectionTypeInfoFactoryImpl.getSuperClass does not return the superinterface for an interface. Obtaining a BeanInfo for an interface like java.lang.management.GarbageCollectorMXBean which extends java.lang.management.MemoryManagerMXBean fails to include the MemoryManagerMXBean properties:
| public void testGarbageCollectorMXBeanIface()
| throws Throwable
| {
| BeanInfo info = super.getBeanInfo(GarbageCollectorMXBean.class, BeanAccessMode.ALL);
| PropertyInfo name = info.getProperty("name");
| assertNotNull(name);
| }
|
| ...
|
| java.lang.IllegalArgumentException: No such property name for bean java.lang.management.GarbageCollectorMXBean available [collectionCount, collectionTime]
| at org.jboss.beans.info.plugins.AbstractBeanInfo.getProperty(AbstractBeanInfo.java:147)
| at org.jboss.test.beaninfo.test.PlatformMXBeanTestCase.testGarbageCollectorMXBeanIface(PlatformMXBeanTestCase.java:47)
|
name is a property in the MemoryManagerMXBean interface.
Is this expected or a limitation of the current BeanInfo reflection implementation?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4210804#4210804
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4210804
More information about the jboss-dev-forums
mailing list