File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
spring-beans/src/main/java/org/springframework/beans/factory Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2019 the original author or authors.
2
+ * Copyright 2002-2020 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.
39
39
*
40
40
* <p><b>{@code FactoryBean} is a programmatic contract. Implementations are not
41
41
* supposed to rely on annotation-driven injection or other reflective facilities.</b>
42
- * {@link #getObjectType()} {@link #getObject()} invocations may arrive early in
43
- * the bootstrap process, even ahead of any post-processor setup. If you need access
42
+ * {@link #getObjectType()} {@link #getObject()} invocations may arrive early in the
43
+ * bootstrap process, even ahead of any post-processor setup. If you need access to
44
44
* other beans, implement {@link BeanFactoryAware} and obtain them programmatically.
45
45
*
46
+ * <p><b>The container is only responsible for managing the lifecycle of the FactoryBean
47
+ * instance, not the lifecycle of the objects created by the FactoryBean.</b> Therefore,
48
+ * a destroy method on an exposed bean object (such as {@link java.io.Closeable#close()}
49
+ * will <i>not</i> be called automatically. Instead, a FactoryBean should implement
50
+ * {@link DisposableBean} and delegate any such close call to the underlying object.
51
+ *
46
52
* <p>Finally, FactoryBean objects participate in the containing BeanFactory's
47
53
* synchronization of bean creation. There is usually no need for internal
48
54
* synchronization other than for purposes of lazy initialization within the
You can’t perform that action at this time.
0 commit comments