Polishing
This commit is contained in:
@@ -1794,10 +1794,11 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
|
||||
}
|
||||
|
||||
/**
|
||||
* Give a bean a chance to react now all its properties are set,
|
||||
* Give a bean a chance to initialize itself after all its properties are set,
|
||||
* and a chance to know about its owning bean factory (this object).
|
||||
* This means checking whether the bean implements InitializingBean or defines
|
||||
* a custom init method, and invoking the necessary callback(s) if it does.
|
||||
* <p>This means checking whether the bean implements {@link InitializingBean}
|
||||
* or defines any custom init methods, and invoking the necessary callback(s)
|
||||
* if it does.
|
||||
* @param beanName the bean name in the factory (for debugging purposes)
|
||||
* @param bean the new bean instance we may need to initialize
|
||||
* @param mbd the merged bean definition that the bean was created with
|
||||
@@ -1860,7 +1861,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
|
||||
}
|
||||
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("Invoking init method '" + initMethodName + "' on bean with name '" + beanName + "'");
|
||||
logger.trace("Invoking init method '" + initMethodName + "' on bean with name '" + beanName + "'");
|
||||
}
|
||||
Method methodToInvoke = ClassUtils.getInterfaceMethodIfPossible(initMethod, bean.getClass());
|
||||
|
||||
|
||||
@@ -252,15 +252,15 @@ class DisposableBeanAdapter implements DisposableBean, Runnable, Serializable {
|
||||
|
||||
|
||||
@Nullable
|
||||
private Method determineDestroyMethod(String name) {
|
||||
private Method determineDestroyMethod(String destroyMethodName) {
|
||||
try {
|
||||
Class<?> beanClass = this.bean.getClass();
|
||||
Method destroyMethod = findDestroyMethod(beanClass, name);
|
||||
Method destroyMethod = findDestroyMethod(beanClass, destroyMethodName);
|
||||
if (destroyMethod != null) {
|
||||
return destroyMethod;
|
||||
}
|
||||
for (Class<?> beanInterface : beanClass.getInterfaces()) {
|
||||
destroyMethod = findDestroyMethod(beanInterface, name);
|
||||
destroyMethod = findDestroyMethod(beanInterface, destroyMethodName);
|
||||
if (destroyMethod != null) {
|
||||
return destroyMethod;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user