|
1 | 1 | /*
|
2 |
| - * Copyright 2002-2016 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.
|
|
37 | 37 | *
|
38 | 38 | * <p><b>{@code FactoryBean} is a programmatic contract. Implementations are not
|
39 | 39 | * supposed to rely on annotation-driven injection or other reflective facilities.</b>
|
40 |
| - * {@link #getObjectType()} {@link #getObject()} invocations may arrive early in |
41 |
| - * the bootstrap process, even ahead of any post-processor setup. If you need access |
| 40 | + * {@link #getObjectType()} {@link #getObject()} invocations may arrive early in the |
| 41 | + * bootstrap process, even ahead of any post-processor setup. If you need access to |
42 | 42 | * other beans, implement {@link BeanFactoryAware} and obtain them programmatically.
|
43 | 43 | *
|
| 44 | + * <p><b>The container is only responsible for managing the lifecycle of the FactoryBean |
| 45 | + * instance, not the lifecycle of the objects created by the FactoryBean.</b> Therefore, |
| 46 | + * a destroy method on an exposed bean object (such as {@link java.io.Closeable#close()} |
| 47 | + * will <i>not</i> be called automatically. Instead, a FactoryBean should implement |
| 48 | + * {@link DisposableBean} and delegate any such close call to the underlying object. |
| 49 | + * |
44 | 50 | * <p>Finally, FactoryBean objects participate in the containing BeanFactory's
|
45 | 51 | * synchronization of bean creation. There is usually no need for internal
|
46 | 52 | * synchronization other than for purposes of lazy initialization within the
|
|
49 | 55 | * @author Rod Johnson
|
50 | 56 | * @author Juergen Hoeller
|
51 | 57 | * @since 08.03.2003
|
| 58 | + * @param <T> the bean type |
52 | 59 | * @see org.springframework.beans.factory.BeanFactory
|
53 | 60 | * @see org.springframework.aop.framework.ProxyFactoryBean
|
54 | 61 | * @see org.springframework.jndi.JndiObjectFactoryBean
|
|
0 commit comments