Bean Life Cycle 콜백 인터페이스 사용 예(in Spring)

BeanNameAware
– ServletForwardingController
– AbstractView
– PortletWrappingController
– GenericFilterBean
– JobDetailBean
– OsgiServiceProxyFactoryBean
– AbstractTest
– EhCacheFactoryBean
– FieldRetrievingFactoryBean

BeanClassLoaderAware
– 구현 방법 : this.beanClassLoader = (beanClassLoader != null ? beanClassLoader : ClassUtils.getDefaultClassLoader());
– AbstractBeanFactory
– AbstractBeanDefinitionReader ::
– ConfigurableBeanFactory 인터페이스 ::
– AbstractHttpInvokerRequestExecutor
– HttpInvokerTests

BeanFactoryAware
– MethodLocatingFactoryBean
– ProxyFactoryBean
= AbstractAdvisorAutoProxyCreator
– AbstractBeanFactoryBasedTargetSourceCreator
– ScopedProxyFactoryBean
– AbstractBeanFactoryBasedTargetSource
– AutowiredAnnotationBeanPostProcessor
– ObjectFactoryCreatingFactoryBean
– ServiceLocatorFactoryBean
– DependencyInjectionAspectSupport
– 엄청난 분량

BeanPostProcessor :: before :: after
– BundleContextAwareProcessor :: 해당 bean이 bundleaware 일 때 BundleContext 세팅, 로깅, 없으면 예외처리 :: ::
– CommonsLogProviderBeanPostProcessor :: 리플렉션 사용해서 로깅 :: ::
– ServletContextAwareProcessor :: ServletContext랑 SevletConfig 세팅 :: ::
– PortletContextAwareProcessor
– AbstractAutoProxyCreator ::  :: 프록시 만들 때 사용

InitializingBean
– MustBeInitialized
– ServiceCreationFactoryBean
– CommonsLogFactoryBean :: 로깅
– FieldRetrievingFactoryBean :: 없으면 확인하고
– MethodInvokingFactoryBean ::
public void afterPropertiesSet() throws Exception {
        prepare();
        if (this.singleton) {
            this.initialized = true;
            this.singletonObject = doInvoke();
        }
    }
– PropertiesFactoryBean :: 싱글톤인지..
– ResourceFactoryBean :: resource 가 널이면 예외 발생
– 그 외에도 많아요.

ResourceLoaderAware
– ReloadableResourceBundleMessageSource :: Set the ResourceLoader to use for loading bundle properties files.
– DefaultPersistenceUnitManager
– ResourceJobSchedulingDataProcessor
– ScriptFactoryPostProcessor

ApplicationEventPublisherAware
– EventPublicationInterceptor :: invoke 호출할 때 이벤트 발생

MessageSourceAware
– Service :: 그냥 구현했네

ApplicationContextAware
– ApplicationObjectSupport :: applicationcontext 세팅하고 주는일 하는데 사용하는거 편하게 해주려고 만든 클레스
– SchedulerFactoryBean :: 스케쥴링 할 때 applicatoincontext 사용

ServletContextAware
-ServletContextAwareBean :: 기본 구현
– ServletContextAttributeExporter :: servletcontext 받아서 attributes Map을 채우네..
– ServletContextAttributeFactoryBean :: 위랑 같은데 역긴 attribute 하나만 채우네..
– ServletContextFactoryBean :: 기본 구현
– ServletContextParameterFactoryBean :: this.paramValue = servletContext.getInitParameter(this.initParamName); paramValue 세팅
– ServletContextPropertyPlaceholderConfigurer :: resolvePlaceholder 에서 사용
– WebApplicationObjectSupport :: 기본 구현
– CommonsMultipartResolver :: FileItemFactor에 Repository 위치 정보 세팅
– SimpleServletPostProcessor :: postProcessAfterInitialization 에서 사용

2 thoughts on “Bean Life Cycle 콜백 인터페이스 사용 예(in Spring)”

Leave a Reply

Your email address will not be published. Required fields are marked *