forked from opengoofy/hippo4j
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support dubboX from demand opengoofy#624 (opengoofy#988)
* support dubboX from demand opengoofy#624 * dubboX rename to dubbox * fix version reference
- Loading branch information
Showing
8 changed files
with
124 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>cn.hippo4j</groupId> | ||
<artifactId>hippo4j-adapter</artifactId> | ||
<version>${revision}</version> | ||
</parent> | ||
<artifactId>hippo4j-adapter-dubbox</artifactId> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>cn.hippo4j</groupId> | ||
<artifactId>hippo4j-adapter-dubbo</artifactId> | ||
<version>${revision}</version> | ||
</dependency> | ||
</dependencies> | ||
</project> |
32 changes: 32 additions & 0 deletions
32
...ippo4j-adapter-dubbox/src/main/java/cn/hippo4j/adapter/dubbo/DubboxThreadPoolAdapter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* 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 cn.hippo4j.adapter.dubbo; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
|
||
/** | ||
* Dubbox thread-pool adapter. | ||
*/ | ||
@Slf4j | ||
public class DubboxThreadPoolAdapter extends DubboThreadPoolAdapter{ | ||
|
||
@Override | ||
public String mark() { | ||
return "Dubbox"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...ot/hippo4j-spring-boot-starter-adapter/hippo4j-spring-boot-starter-adapter-dubbox/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>cn.hippo4j</groupId> | ||
<artifactId>hippo4j-spring-boot-starter-adapter</artifactId> | ||
<version>${revision}</version> | ||
</parent> | ||
<artifactId>hippo4j-spring-boot-starter-adapter-dubbox</artifactId> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>cn.hippo4j</groupId> | ||
<artifactId>hippo4j-adapter-dubbox</artifactId> | ||
<version>${revision}</version> | ||
</dependency> | ||
</dependencies> | ||
</project> |
46 changes: 46 additions & 0 deletions
46
...main/java/cn/hippo4j/springboot/starter/adapter/dubbo/DubboxAdapterAutoConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* 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 cn.hippo4j.springboot.starter.adapter.dubbo; | ||
|
||
import cn.hippo4j.adapter.dubbo.DubboThreadPoolAdapter; | ||
import cn.hippo4j.adapter.dubbo.DubboxThreadPoolAdapter; | ||
import cn.hippo4j.common.config.ApplicationContextHolder; | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
/** | ||
* Dubbox adapter auto configuration. | ||
*/ | ||
@Configuration | ||
public class DubboxAdapterAutoConfiguration { | ||
|
||
@Bean | ||
@ConditionalOnMissingBean | ||
public ApplicationContextHolder simpleApplicationContextHolder() { | ||
return new ApplicationContextHolder(); | ||
} | ||
|
||
@Bean | ||
@SuppressWarnings("all") | ||
@ConditionalOnProperty(name = "dubbo.application.name") | ||
public DubboThreadPoolAdapter dubboThreadPoolAdapter(ApplicationContextHolder applicationContextHolder) { | ||
return new DubboxThreadPoolAdapter(); | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
...r/hippo4j-spring-boot-starter-adapter-dubbox/src/main/resources/META-INF/spring.factories
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=cn.hippo4j.springboot.starter.adapter.dubbo.DubboxAdapterAutoConfiguration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters