From a20eb738afe847e8753f283f81c7b68aebc31992 Mon Sep 17 00:00:00 2001 From: Huxing Zhang Date: Wed, 9 May 2018 12:03:22 +0800 Subject: [PATCH] Add comments. --- .../initializer/DubboWebApplicationInitializer.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/dubbo-config/dubbo-config-spring/src/main/java/com/alibaba/dubbo/config/spring/initializer/DubboWebApplicationInitializer.java b/dubbo-config/dubbo-config-spring/src/main/java/com/alibaba/dubbo/config/spring/initializer/DubboWebApplicationInitializer.java index 0956d88f275..8d0f79db14a 100644 --- a/dubbo-config/dubbo-config-spring/src/main/java/com/alibaba/dubbo/config/spring/initializer/DubboWebApplicationInitializer.java +++ b/dubbo-config/dubbo-config-spring/src/main/java/com/alibaba/dubbo/config/spring/initializer/DubboWebApplicationInitializer.java @@ -20,12 +20,19 @@ import org.springframework.web.context.WebApplicationContext; import org.springframework.web.context.support.XmlWebApplicationContext; - +/** + * An initializer to register {@link DubboApplicationListener} + * to the ApplicationContext seamlessly. + */ public class DubboWebApplicationInitializer extends AbstractContextLoaderInitializer { + /** + * This method won't be triggered if running on spring-boot. + * It only works when running under a servlet container. + * @return a WebApplicationContext with DubboApplicationListener registered. + */ @Override protected WebApplicationContext createRootApplicationContext() { - // TODO need to verify under spring-boot XmlWebApplicationContext webApplicationContext = new XmlWebApplicationContext(); webApplicationContext.addApplicationListener(new DubboApplicationListener()); return webApplicationContext;