This is an automated email from the ASF dual-hosted git repository.
earthchen pushed a commit to branch 3.3
in repository https://gitbox.apache.org/repos/asf/dubbo.git
The following commit(s) were added to refs/heads/3.3 by this push:
new 60a3c3fc3e Remove old style Dubbo3Generator (#14595)
60a3c3fc3e is described below
commit 60a3c3fc3eca329ddd1b214ce43df67ed5632afb
Author: Albumen Kevin <[email protected]>
AuthorDate: Tue Aug 27 13:05:54 2024 +0800
Remove old style Dubbo3Generator (#14595)
---
.../plugin/protoc/enums/DubboGenerateTypeEnum.java | 1 -
.../apache/dubbo/gen/dubbo/Dubbo3Generator.java | 57 -------------
.../main/resources/Dubbo3InterfaceStub.mustache | 76 -----------------
.../src/main/resources/Dubbo3Stub.mustache | 33 --------
.../src/main/resources/DubboStub3Single.mustache | 95 ----------------------
5 files changed, 262 deletions(-)
diff --git
a/dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/protoc/enums/DubboGenerateTypeEnum.java
b/dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/protoc/enums/DubboGenerateTypeEnum.java
index 2b8a62cb92..d04c983d12 100644
---
a/dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/protoc/enums/DubboGenerateTypeEnum.java
+++
b/dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/protoc/enums/DubboGenerateTypeEnum.java
@@ -17,7 +17,6 @@
package org.apache.dubbo.maven.plugin.protoc.enums;
public enum DubboGenerateTypeEnum {
- Dubbo3("dubbo3", "org.apache.dubbo.gen.dubbo.Dubbo3Generator"),
Tri("tri", "org.apache.dubbo.gen.tri.Dubbo3TripleGenerator"),
Tri_reactor("tri_reactor",
"org.apache.dubbo.gen.tri.reactive.ReactorDubbo3TripleGenerator"),
;
diff --git
a/dubbo-plugin/dubbo-compiler/src/main/java/org/apache/dubbo/gen/dubbo/Dubbo3Generator.java
b/dubbo-plugin/dubbo-compiler/src/main/java/org/apache/dubbo/gen/dubbo/Dubbo3Generator.java
deleted file mode 100644
index d882c7fbee..0000000000
---
a/dubbo-plugin/dubbo-compiler/src/main/java/org/apache/dubbo/gen/dubbo/Dubbo3Generator.java
+++ /dev/null
@@ -1,57 +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.dubbo.gen.dubbo;
-
-import org.apache.dubbo.gen.AbstractGenerator;
-import org.apache.dubbo.gen.DubboGeneratorPlugin;
-
-public class Dubbo3Generator extends AbstractGenerator {
-
- public static void main(String[] args) {
- DubboGeneratorPlugin.generate(new Dubbo3Generator());
- }
-
- @Override
- protected String getClassPrefix() {
- return "";
- }
-
- @Override
- protected String getClassSuffix() {
- return "Dubbo";
- }
-
- @Override
- protected String getTemplateFileName() {
- return "Dubbo3Stub.mustache";
- }
-
- @Override
- protected String getInterfaceTemplateFileName() {
- return "Dubbo3InterfaceStub.mustache";
- }
-
- @Override
- protected String getSingleTemplateFileName() {
- return "DubboStub3Single.mustache";
- }
-
- @Override
- protected boolean enableMultipleTemplateFiles() {
- return true;
- }
-}
diff --git
a/dubbo-plugin/dubbo-compiler/src/main/resources/Dubbo3InterfaceStub.mustache
b/dubbo-plugin/dubbo-compiler/src/main/resources/Dubbo3InterfaceStub.mustache
deleted file mode 100644
index 15172691bf..0000000000
---
a/dubbo-plugin/dubbo-compiler/src/main/resources/Dubbo3InterfaceStub.mustache
+++ /dev/null
@@ -1,76 +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.
-*/
-
-{{#packageName}}
-package {{packageName}};
-{{/packageName}}
-
-import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-{{#deprecated}}
[email protected]
-{{/deprecated}}
-public interface {{interfaceClassName}} extends
org.apache.dubbo.rpc.model.DubboStub {
-
- static final String JAVA_SERVICE_NAME = "{{packageName}}.{{serviceName}}";
-{{#commonPackageName}}
- static final String SERVICE_NAME = "{{commonPackageName}}.{{serviceName}}";
-{{/commonPackageName}}
-{{^commonPackageName}}
- static final String SERVICE_NAME = "{{serviceName}}";
-{{/commonPackageName}}
-
- // FIXME, initialize Dubbo3 stub when interface loaded, thinking of new
ways doing this.
- static final boolean inited = {{className}}.init();
-
-{{#unaryMethods}}
- {{#javaDoc}}
- {{{javaDoc}}}
- {{/javaDoc}}
- {{#deprecated}}
- @java.lang.Deprecated
- {{/deprecated}}
- {{outputType}} {{methodName}}({{inputType}} request);
-
- default CompletableFuture<{{outputType}}>
{{methodName}}Async({{inputType}} request){
- return CompletableFuture.supplyAsync(() -> {{methodName}}(request));
- }
-
-{{/unaryMethods}}
-
-{{#serverStreamingMethods}}
- {{#javaDoc}}
- {{{javaDoc}}}
- {{/javaDoc}}
- {{#deprecated}}
- @java.lang.Deprecated
- {{/deprecated}}
- void {{methodName}}({{inputType}} request,
org.apache.dubbo.common.stream.StreamObserver<{{outputType}}> responseObserver);
-{{/serverStreamingMethods}}
-
-{{#biStreamingMethods}}
- {{#javaDoc}}
- {{{javaDoc}}}
- {{/javaDoc}}
- {{#deprecated}}
- @java.lang.Deprecated
- {{/deprecated}}
- org.apache.dubbo.common.stream.StreamObserver<{{inputType}}>
{{methodName}}(org.apache.dubbo.common.stream.StreamObserver<{{outputType}}>
responseObserver);
-{{/biStreamingMethods}}
-
-}
diff --git a/dubbo-plugin/dubbo-compiler/src/main/resources/Dubbo3Stub.mustache
b/dubbo-plugin/dubbo-compiler/src/main/resources/Dubbo3Stub.mustache
deleted file mode 100644
index 684b19ca83..0000000000
--- a/dubbo-plugin/dubbo-compiler/src/main/resources/Dubbo3Stub.mustache
+++ /dev/null
@@ -1,33 +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.
-*/
-
-{{#packageName}}
- package {{packageName}};
-{{/packageName}}
-
-{{#deprecated}}
- @java.lang.Deprecated
-{{/deprecated}}
-public final class {{className}} {
-
-public static boolean init() {
- return true;
-}
-
-private {{className}}() {}
-
-}
diff --git
a/dubbo-plugin/dubbo-compiler/src/main/resources/DubboStub3Single.mustache
b/dubbo-plugin/dubbo-compiler/src/main/resources/DubboStub3Single.mustache
deleted file mode 100644
index b46653b488..0000000000
--- a/dubbo-plugin/dubbo-compiler/src/main/resources/DubboStub3Single.mustache
+++ /dev/null
@@ -1,95 +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.
-*/
-
-{{#packageName}}
- package {{packageName}};
-{{/packageName}}
-
-import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-{{#deprecated}}
- @java.lang.Deprecated
-{{/deprecated}}
-public final class {{className}} {
-private static final AtomicBoolean registered = new AtomicBoolean();
-
-private static Class<?> init() {
- Class<?> clazz = null;
- try {
- clazz = Class.forName({{serviceName}}Dubbo.class.getName());
- if (registered.compareAndSet(false, true)) {
- {{#methodTypes}}
-
org.apache.dubbo.rpc.protocol.tri.SingleProtobufUtils.marshaller(
- {{.}}.getDefaultInstance());
- {{/methodTypes}}
- }
- } catch (ClassNotFoundException e) {
- // ignore
- }
- return clazz;
-}
-
-private {{serviceName}}Dubbo() {}
-
-public static final String SERVICE_NAME = "{{packageName}}.{{serviceName}}";
-
-/**
-* Code generated for Dubbo
-*/
-public interface I{{serviceName}} extends org.apache.dubbo.rpc.model.DubboStub
{
-
- static Class<?> clazz = init();
-
-{{#unaryMethods}}
- {{#javaDoc}}
- {{{javaDoc}}}
- {{/javaDoc}}
- {{#deprecated}}
- @java.lang.Deprecated
- {{/deprecated}}
- {{outputType}} {{methodName}}({{inputType}} request);
-
- default CompletableFuture<{{outputType}}>
{{methodName}}Async({{inputType}} request){
- return CompletableFuture.supplyAsync(() -> {{methodName}}(request));
- }
-
-{{/unaryMethods}}
-
-{{#serverStreamingMethods}}
- {{#javaDoc}}
- {{{javaDoc}}}
- {{/javaDoc}}
- {{#deprecated}}
- @java.lang.Deprecated
- {{/deprecated}}
- void {{methodName}}({{inputType}} request,
org.apache.dubbo.common.stream.StreamObserver<{{outputType}}> responseObserver);
-{{/serverStreamingMethods}}
-
-{{#biStreamingMethods}}
- {{#javaDoc}}
- {{{javaDoc}}}
- {{/javaDoc}}
- {{#deprecated}}
- @java.lang.Deprecated
- {{/deprecated}}
- org.apache.dubbo.common.stream.StreamObserver<{{inputType}}>
{{methodName}}(org.apache.dubbo.common.stream.StreamObserver<{{outputType}}>
responseObserver);
-{{/biStreamingMethods}}
-
-}
-
-}