mx4j/src/core/mx4j/server MX4JMBeanServer.java,1.25,1.26
Jeremy Boynes <[email protected]> Wed, 09 Feb 2005 00:37:11 +0000
| Newsgroups | gmane.comp.java.mx4j.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/mx4j/mx4j/src/core/mx4j/server
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20030/src/core/mx4j/server
Modified Files:
MX4JMBeanServer.java
Log Message:
Fix for [ 1119006 ] Attempt to create an abstract MBean throws wrong exception
In order to avoid changing the interceptor stack, this fix simply inspects the ReflectionException thrown by instantiateImpl to determine if a NotCompliantMBeanException should be thrown.
Index: MX4JMBeanServer.java
===================================================================
RCS file: /cvsroot/mx4j/mx4j/src/core/mx4j/server/MX4JMBeanServer.java,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** MX4JMBeanServer.java 8 Feb 2005 07:12:22 -0000 1.25
--- MX4JMBeanServer.java 9 Feb 2005 00:37:09 -0000 1.26
***************
*** 693,697 ****
{
Class cls = getModifiableClassLoaderRepository().loadClass(className);
! MBeanMetaData metadata = instantiateImpl(className, cls.getClassLoader(), objectName, parameters, args);
registerImpl(metadata, false);
--- 693,717 ----
{
Class cls = getModifiableClassLoaderRepository().loadClass(className);
! MBeanMetaData metadata;
!
! // todo we should change the interceptor stack so that an InstantiationException
! // can be thrown directly and handled appropriately. However, I think
! // that should wait until a major release so am hacking this in here
! try
! {
! metadata = instantiateImpl(className, cls.getClassLoader(), objectName, parameters, args);
! }
! catch (ReflectionException e)
! {
! Exception target = e.getTargetException();
! if (target instanceof InstantiationException)
! {
! throw new NotCompliantMBeanException();
! }
! else
! {
! throw e;
! }
! }
registerImpl(metadata, false);
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click