3.5. Customizing the nature of a bean
Spring/Chapter 3 : 2007. 3. 10. 11:49
3.5.1. Lifecycle interfaces
Spring container에서 사용된는 bean의 lifecycle에 부가적인 일을 추가할 수 있습니다. InitializingBean 과 DisposableBean 같은 인터페이스를 구현 하면 됩니다. 하지만 그렇게 되면 코드가 Spring 프레임웤에 종속성이 생기기 때문에 다른 방법도 있습니다.
Bean's Life Cycle
InitializingBean & DisposableBean
init-method & destroy-method
3.5.2. Knowing who you are
BeanFactory를 가지는 bean을 만들 수 있습니다.
BeanFactoryAware 인터페이스를 구현하면 되지만 그렇게 되면 Spring 프레임웤에 종속이 되기 때문에 다른 방법도 있습니다.
BeanFactoryAware
Spring container에서 사용된는 bean의 lifecycle에 부가적인 일을 추가할 수 있습니다. InitializingBean 과 DisposableBean 같은 인터페이스를 구현 하면 됩니다. 하지만 그렇게 되면 코드가 Spring 프레임웤에 종속성이 생기기 때문에 다른 방법도 있습니다.
Bean's Life Cycle
InitializingBean & DisposableBean
init-method & destroy-method
3.5.2. Knowing who you are
BeanFactory를 가지는 bean을 만들 수 있습니다.
BeanFactoryAware 인터페이스를 구현하면 되지만 그렇게 되면 Spring 프레임웤에 종속이 되기 때문에 다른 방법도 있습니다.
BeanFactoryAware
'Spring > Chapter 3' 카테고리의 다른 글
BeanFactoryAware (0) | 2007.03.12 |
---|---|
init-method & destroy-method (0) | 2007.03.10 |
InitializingBean & DisposableBean (0) | 2007.03.10 |
Bean's Life Cycle (0) | 2007.03.10 |
The IoC container (0) | 2007.03.10 |
3.5. Customizing the nature of a bean (0) | 2007.03.10 |
Singleton & Prototype (0) | 2007.03.09 |
3.4. Bean scopes (0) | 2007.03.09 |
Autowiring (0) | 2007.03.09 |
Collection Merging (0) | 2007.03.09 |
Collections - <list /> (0) | 2007.03.08 |