You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shenyu.apache.org by li...@apache.org on 2022/06/19 05:32:49 UTC
[incubator-shenyu] branch master updated: [ISSUE #3523] task9 remove duplicate AOP code (#3581)
This is an automated email from the ASF dual-hosted git repository.
likeguo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-shenyu.git
The following commit(s) were added to refs/heads/master by this push:
new fbd1fad78 [ISSUE #3523] task9 remove duplicate AOP code (#3581)
fbd1fad78 is described below
commit fbd1fad7821525bb482ee7293152b5a89b632e45
Author: dragon-zhang <ha...@webuy.ai>
AuthorDate: Sun Jun 19 13:32:42 2022 +0800
[ISSUE #3523] task9 remove duplicate AOP code (#3581)
* [ISSUE #3523] remove duplicate aop code in dubbo
* [ISSUE #3523] remove duplicate aop code in grpc
* [ISSUE #3523] remove duplicate aop code in motan
* [ISSUE #3523] remove duplicate aop code in sofa
* [ISSUE #3523] remove duplicate aop code in springcloud
* [ISSUE #3523] remove duplicate aop code in tars
* [ISSUE #3523] remove duplicate aop code in websocket
* add lincense
* remove sofa part
---
shenyu-examples/pom.xml | 1 +
.../pom.xml | 18 +++++---
.../common/aop/InterceptorConfiguration.java} | 15 ++++---
.../apache/shenyu/examples/common}/aop/Log.java | 2 +-
.../examples/common}/aop/LogInterceptor.java | 6 +--
.../src/main/resources/META-INF/spring.factories | 3 ++
.../src/main/resources/META-INF/spring.provides | 1 +
shenyu-examples/shenyu-examples-dubbo/pom.xml | 5 +++
.../pom.xml | 4 +-
.../alibaba/dubbo/service/annotation/aop/Log.java | 26 -----------
.../service/annotation/aop/LogInterceptor.java | 48 --------------------
.../annotation/impl/DubboTestServiceImpl.java | 2 +-
.../shenyu-examples-alibaba-dubbo-service/pom.xml | 4 +-
.../examples/alibaba/dubbo/service/aop/Log.java | 26 -----------
.../alibaba/dubbo/service/aop/LogInterceptor.java | 48 --------------------
.../dubbo/service/impl/DubboTestServiceImpl.java | 2 +-
.../pom.xml | 4 +-
.../service/annotation/aop/LogInterceptor.java | 48 --------------------
.../annotation/impl/DubboTestServiceImpl.java | 2 +-
.../pom.xml | 4 +-
.../examples/apache/dubbo/service/xml/aop/Log.java | 26 -----------
.../dubbo/service/xml/aop/LogInterceptor.java | 48 --------------------
.../service/xml/impl/DubboTestServiceImpl.java | 2 +-
.../shenyu-examples-apache-dubbo-service/pom.xml | 4 +-
.../examples/apache/dubbo/service/aop/Log.java | 26 -----------
.../apache/dubbo/service/aop/LogInterceptor.java | 48 --------------------
.../dubbo/service/impl/DubboTestServiceImpl.java | 2 +-
.../pom.xml | 4 +-
.../cloud/dubbo/service/annotation/aop/Log.java | 26 -----------
.../service/annotation/aop/LogInterceptor.java | 48 --------------------
.../service/annotation/impl/TestServiceImpl.java | 2 +-
shenyu-examples/shenyu-examples-grpc/pom.xml | 5 ++-
.../org/apache/shenyu/examples/grpc/aop/Log.java | 26 -----------
.../shenyu/examples/grpc/aop/LogInterceptor.java | 48 --------------------
.../shenyu/examples/grpc/echo/EchoServiceImpl.java | 2 +-
.../shenyu-examples-motan-service/pom.xml | 5 ++-
.../shenyu/examples/motan/service/aop/Log.java | 30 -------------
.../examples/motan/service/aop/LogInterceptor.java | 48 --------------------
.../motan/service/impl/MotanDemoServiceImpl.java | 2 +-
.../shenyu-examples-sofa-service/pom.xml | 5 ++-
.../shenyu/examples/sofa/service/aop/Log.java | 30 -------------
.../examples/sofa/service/aop/LogInterceptor.java | 49 ---------------------
.../service/impl/SofaSingleParamServiceImpl.java | 2 +-
.../shenyu-examples-springcloud/pom.xml | 5 ++-
.../shenyu/examples/springcloud/aop/Log.java | 30 -------------
.../examples/springcloud/aop/LogInterceptor.java | 48 --------------------
.../springcloud/controller/TestController.java | 2 +-
shenyu-examples/shenyu-examples-tars/pom.xml | 5 ++-
.../servant/testapp/impl/HelloServantImpl.java | 2 +-
.../servant/testapp/impl/OrderServantImpl.java | 2 -
.../tars/servant/testapp/impl/UserServantImpl.java | 2 -
shenyu-examples/shenyu-examples-websocket/pom.xml | 10 ++++-
.../shenyu-example-spring-native-websocket/pom.xml | 4 +-
.../apache/shenyu/examples/websocket/aop/Log.java | 30 -------------
.../examples/websocket/aop/LogInterceptor.java | 48 --------------------
.../websocket/controller/TestHttpController.java | 2 +-
.../pom.xml | 4 +-
.../apache/shenyu/examples/websocket/aop/Log.java | 30 -------------
.../examples/websocket/aop/LogInterceptor.java | 48 --------------------
.../examples/websocket/handler/EchoHandler.java | 2 +-
.../test/combination/dto/SofaTestData.java | 51 ----------------------
.../test/combination/SharedThreadPoolTest.java | 20 ---------
62 files changed, 86 insertions(+), 1016 deletions(-)
diff --git a/shenyu-examples/pom.xml b/shenyu-examples/pom.xml
index 2077c7884..7863c50ed 100644
--- a/shenyu-examples/pom.xml
+++ b/shenyu-examples/pom.xml
@@ -40,6 +40,7 @@
</properties>
<modules>
+ <module>shenyu-examples-common</module>
<module>shenyu-examples-http</module>
<module>shenyu-examples-https</module>
<module>shenyu-examples-dubbo</module>
diff --git a/shenyu-examples/shenyu-examples-websocket/pom.xml b/shenyu-examples/shenyu-examples-common/pom.xml
similarity index 75%
copy from shenyu-examples/shenyu-examples-websocket/pom.xml
copy to shenyu-examples/shenyu-examples-common/pom.xml
index c15be6081..5f822d58c 100644
--- a/shenyu-examples/shenyu-examples-websocket/pom.xml
+++ b/shenyu-examples/shenyu-examples-common/pom.xml
@@ -25,14 +25,18 @@
<version>2.5.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
- <artifactId>shenyu-examples-websocket</artifactId>
- <packaging>pom</packaging>
- <modules>
- <module>shenyu-example-spring-annotation-websocket</module>
- <module>shenyu-example-spring-native-websocket</module>
- <module>shenyu-example-spring-reactive-websocket</module>
- </modules>
+ <artifactId>shenyu-examples-common</artifactId>
+ <properties>
+ <maven.compiler.source>8</maven.compiler.source>
+ <maven.compiler.target>8</maven.compiler.target>
+ </properties>
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-aop</artifactId>
+ </dependency>
+ </dependencies>
</project>
\ No newline at end of file
diff --git a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/annotation/aop/Log.java b/shenyu-examples/shenyu-examples-common/src/main/java/org/apache/shenyu/examples/common/aop/InterceptorConfiguration.java
similarity index 72%
rename from shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/annotation/aop/Log.java
rename to shenyu-examples/shenyu-examples-common/src/main/java/org/apache/shenyu/examples/common/aop/InterceptorConfiguration.java
index 7cbb6efae..22213b8cd 100644
--- a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/annotation/aop/Log.java
+++ b/shenyu-examples/shenyu-examples-common/src/main/java/org/apache/shenyu/examples/common/aop/InterceptorConfiguration.java
@@ -15,12 +15,15 @@
* limitations under the License.
*/
-package org.apache.shenyu.examples.apache.dubbo.service.annotation.aop;
+package org.apache.shenyu.examples.common.aop;
-import java.lang.annotation.*;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
-@Target({ElementType.TYPE, ElementType.METHOD})
-@Retention(RetentionPolicy.RUNTIME)
-@Documented
-public @interface Log {
+@Configuration
+public class InterceptorConfiguration {
+ @Bean
+ public LogInterceptor logInterceptor() {
+ return new LogInterceptor();
+ }
}
diff --git a/shenyu-examples/shenyu-examples-tars/src/main/java/org/apache/shenyu/examples/tars/aop/Log.java b/shenyu-examples/shenyu-examples-common/src/main/java/org/apache/shenyu/examples/common/aop/Log.java
similarity index 96%
rename from shenyu-examples/shenyu-examples-tars/src/main/java/org/apache/shenyu/examples/tars/aop/Log.java
rename to shenyu-examples/shenyu-examples-common/src/main/java/org/apache/shenyu/examples/common/aop/Log.java
index 6d624f81b..eccdcb8b7 100644
--- a/shenyu-examples/shenyu-examples-tars/src/main/java/org/apache/shenyu/examples/tars/aop/Log.java
+++ b/shenyu-examples/shenyu-examples-common/src/main/java/org/apache/shenyu/examples/common/aop/Log.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shenyu.examples.tars.aop;
+package org.apache.shenyu.examples.common.aop;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
diff --git a/shenyu-examples/shenyu-examples-tars/src/main/java/org/apache/shenyu/examples/tars/aop/LogInterceptor.java b/shenyu-examples/shenyu-examples-common/src/main/java/org/apache/shenyu/examples/common/aop/LogInterceptor.java
similarity index 89%
rename from shenyu-examples/shenyu-examples-tars/src/main/java/org/apache/shenyu/examples/tars/aop/LogInterceptor.java
rename to shenyu-examples/shenyu-examples-common/src/main/java/org/apache/shenyu/examples/common/aop/LogInterceptor.java
index c4f4686bf..ada2e33d6 100644
--- a/shenyu-examples/shenyu-examples-tars/src/main/java/org/apache/shenyu/examples/tars/aop/LogInterceptor.java
+++ b/shenyu-examples/shenyu-examples-common/src/main/java/org/apache/shenyu/examples/common/aop/LogInterceptor.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shenyu.examples.tars.aop;
+package org.apache.shenyu.examples.common.aop;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
@@ -23,15 +23,13 @@ import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Component;
@Aspect
-@Component
public class LogInterceptor {
private static final Logger log = LoggerFactory.getLogger(LogInterceptor.class);
- @Pointcut("@annotation(org.apache.shenyu.examples.tars.aop.Log)")
+ @Pointcut("@annotation(org.apache.shenyu.examples.common.aop.Log)")
public void logPointcut() {
//just for pointcut
}
diff --git a/shenyu-examples/shenyu-examples-common/src/main/resources/META-INF/spring.factories b/shenyu-examples/shenyu-examples-common/src/main/resources/META-INF/spring.factories
new file mode 100644
index 000000000..9c5516ec5
--- /dev/null
+++ b/shenyu-examples/shenyu-examples-common/src/main/resources/META-INF/spring.factories
@@ -0,0 +1,3 @@
+# Auto Configure
+org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
+org.apache.shenyu.examples.common.aop.InterceptorConfiguration
diff --git a/shenyu-examples/shenyu-examples-common/src/main/resources/META-INF/spring.provides b/shenyu-examples/shenyu-examples-common/src/main/resources/META-INF/spring.provides
new file mode 100644
index 000000000..ad70cf8b3
--- /dev/null
+++ b/shenyu-examples/shenyu-examples-common/src/main/resources/META-INF/spring.provides
@@ -0,0 +1 @@
+provides: shenyu-examples-common
\ No newline at end of file
diff --git a/shenyu-examples/shenyu-examples-dubbo/pom.xml b/shenyu-examples/shenyu-examples-dubbo/pom.xml
index 3bd3cfb93..865f19ee2 100644
--- a/shenyu-examples/shenyu-examples-dubbo/pom.xml
+++ b/shenyu-examples/shenyu-examples-dubbo/pom.xml
@@ -40,6 +40,11 @@
<dependencyManagement>
<dependencies>
+ <dependency>
+ <groupId>org.apache.shenyu</groupId>
+ <artifactId>shenyu-examples-common</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<dependency>
<groupId>org.apache.shenyu</groupId>
<artifactId>shenyu-examples-dubbo-api</artifactId>
diff --git a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service-annotation/pom.xml b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service-annotation/pom.xml
index e40ae7a40..145894c2a 100644
--- a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service-annotation/pom.xml
+++ b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service-annotation/pom.xml
@@ -52,8 +52,8 @@
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-aop</artifactId>
+ <groupId>org.apache.shenyu</groupId>
+ <artifactId>shenyu-examples-common</artifactId>
</dependency>
<dependency>
diff --git a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/alibaba/dubbo/service/annotation/aop/Log.java b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/alibaba/dubbo/service/annotation/aop/Log.java
deleted file mode 100644
index 905dc1875..000000000
--- a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/alibaba/dubbo/service/annotation/aop/Log.java
+++ /dev/null
@@ -1,26 +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 org.apache.shenyu.examples.alibaba.dubbo.service.annotation.aop;
-
-import java.lang.annotation.*;
-
-@Target({ElementType.TYPE, ElementType.METHOD})
-@Retention(RetentionPolicy.RUNTIME)
-@Documented
-public @interface Log {
-}
diff --git a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/alibaba/dubbo/service/annotation/aop/LogInterceptor.java b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/alibaba/dubbo/service/annotation/aop/LogInterceptor.java
deleted file mode 100644
index 52b47a6bb..000000000
--- a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/alibaba/dubbo/service/annotation/aop/LogInterceptor.java
+++ /dev/null
@@ -1,48 +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 org.apache.shenyu.examples.alibaba.dubbo.service.annotation.aop;
-
-import org.aspectj.lang.ProceedingJoinPoint;
-import org.aspectj.lang.annotation.Around;
-import org.aspectj.lang.annotation.Aspect;
-import org.aspectj.lang.annotation.Pointcut;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Component;
-
-@Aspect
-@Component
-public class LogInterceptor {
-
- private static final Logger log = LoggerFactory.getLogger(LogInterceptor.class);
-
- @Pointcut("@annotation(org.apache.shenyu.examples.alibaba.dubbo.service.annotation.aop.Log)")
- public void logPointcut() {
- //just for pointcut
- }
-
- @Around("logPointcut()")
- public Object around(ProceedingJoinPoint point) throws Throwable {
- try {
- log.info("before");
- return point.proceed(point.getArgs());
- } finally {
- log.info("after");
- }
- }
-}
diff --git a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/alibaba/dubbo/service/annotation/impl/DubboTestServiceImpl.java b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/alibaba/dubbo/service/annotation/impl/DubboTestServiceImpl.java
index 0beefed85..b7ef9c7d1 100644
--- a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/alibaba/dubbo/service/annotation/impl/DubboTestServiceImpl.java
+++ b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/alibaba/dubbo/service/annotation/impl/DubboTestServiceImpl.java
@@ -18,7 +18,7 @@ package org.apache.shenyu.examples.alibaba.dubbo.service.annotation.impl;
import com.alibaba.dubbo.config.annotation.Service;
import org.apache.shenyu.client.dubbo.common.annotation.ShenyuDubboClient;
-import org.apache.shenyu.examples.alibaba.dubbo.service.annotation.aop.Log;
+import org.apache.shenyu.examples.common.aop.Log;
import org.apache.shenyu.examples.dubbo.api.entity.DubboTest;
import org.apache.shenyu.examples.dubbo.api.entity.ListResp;
import org.apache.shenyu.examples.dubbo.api.service.DubboTestService;
diff --git a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service/pom.xml b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service/pom.xml
index b6d4b1718..a643b807a 100644
--- a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service/pom.xml
+++ b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service/pom.xml
@@ -62,8 +62,8 @@
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-aop</artifactId>
+ <groupId>org.apache.shenyu</groupId>
+ <artifactId>shenyu-examples-common</artifactId>
</dependency>
<dependency>
diff --git a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service/src/main/java/org/apache/shenyu/examples/alibaba/dubbo/service/aop/Log.java b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service/src/main/java/org/apache/shenyu/examples/alibaba/dubbo/service/aop/Log.java
deleted file mode 100644
index 99f22a64c..000000000
--- a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service/src/main/java/org/apache/shenyu/examples/alibaba/dubbo/service/aop/Log.java
+++ /dev/null
@@ -1,26 +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 org.apache.shenyu.examples.alibaba.dubbo.service.aop;
-
-import java.lang.annotation.*;
-
-@Target({ElementType.TYPE, ElementType.METHOD})
-@Retention(RetentionPolicy.RUNTIME)
-@Documented
-public @interface Log {
-}
diff --git a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service/src/main/java/org/apache/shenyu/examples/alibaba/dubbo/service/aop/LogInterceptor.java b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service/src/main/java/org/apache/shenyu/examples/alibaba/dubbo/service/aop/LogInterceptor.java
deleted file mode 100644
index 076de2d9b..000000000
--- a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service/src/main/java/org/apache/shenyu/examples/alibaba/dubbo/service/aop/LogInterceptor.java
+++ /dev/null
@@ -1,48 +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 org.apache.shenyu.examples.alibaba.dubbo.service.aop;
-
-import org.aspectj.lang.ProceedingJoinPoint;
-import org.aspectj.lang.annotation.Around;
-import org.aspectj.lang.annotation.Aspect;
-import org.aspectj.lang.annotation.Pointcut;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Component;
-
-@Aspect
-@Component
-public class LogInterceptor {
-
- private static final Logger log = LoggerFactory.getLogger(LogInterceptor.class);
-
- @Pointcut("@annotation(org.apache.shenyu.examples.alibaba.dubbo.service.aop.Log)")
- public void logPointcut() {
- //just for pointcut
- }
-
- @Around("logPointcut()")
- public Object around(ProceedingJoinPoint point) throws Throwable {
- try {
- log.info("before");
- return point.proceed(point.getArgs());
- } finally {
- log.info("after");
- }
- }
-}
diff --git a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service/src/main/java/org/apache/shenyu/examples/alibaba/dubbo/service/impl/DubboTestServiceImpl.java b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service/src/main/java/org/apache/shenyu/examples/alibaba/dubbo/service/impl/DubboTestServiceImpl.java
index cfa1a468f..8ac3b4e6c 100644
--- a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service/src/main/java/org/apache/shenyu/examples/alibaba/dubbo/service/impl/DubboTestServiceImpl.java
+++ b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service/src/main/java/org/apache/shenyu/examples/alibaba/dubbo/service/impl/DubboTestServiceImpl.java
@@ -17,7 +17,7 @@
package org.apache.shenyu.examples.alibaba.dubbo.service.impl;
import org.apache.shenyu.client.dubbo.common.annotation.ShenyuDubboClient;
-import org.apache.shenyu.examples.alibaba.dubbo.service.aop.Log;
+import org.apache.shenyu.examples.common.aop.Log;
import org.apache.shenyu.examples.dubbo.api.entity.DubboTest;
import org.apache.shenyu.examples.dubbo.api.entity.ListResp;
import org.apache.shenyu.examples.dubbo.api.service.DubboTestService;
diff --git a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-annotation/pom.xml b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-annotation/pom.xml
index c95c33d7a..6373bec16 100644
--- a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-annotation/pom.xml
+++ b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-annotation/pom.xml
@@ -58,8 +58,8 @@
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-aop</artifactId>
+ <groupId>org.apache.shenyu</groupId>
+ <artifactId>shenyu-examples-common</artifactId>
</dependency>
<dependency>
diff --git a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/annotation/aop/LogInterceptor.java b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/annotation/aop/LogInterceptor.java
deleted file mode 100644
index 6fea60fea..000000000
--- a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/annotation/aop/LogInterceptor.java
+++ /dev/null
@@ -1,48 +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 org.apache.shenyu.examples.apache.dubbo.service.annotation.aop;
-
-import org.aspectj.lang.ProceedingJoinPoint;
-import org.aspectj.lang.annotation.Around;
-import org.aspectj.lang.annotation.Aspect;
-import org.aspectj.lang.annotation.Pointcut;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Component;
-
-@Aspect
-@Component
-public class LogInterceptor {
-
- private static final Logger log = LoggerFactory.getLogger(LogInterceptor.class);
-
- @Pointcut("@annotation(org.apache.shenyu.examples.apache.dubbo.service.annotation.aop.Log)")
- public void logPointcut() {
- //just for pointcut
- }
-
- @Around("logPointcut()")
- public Object around(ProceedingJoinPoint point) throws Throwable {
- try {
- log.info("before");
- return point.proceed(point.getArgs());
- } finally {
- log.info("after");
- }
- }
-}
diff --git a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/annotation/impl/DubboTestServiceImpl.java b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/annotation/impl/DubboTestServiceImpl.java
index df6307d90..8512c6f44 100644
--- a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/annotation/impl/DubboTestServiceImpl.java
+++ b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/annotation/impl/DubboTestServiceImpl.java
@@ -20,7 +20,7 @@ import org.apache.dubbo.config.annotation.DubboService;
import org.apache.dubbo.rpc.RpcContext;
import org.apache.shenyu.client.dubbo.common.annotation.ShenyuDubboClient;
import org.apache.shenyu.common.utils.GsonUtils;
-import org.apache.shenyu.examples.apache.dubbo.service.annotation.aop.Log;
+import org.apache.shenyu.examples.common.aop.Log;
import org.apache.shenyu.examples.dubbo.api.entity.DubboTest;
import org.apache.shenyu.examples.dubbo.api.entity.ListResp;
import org.apache.shenyu.examples.dubbo.api.service.DubboTestService;
diff --git a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-xml/pom.xml b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-xml/pom.xml
index 65241122b..b5af26a65 100644
--- a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-xml/pom.xml
+++ b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-xml/pom.xml
@@ -61,8 +61,8 @@
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-aop</artifactId>
+ <groupId>org.apache.shenyu</groupId>
+ <artifactId>shenyu-examples-common</artifactId>
</dependency>
<dependency>
diff --git a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-xml/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/xml/aop/Log.java b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-xml/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/xml/aop/Log.java
deleted file mode 100644
index 0397275b7..000000000
--- a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-xml/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/xml/aop/Log.java
+++ /dev/null
@@ -1,26 +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 org.apache.shenyu.examples.apache.dubbo.service.xml.aop;
-
-import java.lang.annotation.*;
-
-@Target({ElementType.TYPE, ElementType.METHOD})
-@Retention(RetentionPolicy.RUNTIME)
-@Documented
-public @interface Log {
-}
diff --git a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-xml/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/xml/aop/LogInterceptor.java b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-xml/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/xml/aop/LogInterceptor.java
deleted file mode 100644
index 5ab5192d7..000000000
--- a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-xml/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/xml/aop/LogInterceptor.java
+++ /dev/null
@@ -1,48 +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 org.apache.shenyu.examples.apache.dubbo.service.xml.aop;
-
-import org.aspectj.lang.ProceedingJoinPoint;
-import org.aspectj.lang.annotation.Around;
-import org.aspectj.lang.annotation.Aspect;
-import org.aspectj.lang.annotation.Pointcut;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Component;
-
-@Aspect
-@Component
-public class LogInterceptor {
-
- private static final Logger log = LoggerFactory.getLogger(LogInterceptor.class);
-
- @Pointcut("@annotation(org.apache.shenyu.examples.apache.dubbo.service.xml.aop.Log)")
- public void logPointcut() {
- //just for pointcut
- }
-
- @Around("logPointcut()")
- public Object around(ProceedingJoinPoint point) throws Throwable {
- try {
- log.info("before");
- return point.proceed(point.getArgs());
- } finally {
- log.info("after");
- }
- }
-}
diff --git a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-xml/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/xml/impl/DubboTestServiceImpl.java b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-xml/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/xml/impl/DubboTestServiceImpl.java
index e794c6970..90b0be07e 100644
--- a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-xml/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/xml/impl/DubboTestServiceImpl.java
+++ b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-xml/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/xml/impl/DubboTestServiceImpl.java
@@ -17,7 +17,7 @@
package org.apache.shenyu.examples.apache.dubbo.service.xml.impl;
import org.apache.shenyu.client.dubbo.common.annotation.ShenyuDubboClient;
-import org.apache.shenyu.examples.apache.dubbo.service.xml.aop.Log;
+import org.apache.shenyu.examples.common.aop.Log;
import org.apache.shenyu.examples.dubbo.api.entity.DubboTest;
import org.apache.shenyu.examples.dubbo.api.entity.ListResp;
import org.apache.shenyu.examples.dubbo.api.service.DubboTestService;
diff --git a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service/pom.xml b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service/pom.xml
index 5cf3ef114..aff2c78da 100644
--- a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service/pom.xml
+++ b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service/pom.xml
@@ -62,8 +62,8 @@
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-aop</artifactId>
+ <groupId>org.apache.shenyu</groupId>
+ <artifactId>shenyu-examples-common</artifactId>
</dependency>
<dependency>
diff --git a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/aop/Log.java b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/aop/Log.java
deleted file mode 100644
index b850aae07..000000000
--- a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/aop/Log.java
+++ /dev/null
@@ -1,26 +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 org.apache.shenyu.examples.apache.dubbo.service.aop;
-
-import java.lang.annotation.*;
-
-@Target({ElementType.TYPE, ElementType.METHOD})
-@Retention(RetentionPolicy.RUNTIME)
-@Documented
-public @interface Log {
-}
diff --git a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/aop/LogInterceptor.java b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/aop/LogInterceptor.java
deleted file mode 100644
index e61275faa..000000000
--- a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/aop/LogInterceptor.java
+++ /dev/null
@@ -1,48 +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 org.apache.shenyu.examples.apache.dubbo.service.aop;
-
-import org.aspectj.lang.ProceedingJoinPoint;
-import org.aspectj.lang.annotation.Around;
-import org.aspectj.lang.annotation.Aspect;
-import org.aspectj.lang.annotation.Pointcut;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Component;
-
-@Aspect
-@Component
-public class LogInterceptor {
-
- private static final Logger log = LoggerFactory.getLogger(LogInterceptor.class);
-
- @Pointcut("@annotation(org.apache.shenyu.examples.apache.dubbo.service.aop.Log)")
- public void logPointcut() {
- //just for pointcut
- }
-
- @Around("logPointcut()")
- public Object around(ProceedingJoinPoint point) throws Throwable {
- try {
- log.info("before");
- return point.proceed(point.getArgs());
- } finally {
- log.info("after");
- }
- }
-}
diff --git a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/impl/DubboTestServiceImpl.java b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/impl/DubboTestServiceImpl.java
index f44ca101e..55a7cb85c 100644
--- a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/impl/DubboTestServiceImpl.java
+++ b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/impl/DubboTestServiceImpl.java
@@ -17,7 +17,7 @@
package org.apache.shenyu.examples.apache.dubbo.service.impl;
import org.apache.shenyu.client.dubbo.common.annotation.ShenyuDubboClient;
-import org.apache.shenyu.examples.apache.dubbo.service.aop.Log;
+import org.apache.shenyu.examples.common.aop.Log;
import org.apache.shenyu.examples.dubbo.api.entity.DubboTest;
import org.apache.shenyu.examples.dubbo.api.entity.ListResp;
import org.apache.shenyu.examples.dubbo.api.service.DubboTestService;
diff --git a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-spring-cloud-alibaba-dubbo-service-annotation/pom.xml b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-spring-cloud-alibaba-dubbo-service-annotation/pom.xml
index 31a3408f7..14bd51ffa 100644
--- a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-spring-cloud-alibaba-dubbo-service-annotation/pom.xml
+++ b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-spring-cloud-alibaba-dubbo-service-annotation/pom.xml
@@ -82,8 +82,8 @@
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-aop</artifactId>
+ <groupId>org.apache.shenyu</groupId>
+ <artifactId>shenyu-examples-common</artifactId>
</dependency>
<dependency>
diff --git a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-spring-cloud-alibaba-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/spring/cloud/dubbo/service/annotation/aop/Log.java b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-spring-cloud-alibaba-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/spring/cloud/dubbo/service/annotation/aop/Log.java
deleted file mode 100644
index 79d83ab77..000000000
--- a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-spring-cloud-alibaba-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/spring/cloud/dubbo/service/annotation/aop/Log.java
+++ /dev/null
@@ -1,26 +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 org.apache.shenyu.examples.spring.cloud.dubbo.service.annotation.aop;
-
-import java.lang.annotation.*;
-
-@Target({ElementType.TYPE, ElementType.METHOD})
-@Retention(RetentionPolicy.RUNTIME)
-@Documented
-public @interface Log {
-}
diff --git a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-spring-cloud-alibaba-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/spring/cloud/dubbo/service/annotation/aop/LogInterceptor.java b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-spring-cloud-alibaba-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/spring/cloud/dubbo/service/annotation/aop/LogInterceptor.java
deleted file mode 100644
index 967f8b4eb..000000000
--- a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-spring-cloud-alibaba-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/spring/cloud/dubbo/service/annotation/aop/LogInterceptor.java
+++ /dev/null
@@ -1,48 +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 org.apache.shenyu.examples.spring.cloud.dubbo.service.annotation.aop;
-
-import org.aspectj.lang.ProceedingJoinPoint;
-import org.aspectj.lang.annotation.Around;
-import org.aspectj.lang.annotation.Aspect;
-import org.aspectj.lang.annotation.Pointcut;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Component;
-
-@Aspect
-@Component
-public class LogInterceptor {
-
- private static final Logger log = LoggerFactory.getLogger(LogInterceptor.class);
-
- @Pointcut("@annotation(org.apache.shenyu.examples.spring.cloud.dubbo.service.annotation.aop.Log)")
- public void logPointcut() {
- //just for pointcut
- }
-
- @Around("logPointcut()")
- public Object around(ProceedingJoinPoint point) throws Throwable {
- try {
- log.info("before");
- return point.proceed(point.getArgs());
- } finally {
- log.info("after");
- }
- }
-}
diff --git a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-spring-cloud-alibaba-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/spring/cloud/dubbo/service/annotation/impl/TestServiceImpl.java b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-spring-cloud-alibaba-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/spring/cloud/dubbo/service/annotation/impl/TestServiceImpl.java
index 4b0da634d..19e2000e6 100644
--- a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-spring-cloud-alibaba-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/spring/cloud/dubbo/service/annotation/impl/TestServiceImpl.java
+++ b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-spring-cloud-alibaba-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/spring/cloud/dubbo/service/annotation/impl/TestServiceImpl.java
@@ -18,10 +18,10 @@ package org.apache.shenyu.examples.spring.cloud.dubbo.service.annotation.impl;
import org.apache.dubbo.config.annotation.DubboService;
import org.apache.shenyu.client.dubbo.common.annotation.ShenyuDubboClient;
+import org.apache.shenyu.examples.common.aop.Log;
import org.apache.shenyu.examples.dubbo.api.entity.DubboTest;
import org.apache.shenyu.examples.dubbo.api.entity.ListResp;
import org.apache.shenyu.examples.dubbo.api.service.DubboTestService;
-import org.apache.shenyu.examples.spring.cloud.dubbo.service.annotation.aop.Log;
import java.util.Collections;
import java.util.Random;
diff --git a/shenyu-examples/shenyu-examples-grpc/pom.xml b/shenyu-examples/shenyu-examples-grpc/pom.xml
index 14d3867e7..b775600dd 100644
--- a/shenyu-examples/shenyu-examples-grpc/pom.xml
+++ b/shenyu-examples/shenyu-examples-grpc/pom.xml
@@ -45,8 +45,9 @@
</dependency>
<dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-aop</artifactId>
+ <groupId>org.apache.shenyu</groupId>
+ <artifactId>shenyu-examples-common</artifactId>
+ <version>${project.version}</version>
</dependency>
<dependency>
diff --git a/shenyu-examples/shenyu-examples-grpc/src/main/java/org/apache/shenyu/examples/grpc/aop/Log.java b/shenyu-examples/shenyu-examples-grpc/src/main/java/org/apache/shenyu/examples/grpc/aop/Log.java
deleted file mode 100644
index 920f4ecc3..000000000
--- a/shenyu-examples/shenyu-examples-grpc/src/main/java/org/apache/shenyu/examples/grpc/aop/Log.java
+++ /dev/null
@@ -1,26 +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 org.apache.shenyu.examples.grpc.aop;
-
-import java.lang.annotation.*;
-
-@Target({ElementType.TYPE, ElementType.METHOD})
-@Retention(RetentionPolicy.RUNTIME)
-@Documented
-public @interface Log {
-}
diff --git a/shenyu-examples/shenyu-examples-grpc/src/main/java/org/apache/shenyu/examples/grpc/aop/LogInterceptor.java b/shenyu-examples/shenyu-examples-grpc/src/main/java/org/apache/shenyu/examples/grpc/aop/LogInterceptor.java
deleted file mode 100644
index 66f50903d..000000000
--- a/shenyu-examples/shenyu-examples-grpc/src/main/java/org/apache/shenyu/examples/grpc/aop/LogInterceptor.java
+++ /dev/null
@@ -1,48 +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 org.apache.shenyu.examples.grpc.aop;
-
-import org.aspectj.lang.ProceedingJoinPoint;
-import org.aspectj.lang.annotation.Around;
-import org.aspectj.lang.annotation.Aspect;
-import org.aspectj.lang.annotation.Pointcut;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Component;
-
-@Aspect
-@Component
-public class LogInterceptor {
-
- private static final Logger log = LoggerFactory.getLogger(LogInterceptor.class);
-
- @Pointcut("@annotation(org.apache.shenyu.examples.grpc.aop.Log)")
- public void logPointcut() {
- // just for pointcut
- }
-
- @Around("logPointcut()")
- public Object around(ProceedingJoinPoint point) throws Throwable {
- try {
- log.info("before proceed");
- return point.proceed(point.getArgs());
- } finally {
- log.info("after proceed");
- }
- }
-}
diff --git a/shenyu-examples/shenyu-examples-grpc/src/main/java/org/apache/shenyu/examples/grpc/echo/EchoServiceImpl.java b/shenyu-examples/shenyu-examples-grpc/src/main/java/org/apache/shenyu/examples/grpc/echo/EchoServiceImpl.java
index 4bd68a779..ae1de4560 100644
--- a/shenyu-examples/shenyu-examples-grpc/src/main/java/org/apache/shenyu/examples/grpc/echo/EchoServiceImpl.java
+++ b/shenyu-examples/shenyu-examples-grpc/src/main/java/org/apache/shenyu/examples/grpc/echo/EchoServiceImpl.java
@@ -27,7 +27,7 @@ import java.net.InetAddress;
import java.net.UnknownHostException;
import org.apache.shenyu.client.grpc.common.annotation.ShenyuGrpcClient;
-import org.apache.shenyu.examples.grpc.aop.Log;
+import org.apache.shenyu.examples.common.aop.Log;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
diff --git a/shenyu-examples/shenyu-examples-motan/shenyu-examples-motan-service/pom.xml b/shenyu-examples/shenyu-examples-motan/shenyu-examples-motan-service/pom.xml
index fec742eef..acd5db3c0 100644
--- a/shenyu-examples/shenyu-examples-motan/shenyu-examples-motan-service/pom.xml
+++ b/shenyu-examples/shenyu-examples-motan/shenyu-examples-motan-service/pom.xml
@@ -38,8 +38,9 @@
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-aop</artifactId>
+ <groupId>org.apache.shenyu</groupId>
+ <artifactId>shenyu-examples-common</artifactId>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
diff --git a/shenyu-examples/shenyu-examples-motan/shenyu-examples-motan-service/src/main/java/org/apache/shenyu/examples/motan/service/aop/Log.java b/shenyu-examples/shenyu-examples-motan/shenyu-examples-motan-service/src/main/java/org/apache/shenyu/examples/motan/service/aop/Log.java
deleted file mode 100644
index b4f3a7a8a..000000000
--- a/shenyu-examples/shenyu-examples-motan/shenyu-examples-motan-service/src/main/java/org/apache/shenyu/examples/motan/service/aop/Log.java
+++ /dev/null
@@ -1,30 +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 org.apache.shenyu.examples.motan.service.aop;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Target({ElementType.TYPE, ElementType.METHOD})
-@Retention(RetentionPolicy.RUNTIME)
-@Documented
-public @interface Log {
-}
\ No newline at end of file
diff --git a/shenyu-examples/shenyu-examples-motan/shenyu-examples-motan-service/src/main/java/org/apache/shenyu/examples/motan/service/aop/LogInterceptor.java b/shenyu-examples/shenyu-examples-motan/shenyu-examples-motan-service/src/main/java/org/apache/shenyu/examples/motan/service/aop/LogInterceptor.java
deleted file mode 100644
index 896978073..000000000
--- a/shenyu-examples/shenyu-examples-motan/shenyu-examples-motan-service/src/main/java/org/apache/shenyu/examples/motan/service/aop/LogInterceptor.java
+++ /dev/null
@@ -1,48 +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 org.apache.shenyu.examples.motan.service.aop;
-
-import org.aspectj.lang.ProceedingJoinPoint;
-import org.aspectj.lang.annotation.Around;
-import org.aspectj.lang.annotation.Aspect;
-import org.aspectj.lang.annotation.Pointcut;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Component;
-
-@Aspect
-@Component
-public class LogInterceptor {
-
- private static final Logger log = LoggerFactory.getLogger(LogInterceptor.class);
-
- @Pointcut("@annotation(org.apache.shenyu.examples.motan.service.aop.Log)")
- public void logPointcut() {
- //just for pointcut
- }
-
- @Around("logPointcut()")
- public Object around(final ProceedingJoinPoint point) throws Throwable {
- try {
- log.info("before");
- return point.proceed(point.getArgs());
- } finally {
- log.info("after");
- }
- }
-}
diff --git a/shenyu-examples/shenyu-examples-motan/shenyu-examples-motan-service/src/main/java/org/apache/shenyu/examples/motan/service/impl/MotanDemoServiceImpl.java b/shenyu-examples/shenyu-examples-motan/shenyu-examples-motan-service/src/main/java/org/apache/shenyu/examples/motan/service/impl/MotanDemoServiceImpl.java
index fb07cf611..fc85201f1 100644
--- a/shenyu-examples/shenyu-examples-motan/shenyu-examples-motan-service/src/main/java/org/apache/shenyu/examples/motan/service/impl/MotanDemoServiceImpl.java
+++ b/shenyu-examples/shenyu-examples-motan/shenyu-examples-motan-service/src/main/java/org/apache/shenyu/examples/motan/service/impl/MotanDemoServiceImpl.java
@@ -19,8 +19,8 @@ package org.apache.shenyu.examples.motan.service.impl;
import com.weibo.api.motan.config.springsupport.annotation.MotanService;
import org.apache.shenyu.client.motan.common.annotation.ShenyuMotanClient;
+import org.apache.shenyu.examples.common.aop.Log;
import org.apache.shenyu.examples.motan.service.MotanDemoService;
-import org.apache.shenyu.examples.motan.service.aop.Log;
/**
* Motan demo service.
diff --git a/shenyu-examples/shenyu-examples-sofa/shenyu-examples-sofa-service/pom.xml b/shenyu-examples/shenyu-examples-sofa/shenyu-examples-sofa-service/pom.xml
index 8499d1d2f..6664a203f 100644
--- a/shenyu-examples/shenyu-examples-sofa/shenyu-examples-sofa-service/pom.xml
+++ b/shenyu-examples/shenyu-examples-sofa/shenyu-examples-sofa-service/pom.xml
@@ -103,8 +103,9 @@
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-aop</artifactId>
+ <groupId>org.apache.shenyu</groupId>
+ <artifactId>shenyu-examples-common</artifactId>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
diff --git a/shenyu-examples/shenyu-examples-sofa/shenyu-examples-sofa-service/src/main/java/org/apache/shenyu/examples/sofa/service/aop/Log.java b/shenyu-examples/shenyu-examples-sofa/shenyu-examples-sofa-service/src/main/java/org/apache/shenyu/examples/sofa/service/aop/Log.java
deleted file mode 100644
index 7cc2b27d3..000000000
--- a/shenyu-examples/shenyu-examples-sofa/shenyu-examples-sofa-service/src/main/java/org/apache/shenyu/examples/sofa/service/aop/Log.java
+++ /dev/null
@@ -1,30 +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 org.apache.shenyu.examples.sofa.service.aop;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Target({ElementType.TYPE, ElementType.METHOD})
-@Retention(RetentionPolicy.RUNTIME)
-@Documented
-public @interface Log {
-}
diff --git a/shenyu-examples/shenyu-examples-sofa/shenyu-examples-sofa-service/src/main/java/org/apache/shenyu/examples/sofa/service/aop/LogInterceptor.java b/shenyu-examples/shenyu-examples-sofa/shenyu-examples-sofa-service/src/main/java/org/apache/shenyu/examples/sofa/service/aop/LogInterceptor.java
deleted file mode 100644
index c6b52206c..000000000
--- a/shenyu-examples/shenyu-examples-sofa/shenyu-examples-sofa-service/src/main/java/org/apache/shenyu/examples/sofa/service/aop/LogInterceptor.java
+++ /dev/null
@@ -1,49 +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 org.apache.shenyu.examples.sofa.service.aop;
-
-import org.aspectj.lang.ProceedingJoinPoint;
-import org.aspectj.lang.annotation.Around;
-import org.aspectj.lang.annotation.Aspect;
-import org.aspectj.lang.annotation.Pointcut;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Component;
-
-@Aspect
-@Component
-public class LogInterceptor {
-
- private static final Logger log = LoggerFactory.getLogger(LogInterceptor.class);
-
- @Pointcut("@annotation(org.apache.shenyu.examples.sofa.service.aop.Log)")
- public void logPointcut() {
- //just for pointcut
- }
-
- @Around("logPointcut()")
- public Object around(final ProceedingJoinPoint point) throws Throwable {
- try {
- log.info("before");
- return point.proceed(point.getArgs());
- } finally {
- log.info("after");
- }
- }
-}
-
diff --git a/shenyu-examples/shenyu-examples-sofa/shenyu-examples-sofa-service/src/main/java/org/apache/shenyu/examples/sofa/service/impl/SofaSingleParamServiceImpl.java b/shenyu-examples/shenyu-examples-sofa/shenyu-examples-sofa-service/src/main/java/org/apache/shenyu/examples/sofa/service/impl/SofaSingleParamServiceImpl.java
index 16399f897..db77dcc77 100644
--- a/shenyu-examples/shenyu-examples-sofa/shenyu-examples-sofa-service/src/main/java/org/apache/shenyu/examples/sofa/service/impl/SofaSingleParamServiceImpl.java
+++ b/shenyu-examples/shenyu-examples-sofa/shenyu-examples-sofa-service/src/main/java/org/apache/shenyu/examples/sofa/service/impl/SofaSingleParamServiceImpl.java
@@ -18,9 +18,9 @@
package org.apache.shenyu.examples.sofa.service.impl;
import org.apache.shenyu.client.sofa.common.annotation.ShenyuSofaClient;
+import org.apache.shenyu.examples.common.aop.Log;
import org.apache.shenyu.examples.sofa.api.entity.SofaSimpleTypeBean;
import org.apache.shenyu.examples.sofa.api.service.SofaSingleParamService;
-import org.apache.shenyu.examples.sofa.service.aop.Log;
import org.springframework.stereotype.Service;
import java.util.Random;
diff --git a/shenyu-examples/shenyu-examples-springcloud/pom.xml b/shenyu-examples/shenyu-examples-springcloud/pom.xml
index 072dc37d2..d3cad4cf3 100644
--- a/shenyu-examples/shenyu-examples-springcloud/pom.xml
+++ b/shenyu-examples/shenyu-examples-springcloud/pom.xml
@@ -51,8 +51,9 @@
</dependency>
<dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-aop</artifactId>
+ <groupId>org.apache.shenyu</groupId>
+ <artifactId>shenyu-examples-common</artifactId>
+ <version>${project.version}</version>
</dependency>
<dependency>
diff --git a/shenyu-examples/shenyu-examples-springcloud/src/main/java/org/apache/shenyu/examples/springcloud/aop/Log.java b/shenyu-examples/shenyu-examples-springcloud/src/main/java/org/apache/shenyu/examples/springcloud/aop/Log.java
deleted file mode 100644
index 4f191d38e..000000000
--- a/shenyu-examples/shenyu-examples-springcloud/src/main/java/org/apache/shenyu/examples/springcloud/aop/Log.java
+++ /dev/null
@@ -1,30 +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 org.apache.shenyu.examples.springcloud.aop;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Target({ElementType.TYPE, ElementType.METHOD})
-@Retention(RetentionPolicy.RUNTIME)
-@Documented
-public @interface Log {
-}
diff --git a/shenyu-examples/shenyu-examples-springcloud/src/main/java/org/apache/shenyu/examples/springcloud/aop/LogInterceptor.java b/shenyu-examples/shenyu-examples-springcloud/src/main/java/org/apache/shenyu/examples/springcloud/aop/LogInterceptor.java
deleted file mode 100644
index ac1279bbd..000000000
--- a/shenyu-examples/shenyu-examples-springcloud/src/main/java/org/apache/shenyu/examples/springcloud/aop/LogInterceptor.java
+++ /dev/null
@@ -1,48 +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 org.apache.shenyu.examples.springcloud.aop;
-
-import org.aspectj.lang.ProceedingJoinPoint;
-import org.aspectj.lang.annotation.Around;
-import org.aspectj.lang.annotation.Aspect;
-import org.aspectj.lang.annotation.Pointcut;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Component;
-
-@Aspect
-@Component
-public class LogInterceptor {
-
- private static final Logger log = LoggerFactory.getLogger(LogInterceptor.class);
-
- @Pointcut("@annotation(org.apache.shenyu.examples.springcloud.aop.Log)")
- public void logPointcut() {
- // just for pointcut
- }
-
- @Around("logPointcut()")
- public Object around(ProceedingJoinPoint point) throws Throwable {
- try {
- log.info("before proceed");
- return point.proceed(point.getArgs());
- } finally {
- log.info("after proceed");
- }
- }
-}
diff --git a/shenyu-examples/shenyu-examples-springcloud/src/main/java/org/apache/shenyu/examples/springcloud/controller/TestController.java b/shenyu-examples/shenyu-examples-springcloud/src/main/java/org/apache/shenyu/examples/springcloud/controller/TestController.java
index 0e3322fad..0c626ac3c 100644
--- a/shenyu-examples/shenyu-examples-springcloud/src/main/java/org/apache/shenyu/examples/springcloud/controller/TestController.java
+++ b/shenyu-examples/shenyu-examples-springcloud/src/main/java/org/apache/shenyu/examples/springcloud/controller/TestController.java
@@ -18,7 +18,7 @@
package org.apache.shenyu.examples.springcloud.controller;
import org.apache.shenyu.client.springcloud.annotation.ShenyuSpringCloudClient;
-import org.apache.shenyu.examples.springcloud.aop.Log;
+import org.apache.shenyu.examples.common.aop.Log;
import org.apache.shenyu.examples.springcloud.dto.UserDTO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
diff --git a/shenyu-examples/shenyu-examples-tars/pom.xml b/shenyu-examples/shenyu-examples-tars/pom.xml
index 459c8c26b..f92c6f1bb 100644
--- a/shenyu-examples/shenyu-examples-tars/pom.xml
+++ b/shenyu-examples/shenyu-examples-tars/pom.xml
@@ -39,8 +39,9 @@
</dependency>
<dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-aop</artifactId>
+ <groupId>org.apache.shenyu</groupId>
+ <artifactId>shenyu-examples-common</artifactId>
+ <version>${project.version}</version>
</dependency>
<dependency>
diff --git a/shenyu-examples/shenyu-examples-tars/src/main/java/org/apache/shenyu/examples/tars/servant/testapp/impl/HelloServantImpl.java b/shenyu-examples/shenyu-examples-tars/src/main/java/org/apache/shenyu/examples/tars/servant/testapp/impl/HelloServantImpl.java
index cce8f460b..d73535d19 100644
--- a/shenyu-examples/shenyu-examples-tars/src/main/java/org/apache/shenyu/examples/tars/servant/testapp/impl/HelloServantImpl.java
+++ b/shenyu-examples/shenyu-examples-tars/src/main/java/org/apache/shenyu/examples/tars/servant/testapp/impl/HelloServantImpl.java
@@ -20,7 +20,7 @@ package org.apache.shenyu.examples.tars.servant.testapp.impl;
import com.qq.tars.spring.annotation.TarsServant;
import org.apache.shenyu.client.tars.common.annotation.ShenyuTarsClient;
import org.apache.shenyu.client.tars.common.annotation.ShenyuTarsService;
-import org.apache.shenyu.examples.tars.aop.Log;
+import org.apache.shenyu.examples.common.aop.Log;
import org.apache.shenyu.examples.tars.servant.testapp.HelloServant;
@TarsServant("HelloObj")
diff --git a/shenyu-examples/shenyu-examples-tars/src/main/java/org/apache/shenyu/examples/tars/servant/testapp/impl/OrderServantImpl.java b/shenyu-examples/shenyu-examples-tars/src/main/java/org/apache/shenyu/examples/tars/servant/testapp/impl/OrderServantImpl.java
index efcae6364..2a1b4ac6c 100644
--- a/shenyu-examples/shenyu-examples-tars/src/main/java/org/apache/shenyu/examples/tars/servant/testapp/impl/OrderServantImpl.java
+++ b/shenyu-examples/shenyu-examples-tars/src/main/java/org/apache/shenyu/examples/tars/servant/testapp/impl/OrderServantImpl.java
@@ -20,7 +20,6 @@ package org.apache.shenyu.examples.tars.servant.testapp.impl;
import com.qq.tars.spring.annotation.TarsServant;
import org.apache.shenyu.client.tars.common.annotation.ShenyuTarsClient;
import org.apache.shenyu.client.tars.common.annotation.ShenyuTarsService;
-import org.apache.shenyu.examples.tars.aop.Log;
import org.apache.shenyu.examples.tars.servant.testapp.OrderServant;
@TarsServant("OrderObj")
@@ -34,7 +33,6 @@ public class OrderServantImpl implements OrderServant {
return String.format("hello no=%s, name=%s, time=%s", no, name, System.currentTimeMillis());
}
- @Log
@Override
@ShenyuTarsClient("/helloInt")
public int helloInt(final int no, final String name) {
diff --git a/shenyu-examples/shenyu-examples-tars/src/main/java/org/apache/shenyu/examples/tars/servant/testapp/impl/UserServantImpl.java b/shenyu-examples/shenyu-examples-tars/src/main/java/org/apache/shenyu/examples/tars/servant/testapp/impl/UserServantImpl.java
index 1840999d5..f204d77d0 100644
--- a/shenyu-examples/shenyu-examples-tars/src/main/java/org/apache/shenyu/examples/tars/servant/testapp/impl/UserServantImpl.java
+++ b/shenyu-examples/shenyu-examples-tars/src/main/java/org/apache/shenyu/examples/tars/servant/testapp/impl/UserServantImpl.java
@@ -20,7 +20,6 @@ package org.apache.shenyu.examples.tars.servant.testapp.impl;
import com.qq.tars.spring.annotation.TarsServant;
import org.apache.shenyu.client.tars.common.annotation.ShenyuTarsClient;
import org.apache.shenyu.client.tars.common.annotation.ShenyuTarsService;
-import org.apache.shenyu.examples.tars.aop.Log;
import org.apache.shenyu.examples.tars.servant.testapp.UserServant;
@TarsServant("UserObj")
@@ -33,7 +32,6 @@ public class UserServantImpl implements UserServant {
return String.format("hello no=%s, name=%s, time=%s", no, name, System.currentTimeMillis());
}
- @Log
@Override
public int helloInt(final int no, final String name) {
return 1;
diff --git a/shenyu-examples/shenyu-examples-websocket/pom.xml b/shenyu-examples/shenyu-examples-websocket/pom.xml
index c15be6081..b35a9f2b7 100644
--- a/shenyu-examples/shenyu-examples-websocket/pom.xml
+++ b/shenyu-examples/shenyu-examples-websocket/pom.xml
@@ -34,5 +34,13 @@
<module>shenyu-example-spring-reactive-websocket</module>
</modules>
-
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.shenyu</groupId>
+ <artifactId>shenyu-examples-common</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
</project>
\ No newline at end of file
diff --git a/shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-native-websocket/pom.xml b/shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-native-websocket/pom.xml
index be2d201b6..4ad34e74e 100644
--- a/shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-native-websocket/pom.xml
+++ b/shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-native-websocket/pom.xml
@@ -49,8 +49,8 @@
<artifactId>spring-boot-starter-websocket</artifactId>
</dependency>
<dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-aop</artifactId>
+ <groupId>org.apache.shenyu</groupId>
+ <artifactId>shenyu-examples-common</artifactId>
</dependency>
<dependency>
diff --git a/shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-native-websocket/src/main/java/org/apache/shenyu/examples/websocket/aop/Log.java b/shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-native-websocket/src/main/java/org/apache/shenyu/examples/websocket/aop/Log.java
deleted file mode 100644
index e90533302..000000000
--- a/shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-native-websocket/src/main/java/org/apache/shenyu/examples/websocket/aop/Log.java
+++ /dev/null
@@ -1,30 +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 org.apache.shenyu.examples.websocket.aop;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Target({ElementType.TYPE, ElementType.METHOD})
-@Retention(RetentionPolicy.RUNTIME)
-@Documented
-public @interface Log {
-}
diff --git a/shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-native-websocket/src/main/java/org/apache/shenyu/examples/websocket/aop/LogInterceptor.java b/shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-native-websocket/src/main/java/org/apache/shenyu/examples/websocket/aop/LogInterceptor.java
deleted file mode 100644
index 3a0af1bce..000000000
--- a/shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-native-websocket/src/main/java/org/apache/shenyu/examples/websocket/aop/LogInterceptor.java
+++ /dev/null
@@ -1,48 +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 org.apache.shenyu.examples.websocket.aop;
-
-import org.aspectj.lang.ProceedingJoinPoint;
-import org.aspectj.lang.annotation.Around;
-import org.aspectj.lang.annotation.Aspect;
-import org.aspectj.lang.annotation.Pointcut;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Component;
-
-@Aspect
-@Component
-public class LogInterceptor {
-
- private static final Logger log = LoggerFactory.getLogger(LogInterceptor.class);
-
- @Pointcut("@annotation(org.apache.shenyu.examples.websocket.aop.Log)")
- public void logPointcut() {
- //just for pointcut
- }
-
- @Around("logPointcut()")
- public Object around(ProceedingJoinPoint point) throws Throwable {
- try {
- log.info("before proceed");
- return point.proceed(point.getArgs());
- } finally {
- log.info("after proceed");
- }
- }
-}
diff --git a/shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-native-websocket/src/main/java/org/apache/shenyu/examples/websocket/controller/TestHttpController.java b/shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-native-websocket/src/main/java/org/apache/shenyu/examples/websocket/controller/TestHttpController.java
index aef2dbe9c..510cb1668 100644
--- a/shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-native-websocket/src/main/java/org/apache/shenyu/examples/websocket/controller/TestHttpController.java
+++ b/shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-native-websocket/src/main/java/org/apache/shenyu/examples/websocket/controller/TestHttpController.java
@@ -18,7 +18,7 @@
package org.apache.shenyu.examples.websocket.controller;
import org.apache.shenyu.client.springmvc.annotation.ShenyuSpringMvcClient;
-import org.apache.shenyu.examples.websocket.aop.Log;
+import org.apache.shenyu.examples.common.aop.Log;
import org.apache.shenyu.examples.websocket.config.WsSessionManager;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
diff --git a/shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-reactive-websocket/pom.xml b/shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-reactive-websocket/pom.xml
index 4fabc47ee..bd04e76a9 100644
--- a/shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-reactive-websocket/pom.xml
+++ b/shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-reactive-websocket/pom.xml
@@ -62,8 +62,8 @@
</dependency>
<dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-aop</artifactId>
+ <groupId>org.apache.shenyu</groupId>
+ <artifactId>shenyu-examples-common</artifactId>
</dependency>
<dependency>
diff --git a/shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-reactive-websocket/src/main/java/org/apache/shenyu/examples/websocket/aop/Log.java b/shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-reactive-websocket/src/main/java/org/apache/shenyu/examples/websocket/aop/Log.java
deleted file mode 100644
index e90533302..000000000
--- a/shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-reactive-websocket/src/main/java/org/apache/shenyu/examples/websocket/aop/Log.java
+++ /dev/null
@@ -1,30 +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 org.apache.shenyu.examples.websocket.aop;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Target({ElementType.TYPE, ElementType.METHOD})
-@Retention(RetentionPolicy.RUNTIME)
-@Documented
-public @interface Log {
-}
diff --git a/shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-reactive-websocket/src/main/java/org/apache/shenyu/examples/websocket/aop/LogInterceptor.java b/shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-reactive-websocket/src/main/java/org/apache/shenyu/examples/websocket/aop/LogInterceptor.java
deleted file mode 100644
index 3a0af1bce..000000000
--- a/shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-reactive-websocket/src/main/java/org/apache/shenyu/examples/websocket/aop/LogInterceptor.java
+++ /dev/null
@@ -1,48 +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 org.apache.shenyu.examples.websocket.aop;
-
-import org.aspectj.lang.ProceedingJoinPoint;
-import org.aspectj.lang.annotation.Around;
-import org.aspectj.lang.annotation.Aspect;
-import org.aspectj.lang.annotation.Pointcut;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Component;
-
-@Aspect
-@Component
-public class LogInterceptor {
-
- private static final Logger log = LoggerFactory.getLogger(LogInterceptor.class);
-
- @Pointcut("@annotation(org.apache.shenyu.examples.websocket.aop.Log)")
- public void logPointcut() {
- //just for pointcut
- }
-
- @Around("logPointcut()")
- public Object around(ProceedingJoinPoint point) throws Throwable {
- try {
- log.info("before proceed");
- return point.proceed(point.getArgs());
- } finally {
- log.info("after proceed");
- }
- }
-}
diff --git a/shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-reactive-websocket/src/main/java/org/apache/shenyu/examples/websocket/handler/EchoHandler.java b/shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-reactive-websocket/src/main/java/org/apache/shenyu/examples/websocket/handler/EchoHandler.java
index 263718e01..40b6864c7 100644
--- a/shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-reactive-websocket/src/main/java/org/apache/shenyu/examples/websocket/handler/EchoHandler.java
+++ b/shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-reactive-websocket/src/main/java/org/apache/shenyu/examples/websocket/handler/EchoHandler.java
@@ -17,7 +17,7 @@
package org.apache.shenyu.examples.websocket.handler;
-import org.apache.shenyu.examples.websocket.aop.Log;
+import org.apache.shenyu.examples.common.aop.Log;
import org.springframework.lang.NonNull;
import org.springframework.stereotype.Component;
import org.springframework.web.reactive.socket.WebSocketHandler;
diff --git a/shenyu-integrated-test/shenyu-integrated-test-combination/src/main/java/org/apache/shenyu/integrated/test/combination/dto/SofaTestData.java b/shenyu-integrated-test/shenyu-integrated-test-combination/src/main/java/org/apache/shenyu/integrated/test/combination/dto/SofaTestData.java
deleted file mode 100644
index 5f4f10a21..000000000
--- a/shenyu-integrated-test/shenyu-integrated-test-combination/src/main/java/org/apache/shenyu/integrated/test/combination/dto/SofaTestData.java
+++ /dev/null
@@ -1,51 +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 org.apache.shenyu.integrated.test.combination.dto;
-
-public class SofaTestData {
-
- private String id;
-
- private String name;
-
- /**
- * get id.
- *
- * @return id
- */
- public String getId() {
- return id;
- }
-
- /**
- * get name.
- *
- * @return name
- */
- public String getName() {
- return name;
- }
-
- @Override
- public String toString() {
- return "SofaTest{"
- + "id='" + id + '\''
- + ", name='" + name + '\''
- + '}';
- }
-}
diff --git a/shenyu-integrated-test/shenyu-integrated-test-combination/src/test/java/org/apache/shenyu/integrated/test/combination/SharedThreadPoolTest.java b/shenyu-integrated-test/shenyu-integrated-test-combination/src/test/java/org/apache/shenyu/integrated/test/combination/SharedThreadPoolTest.java
index 457624246..a5a2d2725 100644
--- a/shenyu-integrated-test/shenyu-integrated-test-combination/src/test/java/org/apache/shenyu/integrated/test/combination/SharedThreadPoolTest.java
+++ b/shenyu-integrated-test/shenyu-integrated-test-combination/src/test/java/org/apache/shenyu/integrated/test/combination/SharedThreadPoolTest.java
@@ -22,13 +22,11 @@ import com.google.gson.JsonObject;
import com.google.gson.reflect.TypeToken;
import org.apache.shenyu.common.enums.PluginEnum;
import org.apache.shenyu.common.utils.GsonUtils;
-import org.apache.shenyu.integrated.test.combination.dto.SofaTestData;
import org.apache.shenyu.integratedtest.common.AbstractPluginDataInit;
import org.apache.shenyu.integratedtest.common.dto.DubboTest;
import org.apache.shenyu.integratedtest.common.dto.MotanDTO;
import org.apache.shenyu.integratedtest.common.helper.HttpHelper;
import org.hamcrest.Matchers;
-import org.hamcrest.core.Is;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
@@ -95,18 +93,6 @@ public class SharedThreadPoolTest extends AbstractPluginDataInit {
assertEquals("hello shenyu", response);
}
- @Test
- public void testSofa() {
- try {
- SofaTestData response = HttpHelper.INSTANCE.getFromGateway("/sofa/findById?id=1001", new TypeToken<SofaTestData>() {
- }.getType());
- assertThat(response.getName(), Is.is("hello world shenyu Sofa, findById"));
- assertThat(response.getId(), Is.is("1001"));
- } catch (Throwable e) {
- LOG.error("testSofa failed !", e);
- }
- }
-
@AfterAll
public static void testIsOneThreadPool() throws IOException {
String spring = HttpHelper.INSTANCE.getFromGateway("/shenyu/getFromSpring", String.class);
@@ -116,11 +102,5 @@ public class SharedThreadPoolTest extends AbstractPluginDataInit {
assertEquals(spring, grpc);
String motan = HttpHelper.INSTANCE.getFromGateway("/shenyu/getFromMotan", String.class);
assertEquals(spring, motan);
- try {
- String sofa = HttpHelper.INSTANCE.getFromGateway("/shenyu/getFromSofa", String.class);
- assertEquals(spring, sofa);
- } catch (Throwable e) {
- LOG.error("testIsOneThreadPool sofa failed !", e);
- }
}
}