|
1 | 1 | /*
|
2 |
| - * Copyright 2002-2012 the original author or authors. |
| 2 | + * Copyright 2002-2018 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
|
17 | 17 | package org.springframework.beans.factory;
|
18 | 18 |
|
19 | 19 | /**
|
20 |
| - * Interface to be implemented by beans that need to react once all their |
21 |
| - * properties have been set by a BeanFactory: for example, to perform custom |
22 |
| - * initialization, or merely to check that all mandatory properties have been set. |
| 20 | + * Interface to be implemented by beans that need to react once all their properties |
| 21 | + * have been set by a {@link BeanFactory}: e.g. to perform custom initialization, |
| 22 | + * or merely to check that all mandatory properties have been set. |
23 | 23 | *
|
24 |
| - * <p>An alternative to implementing InitializingBean is specifying a custom |
25 |
| - * init-method, for example in an XML bean definition. |
26 |
| - * For a list of all bean lifecycle methods, see the BeanFactory javadocs. |
| 24 | + * <p>An alternative to implementing {@code InitializingBean} is specifying a custom |
| 25 | + * init method, for example in an XML bean definition. For a list of all bean |
| 26 | + * lifecycle methods, see the {@link BeanFactory BeanFactory javadocs}. |
27 | 27 | *
|
28 | 28 | * @author Rod Johnson
|
29 |
| - * @see BeanNameAware |
30 |
| - * @see BeanFactoryAware |
31 |
| - * @see BeanFactory |
32 |
| - * @see org.springframework.beans.factory.support.RootBeanDefinition#getInitMethodName |
33 |
| - * @see org.springframework.context.ApplicationContextAware |
| 29 | + * @author Juergen Hoeller |
| 30 | + * @see DisposableBean |
| 31 | + * @see org.springframework.beans.factory.config.BeanDefinition#getPropertyValues() |
| 32 | + * @see org.springframework.beans.factory.support.AbstractBeanDefinition#getInitMethodName() |
34 | 33 | */
|
35 | 34 | public interface InitializingBean {
|
36 | 35 |
|
37 | 36 | /**
|
38 |
| - * Invoked by a BeanFactory after it has set all bean properties supplied |
39 |
| - * (and satisfied BeanFactoryAware and ApplicationContextAware). |
40 |
| - * <p>This method allows the bean instance to perform initialization only |
41 |
| - * possible when all bean properties have been set and to throw an |
42 |
| - * exception in the event of misconfiguration. |
43 |
| - * @throws Exception in the event of misconfiguration (such |
44 |
| - * as failure to set an essential property) or if initialization fails. |
| 37 | + * Invoked by the containing {@code BeanFactory} after it has set all bean properties |
| 38 | + * and satisfied {@link BeanFactoryAware}, {@code ApplicationContextAware} etc. |
| 39 | + * <p>This method allows the bean instance to perform validation of its overall |
| 40 | + * configuration and final initialization when all bean properties have been set. |
| 41 | + * @throws Exception in the event of misconfiguration (such as failure to set an |
| 42 | + * essential property) or if initialization fails for any other reason |
45 | 43 | */
|
46 | 44 | void afterPropertiesSet() throws Exception;
|
47 | 45 |
|
|
0 commit comments