EventHandler
-
스프링 이벤트 프로그래밍 -ApplicationEventPublisherSPRING 2020. 4. 19. 18:21
ApplicationEventPublisher는 스프링에서 이벤트 프로그래밍에 필요한 인터페이스를 제공한다. ApplicationContext가 이미 ApplicationEventPublisher를 상속하고 있기 때문에 ApplicationContext에서도 사용이 가능하다. 실습 : AppRunner에 이벤트를 발생시킨다. 아래와 같이 publishEvent 메서드를 이용하여 이벤트를 발생시킬 수 있다. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 package com.example.demo; import java.util.Locale; import org.apache.logging.lo..