From 89017cedbc20b50e6b63d72d17afaa351997db57 Mon Sep 17 00:00:00 2001 From: "ken.lj" Date: Thu, 26 Jul 2018 10:52:55 +0800 Subject: [PATCH] Resolve conflicts of merging #1820 --- .../DubboWebApplicationInitializer.java | 40 ------------------- .../initializer/DubboApplicationListener.java | 2 +- .../DubboApplicationListenerTest.java | 2 + .../container/spring/SpringContainer.java | 2 +- 4 files changed, 4 insertions(+), 42 deletions(-) delete mode 100644 dubbo-config/dubbo-config-spring/src/main/java/com/alibaba/dubbo/config/spring/initializer/DubboWebApplicationInitializer.java rename dubbo-config/dubbo-config-spring/src/main/java/{com/alibaba => org/apache}/dubbo/config/spring/initializer/DubboApplicationListener.java (97%) 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 deleted file mode 100644 index 8d0f79db14a..00000000000 --- a/dubbo-config/dubbo-config-spring/src/main/java/com/alibaba/dubbo/config/spring/initializer/DubboWebApplicationInitializer.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.alibaba.dubbo.config.spring.initializer; - -import org.springframework.web.context.AbstractContextLoaderInitializer; -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() { - XmlWebApplicationContext webApplicationContext = new XmlWebApplicationContext(); - webApplicationContext.addApplicationListener(new DubboApplicationListener()); - return webApplicationContext; - } -} diff --git a/dubbo-config/dubbo-config-spring/src/main/java/com/alibaba/dubbo/config/spring/initializer/DubboApplicationListener.java b/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/initializer/DubboApplicationListener.java similarity index 97% rename from dubbo-config/dubbo-config-spring/src/main/java/com/alibaba/dubbo/config/spring/initializer/DubboApplicationListener.java rename to dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/initializer/DubboApplicationListener.java index c3d72981b98..8b6409bd65f 100644 --- a/dubbo-config/dubbo-config-spring/src/main/java/com/alibaba/dubbo/config/spring/initializer/DubboApplicationListener.java +++ b/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/initializer/DubboApplicationListener.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.alibaba.dubbo.config.spring.initializer; +package org.apache.dubbo.config.spring.initializer; import org.apache.dubbo.bootstrap.DubboBootstrap; import org.springframework.context.ApplicationEvent; diff --git a/dubbo-config/dubbo-config-spring/src/test/java/com/alibaba/dubbo/config/spring/initializer/DubboApplicationListenerTest.java b/dubbo-config/dubbo-config-spring/src/test/java/com/alibaba/dubbo/config/spring/initializer/DubboApplicationListenerTest.java index fdfe87ae1a9..9220ce91768 100644 --- a/dubbo-config/dubbo-config-spring/src/test/java/com/alibaba/dubbo/config/spring/initializer/DubboApplicationListenerTest.java +++ b/dubbo-config/dubbo-config-spring/src/test/java/com/alibaba/dubbo/config/spring/initializer/DubboApplicationListenerTest.java @@ -17,7 +17,9 @@ package com.alibaba.dubbo.config.spring.initializer; import com.alibaba.dubbo.config.DubboShutdownHook; + import org.apache.dubbo.bootstrap.DubboBootstrap; +import org.apache.dubbo.config.spring.initializer.DubboApplicationListener; import org.junit.Test; import org.mockito.Mockito; import org.springframework.context.support.ClassPathXmlApplicationContext; diff --git a/dubbo-container/dubbo-container-spring/src/main/java/com/alibaba/dubbo/container/spring/SpringContainer.java b/dubbo-container/dubbo-container-spring/src/main/java/com/alibaba/dubbo/container/spring/SpringContainer.java index d4c03c67996..b5866f57c75 100644 --- a/dubbo-container/dubbo-container-spring/src/main/java/com/alibaba/dubbo/container/spring/SpringContainer.java +++ b/dubbo-container/dubbo-container-spring/src/main/java/com/alibaba/dubbo/container/spring/SpringContainer.java @@ -19,9 +19,9 @@ import com.alibaba.dubbo.common.logger.Logger; import com.alibaba.dubbo.common.logger.LoggerFactory; import com.alibaba.dubbo.common.utils.ConfigUtils; -import com.alibaba.dubbo.config.spring.initializer.DubboApplicationListener; import com.alibaba.dubbo.container.Container; +import org.apache.dubbo.config.spring.initializer.DubboApplicationListener; import org.springframework.context.support.ClassPathXmlApplicationContext; /**