!(isInitializingBean && "afterPropertiesSet".equals(initMethodName)) && !mbd.isExternallyManagedInitMethod(initMethodName)) { invokeCustomInitMethod(beanName, bean, mbd);
!(isInitializingBean && "afterPropertiesSet".equals(initMethodName)) && !mbd.isExternallyManagedInitMethod(initMethodName)) { invokeCustomInitMethod(beanName, bean, mbd);
if (initMethodName != null && !(isInitializingBean && "afterPropertiesSet".equals(initMethodName)) && !mbd.isExternallyManagedInitMethod(initMethodName)) { invokeCustomInitMethod(beanName, bean, mbd);
if (initMethodName != null && !(isInitializingBean && "afterPropertiesSet".equals(initMethodName)) && !mbd.isExternallyManagedInitMethod(initMethodName)) { invokeCustomInitMethod(beanName, bean, mbd);
/** * Give a bean a chance to react now 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>To be called by createBean implementations of concrete subclasses. * @param beanName the bean has in the factory. Used for debug output. * @param bean new bean instance we may need to initialize * @param mergedBeanDefinition the bean definition that the bean was created with * (can also be <code>null</code>, if initializing ) * @throws Throwable if thrown by init methods or by the invocation process * @see #invokeCustomInitMethod * @see #createBean */ protected void invokeInitMethods(String beanName, Object bean, RootBeanDefinition mergedBeanDefinition) throws Throwable { if (bean instanceof InitializingBean) { if (logger.isDebugEnabled()) { logger.debug("Invoking afterPropertiesSet() on bean with name '" + beanName + "'"); } ((InitializingBean) bean).afterPropertiesSet(); } if (mergedBeanDefinition != null && mergedBeanDefinition.getInitMethodName() != null) { invokeCustomInitMethod(beanName, bean, mergedBeanDefinition.getInitMethodName()); } }