提交 e3cdabfa 编写于 作者: J Juergen Hoeller

fixed MBeanExporter regression: do not try to expose abstract beans (SPR-6784)

上级 abdc35c8
/*
* Copyright 2002-2005 the original author or authors.
*
* Copyright 2002-2010 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
......@@ -17,8 +17,9 @@
package org.springframework.beans.factory;
/**
* Exception thrown when a bean instance has been requested for a bean
* which has been defined as abstract
* Exception thrown when a bean instance has been requested for
* a bean definition which has been marked as abstract.
*
* @author Juergen Hoeller
* @since 1.1
* @see org.springframework.beans.factory.support.AbstractBeanDefinition#setAbstract
......
/*
* Copyright 2002-2009 the original author or authors.
* Copyright 2002-2010 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -44,6 +44,7 @@ import org.springframework.aop.target.LazyInitTargetSource;
import org.springframework.beans.factory.BeanClassLoaderAware;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
import org.springframework.beans.factory.BeanIsAbstractException;
import org.springframework.beans.factory.CannotLoadBeanClassException;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
......@@ -899,6 +900,9 @@ public class MBeanExporter extends MBeanRegistrationSupport
}
// otherwise ignore beans where the class is not resolvable
}
catch (BeanIsAbstractException ex) {
// ignore - can't expose an abstract bean
}
}
}
}
......
......@@ -23,4 +23,6 @@
</property>
</bean>
<bean id="toBeIgnored" class="javax.management.DynamicMBean" abstract="true"/>
</beans>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册