- * Sends a greeting - *- */ - public org.apache.dubbo.rpc.protocol.grpc.support.HelloReply sayHello( - org.apache.dubbo.rpc.protocol.grpc.support.HelloRequest request) { - return blockingStub - .withDeadlineAfter(url.getParameter(TIMEOUT_KEY, DEFAULT_TIMEOUT), TimeUnit.MILLISECONDS) - .sayHello(request); - } - - public com.google.common.util.concurrent.ListenableFuture
- * Sends a greeting - *- */ - default public org.apache.dubbo.rpc.protocol.grpc.support.HelloReply sayHello( - org.apache.dubbo.rpc.protocol.grpc.support.HelloRequest request) { - throw new UnsupportedOperationException( - "No need to override this method, extend XxxImplBase and override all methods it allows."); - } - - /** - *
- * Sends a greeting - *- */ - default public com.google.common.util.concurrent.ListenableFuture
- * Sends a greeting - *- */ - public void sayHello(org.apache.dubbo.rpc.protocol.grpc.support.HelloRequest request, - io.grpc.stub.StreamObserver
- * The greeting service definition. - *- */ - public static abstract class GreeterImplBase implements io.grpc.BindableService, IGreeter { - - private IGreeter proxiedImpl; - - public final void setProxiedImpl(IGreeter proxiedImpl) { - this.proxiedImpl = proxiedImpl; - } - - /** - *
- * Sends a greeting - *- */ - @Override - public final org.apache.dubbo.rpc.protocol.grpc.support.HelloReply sayHello( - org.apache.dubbo.rpc.protocol.grpc.support.HelloRequest request) { - throw new UnsupportedOperationException( - "No need to override this method, extend XxxImplBase and override all methods it allows."); - } - - /** - *
- * Sends a greeting - *- */ - @Override - public final com.google.common.util.concurrent.ListenableFuture
- * The greeting service definition. - *- */ -@javax.annotation.Generated( - value = "by gRPC proto compiler (version 1.34.1)", - comments = "Source: helloworld.proto") -public final class GreeterGrpc { - - private GreeterGrpc() { - } - - public static final String SERVICE_NAME = "helloworld.Greeter"; - - // Static method descriptors that strictly reflect the proto. - private static volatile io.grpc.MethodDescriptor
- * The greeting service definition. - *- */ - public static abstract class GreeterImplBase implements io.grpc.BindableService { - - /** - *
- * Sends a greeting - *- */ - public void sayHello(org.apache.dubbo.rpc.protocol.grpc.support.HelloRequest request, - io.grpc.stub.StreamObserver
- * The greeting service definition. - *- */ - public static final class GreeterStub extends io.grpc.stub.AbstractAsyncStub
- * Sends a greeting - *- */ - public void sayHello(org.apache.dubbo.rpc.protocol.grpc.support.HelloRequest request, - io.grpc.stub.StreamObserver
- * The greeting service definition. - *- */ - public static final class GreeterBlockingStub extends io.grpc.stub.AbstractBlockingStub
- * Sends a greeting - *- */ - public org.apache.dubbo.rpc.protocol.grpc.support.HelloReply sayHello( - org.apache.dubbo.rpc.protocol.grpc.support.HelloRequest request) { - return blockingUnaryCall( - getChannel(), getSayHelloMethod(), getCallOptions(), request); - } - } - - /** - *
- * The greeting service definition. - *- */ - public static final class GreeterFutureStub extends io.grpc.stub.AbstractFutureStub
- * Sends a greeting - *- */ - public com.google.common.util.concurrent.ListenableFuture
- * The response message containing the greetings - *- *
- * Protobuf type {@code helloworld.HelloReply}
- */
-public final class HelloReply extends
- com.google.protobuf.GeneratedMessageV3 implements
- // @@protoc_insertion_point(message_implements:helloworld.HelloReply)
- HelloReplyOrBuilder {
- private static final long serialVersionUID = 0L;
-
- // Use HelloReply.newBuilder() to construct.
- private HelloReply(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
- super(builder);
- }
-
- private HelloReply() {
- message_ = "";
- }
-
- @Override
- public final com.google.protobuf.UnknownFieldSet
- getUnknownFields() {
- return this.unknownFields;
- }
-
- private HelloReply(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- this();
- if (extensionRegistry == null) {
- throw new NullPointerException();
- }
- int mutable_bitField0_ = 0;
- com.google.protobuf.UnknownFieldSet.Builder unknownFields =
- com.google.protobuf.UnknownFieldSet.newBuilder();
- try {
- boolean done = false;
- while (!done) {
- int tag = input.readTag();
- switch (tag) {
- case 0:
- done = true;
- break;
- case 10: {
- String s = input.readStringRequireUtf8();
-
- message_ = s;
- break;
- }
- default: {
- if (!parseUnknownField(
- input, unknownFields, extensionRegistry, tag)) {
- done = true;
- }
- break;
- }
- }
- }
- } catch (com.google.protobuf.InvalidProtocolBufferException e) {
- throw e.setUnfinishedMessage(this);
- } catch (java.io.IOException e) {
- throw new com.google.protobuf.InvalidProtocolBufferException(
- e).setUnfinishedMessage(this);
- } finally {
- this.unknownFields = unknownFields.build();
- makeExtensionsImmutable();
- }
- }
-
- public static final com.google.protobuf.Descriptors.Descriptor
- getDescriptor() {
- return HelloWorldProto.internal_static_helloworld_HelloReply_descriptor;
- }
-
- @Override
- protected FieldAccessorTable
- internalGetFieldAccessorTable() {
- return HelloWorldProto.internal_static_helloworld_HelloReply_fieldAccessorTable
- .ensureFieldAccessorsInitialized(
- HelloReply.class, Builder.class);
- }
-
- public static final int MESSAGE_FIELD_NUMBER = 1;
- private volatile Object message_;
-
- /**
- * string message = 1;
- */
- public String getMessage() {
- Object ref = message_;
- if (ref instanceof String) {
- return (String) ref;
- } else {
- com.google.protobuf.ByteString bs =
- (com.google.protobuf.ByteString) ref;
- String s = bs.toStringUtf8();
- message_ = s;
- return s;
- }
- }
-
- /**
- * string message = 1;
- */
- public com.google.protobuf.ByteString
- getMessageBytes() {
- Object ref = message_;
- if (ref instanceof String) {
- com.google.protobuf.ByteString b =
- com.google.protobuf.ByteString.copyFromUtf8(
- (String) ref);
- message_ = b;
- return b;
- } else {
- return (com.google.protobuf.ByteString) ref;
- }
- }
-
- private byte memoizedIsInitialized = -1;
-
- @Override
- public final boolean isInitialized() {
- byte isInitialized = memoizedIsInitialized;
- if (isInitialized == 1) {
- return true;
- }
- if (isInitialized == 0) {
- return false;
- }
-
- memoizedIsInitialized = 1;
- return true;
- }
-
- @Override
- public void writeTo(com.google.protobuf.CodedOutputStream output)
- throws java.io.IOException {
- if (!getMessageBytes().isEmpty()) {
- com.google.protobuf.GeneratedMessageV3.writeString(output, 1, message_);
- }
- unknownFields.writeTo(output);
- }
-
- @Override
- public int getSerializedSize() {
- int size = memoizedSize;
- if (size != -1) {
- return size;
- }
-
- size = 0;
- if (!getMessageBytes().isEmpty()) {
- size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, message_);
- }
- size += unknownFields.getSerializedSize();
- memoizedSize = size;
- return size;
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (obj == this) {
- return true;
- }
- if (!(obj instanceof HelloReply)) {
- return super.equals(obj);
- }
- HelloReply other = (HelloReply) obj;
-
- if (!getMessage()
- .equals(other.getMessage())) {
- return false;
- }
- if (!unknownFields.equals(other.unknownFields)) {
- return false;
- }
- return true;
- }
-
- @Override
- public int hashCode() {
- if (memoizedHashCode != 0) {
- return memoizedHashCode;
- }
- int hash = 41;
- hash = (19 * hash) + getDescriptor().hashCode();
- hash = (37 * hash) + MESSAGE_FIELD_NUMBER;
- hash = (53 * hash) + getMessage().hashCode();
- hash = (29 * hash) + unknownFields.hashCode();
- memoizedHashCode = hash;
- return hash;
- }
-
- public static HelloReply parseFrom(
- java.nio.ByteBuffer data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
-
- public static HelloReply parseFrom(
- java.nio.ByteBuffer data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
-
- public static HelloReply parseFrom(
- com.google.protobuf.ByteString data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
-
- public static HelloReply parseFrom(
- com.google.protobuf.ByteString data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
-
- public static HelloReply parseFrom(byte[] data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
-
- public static HelloReply parseFrom(
- byte[] data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
-
- public static HelloReply parseFrom(java.io.InputStream input)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input);
- }
-
- public static HelloReply parseFrom(
- java.io.InputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input, extensionRegistry);
- }
-
- public static HelloReply parseDelimitedFrom(java.io.InputStream input)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseDelimitedWithIOException(PARSER, input);
- }
-
- public static HelloReply parseDelimitedFrom(
- java.io.InputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
- }
-
- public static HelloReply parseFrom(
- com.google.protobuf.CodedInputStream input)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input);
- }
-
- public static HelloReply parseFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input, extensionRegistry);
- }
-
- @Override
- public Builder newBuilderForType() {
- return newBuilder();
- }
-
- public static Builder newBuilder() {
- return DEFAULT_INSTANCE.toBuilder();
- }
-
- public static Builder newBuilder(HelloReply prototype) {
- return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
- }
-
- @Override
- public Builder toBuilder() {
- return this == DEFAULT_INSTANCE
- ? new Builder() : new Builder().mergeFrom(this);
- }
-
- @Override
- protected Builder newBuilderForType(
- BuilderParent parent) {
- Builder builder = new Builder(parent);
- return builder;
- }
-
- /**
- *
- * The response message containing the greetings - *- *
- * Protobuf type {@code helloworld.HelloReply}
- */
- public static final class Builder extends
- com.google.protobuf.GeneratedMessageV3.Builder
- * Protobuf type {@code helloworld.HelloRequest}
- */
-public final class HelloRequest extends
- com.google.protobuf.GeneratedMessageV3 implements
- // @@protoc_insertion_point(message_implements:helloworld.HelloRequest)
- HelloRequestOrBuilder {
- private static final long serialVersionUID = 0L;
-
- // Use HelloRequest.newBuilder() to construct.
- private HelloRequest(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
- super(builder);
- }
-
- private HelloRequest() {
- name_ = "";
- }
-
- @Override
- public final com.google.protobuf.UnknownFieldSet
- getUnknownFields() {
- return this.unknownFields;
- }
-
- private HelloRequest(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- this();
- if (extensionRegistry == null) {
- throw new NullPointerException();
- }
- int mutable_bitField0_ = 0;
- com.google.protobuf.UnknownFieldSet.Builder unknownFields =
- com.google.protobuf.UnknownFieldSet.newBuilder();
- try {
- boolean done = false;
- while (!done) {
- int tag = input.readTag();
- switch (tag) {
- case 0:
- done = true;
- break;
- case 10: {
- String s = input.readStringRequireUtf8();
-
- name_ = s;
- break;
- }
- default: {
- if (!parseUnknownField(
- input, unknownFields, extensionRegistry, tag)) {
- done = true;
- }
- break;
- }
- }
- }
- } catch (com.google.protobuf.InvalidProtocolBufferException e) {
- throw e.setUnfinishedMessage(this);
- } catch (java.io.IOException e) {
- throw new com.google.protobuf.InvalidProtocolBufferException(
- e).setUnfinishedMessage(this);
- } finally {
- this.unknownFields = unknownFields.build();
- makeExtensionsImmutable();
- }
- }
-
- public static final com.google.protobuf.Descriptors.Descriptor
- getDescriptor() {
- return org.apache.dubbo.rpc.protocol.grpc.support.HelloWorldProto.internal_static_helloworld_HelloRequest_descriptor;
- }
-
- @Override
- protected FieldAccessorTable
- internalGetFieldAccessorTable() {
- return org.apache.dubbo.rpc.protocol.grpc.support.HelloWorldProto.internal_static_helloworld_HelloRequest_fieldAccessorTable
- .ensureFieldAccessorsInitialized(
- HelloRequest.class, Builder.class);
- }
-
- public static final int NAME_FIELD_NUMBER = 1;
- private volatile Object name_;
-
- /**
- *
- * Protobuf type {@code helloworld.HelloRequest}
- */
- public static final class Builder extends
- com.google.protobuf.GeneratedMessageV3.Builderstring message = 1;
- */
- public String getMessage() {
- Object ref = message_;
- if (!(ref instanceof String)) {
- com.google.protobuf.ByteString bs =
- (com.google.protobuf.ByteString) ref;
- String s = bs.toStringUtf8();
- message_ = s;
- return s;
- } else {
- return (String) ref;
- }
- }
-
- /**
- * string message = 1;
- */
- public com.google.protobuf.ByteString
- getMessageBytes() {
- Object ref = message_;
- if (ref instanceof String) {
- com.google.protobuf.ByteString b =
- com.google.protobuf.ByteString.copyFromUtf8(
- (String) ref);
- message_ = b;
- return b;
- } else {
- return (com.google.protobuf.ByteString) ref;
- }
- }
-
- /**
- * string message = 1;
- */
- public Builder setMessage(
- String value) {
- if (value == null) {
- throw new NullPointerException();
- }
-
- message_ = value;
- onChanged();
- return this;
- }
-
- /**
- * string message = 1;
- */
- public Builder clearMessage() {
-
- message_ = getDefaultInstance().getMessage();
- onChanged();
- return this;
- }
-
- /**
- * string message = 1;
- */
- public Builder setMessageBytes(
- com.google.protobuf.ByteString value) {
- if (value == null) {
- throw new NullPointerException();
- }
- checkByteStringIsUtf8(value);
-
- message_ = value;
- onChanged();
- return this;
- }
-
- @Override
- public final Builder setUnknownFields(
- final com.google.protobuf.UnknownFieldSet unknownFields) {
- return super.setUnknownFields(unknownFields);
- }
-
- @Override
- public final Builder mergeUnknownFields(
- final com.google.protobuf.UnknownFieldSet unknownFields) {
- return super.mergeUnknownFields(unknownFields);
- }
-
-
- // @@protoc_insertion_point(builder_scope:helloworld.HelloReply)
- }
-
- // @@protoc_insertion_point(class_scope:helloworld.HelloReply)
- private static final HelloReply DEFAULT_INSTANCE;
-
- static {
- DEFAULT_INSTANCE = new HelloReply();
- }
-
- public static HelloReply getDefaultInstance() {
- return DEFAULT_INSTANCE;
- }
-
- private static final com.google.protobuf.Parserstring message = 1;
- */
- String getMessage();
-
- /**
- * string message = 1;
- */
- com.google.protobuf.ByteString
- getMessageBytes();
-}
diff --git a/dubbo-rpc/dubbo-rpc-grpc/src/test/java/org/apache/dubbo/rpc/protocol/grpc/support/HelloRequest.java b/dubbo-rpc/dubbo-rpc-grpc/src/test/java/org/apache/dubbo/rpc/protocol/grpc/support/HelloRequest.java
deleted file mode 100644
index c97674ae14..0000000000
--- a/dubbo-rpc/dubbo-rpc-grpc/src/test/java/org/apache/dubbo/rpc/protocol/grpc/support/HelloRequest.java
+++ /dev/null
@@ -1,616 +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.
- */
-
-// Generated by the protocol buffer compiler. DO NOT EDIT!
-// source: helloworld.proto
-
-package org.apache.dubbo.rpc.protocol.grpc.support;
-
-/**
- *
- * The request message containing the user's name.
- *
- * string name = 1;
- */
- public String getName() {
- Object ref = name_;
- if (ref instanceof String) {
- return (String) ref;
- } else {
- com.google.protobuf.ByteString bs =
- (com.google.protobuf.ByteString) ref;
- String s = bs.toStringUtf8();
- name_ = s;
- return s;
- }
- }
-
- /**
- * string name = 1;
- */
- public com.google.protobuf.ByteString
- getNameBytes() {
- Object ref = name_;
- if (ref instanceof String) {
- com.google.protobuf.ByteString b =
- com.google.protobuf.ByteString.copyFromUtf8(
- (String) ref);
- name_ = b;
- return b;
- } else {
- return (com.google.protobuf.ByteString) ref;
- }
- }
-
- private byte memoizedIsInitialized = -1;
-
- @Override
- public final boolean isInitialized() {
- byte isInitialized = memoizedIsInitialized;
- if (isInitialized == 1) {
- return true;
- }
- if (isInitialized == 0) {
- return false;
- }
-
- memoizedIsInitialized = 1;
- return true;
- }
-
- @Override
- public void writeTo(com.google.protobuf.CodedOutputStream output)
- throws java.io.IOException {
- if (!getNameBytes().isEmpty()) {
- com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
- }
- unknownFields.writeTo(output);
- }
-
- @Override
- public int getSerializedSize() {
- int size = memoizedSize;
- if (size != -1) {
- return size;
- }
-
- size = 0;
- if (!getNameBytes().isEmpty()) {
- size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
- }
- size += unknownFields.getSerializedSize();
- memoizedSize = size;
- return size;
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (obj == this) {
- return true;
- }
- if (!(obj instanceof HelloRequest)) {
- return super.equals(obj);
- }
- HelloRequest other = (HelloRequest) obj;
-
- if (!getName()
- .equals(other.getName())) {
- return false;
- }
- if (!unknownFields.equals(other.unknownFields)) {
- return false;
- }
- return true;
- }
-
- @Override
- public int hashCode() {
- if (memoizedHashCode != 0) {
- return memoizedHashCode;
- }
- int hash = 41;
- hash = (19 * hash) + getDescriptor().hashCode();
- hash = (37 * hash) + NAME_FIELD_NUMBER;
- hash = (53 * hash) + getName().hashCode();
- hash = (29 * hash) + unknownFields.hashCode();
- memoizedHashCode = hash;
- return hash;
- }
-
- public static HelloRequest parseFrom(
- java.nio.ByteBuffer data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
-
- public static HelloRequest parseFrom(
- java.nio.ByteBuffer data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
-
- public static HelloRequest parseFrom(
- com.google.protobuf.ByteString data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
-
- public static HelloRequest parseFrom(
- com.google.protobuf.ByteString data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
-
- public static HelloRequest parseFrom(byte[] data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
-
- public static HelloRequest parseFrom(
- byte[] data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
-
- public static HelloRequest parseFrom(java.io.InputStream input)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input);
- }
-
- public static HelloRequest parseFrom(
- java.io.InputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input, extensionRegistry);
- }
-
- public static HelloRequest parseDelimitedFrom(java.io.InputStream input)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseDelimitedWithIOException(PARSER, input);
- }
-
- public static HelloRequest parseDelimitedFrom(
- java.io.InputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
- }
-
- public static HelloRequest parseFrom(
- com.google.protobuf.CodedInputStream input)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input);
- }
-
- public static HelloRequest parseFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input, extensionRegistry);
- }
-
- @Override
- public Builder newBuilderForType() {
- return newBuilder();
- }
-
- public static Builder newBuilder() {
- return DEFAULT_INSTANCE.toBuilder();
- }
-
- public static Builder newBuilder(HelloRequest prototype) {
- return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
- }
-
- @Override
- public Builder toBuilder() {
- return this == DEFAULT_INSTANCE
- ? new Builder() : new Builder().mergeFrom(this);
- }
-
- @Override
- protected Builder newBuilderForType(
- BuilderParent parent) {
- Builder builder = new Builder(parent);
- return builder;
- }
-
- /**
- *
- * The request message containing the user's name.
- *
- * string name = 1;
- */
- public String getName() {
- Object ref = name_;
- if (!(ref instanceof String)) {
- com.google.protobuf.ByteString bs =
- (com.google.protobuf.ByteString) ref;
- String s = bs.toStringUtf8();
- name_ = s;
- return s;
- } else {
- return (String) ref;
- }
- }
-
- /**
- * string name = 1;
- */
- public com.google.protobuf.ByteString
- getNameBytes() {
- Object ref = name_;
- if (ref instanceof String) {
- com.google.protobuf.ByteString b =
- com.google.protobuf.ByteString.copyFromUtf8(
- (String) ref);
- name_ = b;
- return b;
- } else {
- return (com.google.protobuf.ByteString) ref;
- }
- }
-
- /**
- * string name = 1;
- */
- public Builder setName(
- String value) {
- if (value == null) {
- throw new NullPointerException();
- }
-
- name_ = value;
- onChanged();
- return this;
- }
-
- /**
- * string name = 1;
- */
- public Builder clearName() {
-
- name_ = getDefaultInstance().getName();
- onChanged();
- return this;
- }
-
- /**
- * string name = 1;
- */
- public Builder setNameBytes(
- com.google.protobuf.ByteString value) {
- if (value == null) {
- throw new NullPointerException();
- }
- checkByteStringIsUtf8(value);
-
- name_ = value;
- onChanged();
- return this;
- }
-
- @Override
- public final Builder setUnknownFields(
- final com.google.protobuf.UnknownFieldSet unknownFields) {
- return super.setUnknownFields(unknownFields);
- }
-
- @Override
- public final Builder mergeUnknownFields(
- final com.google.protobuf.UnknownFieldSet unknownFields) {
- return super.mergeUnknownFields(unknownFields);
- }
-
-
- // @@protoc_insertion_point(builder_scope:helloworld.HelloRequest)
- }
-
- // @@protoc_insertion_point(class_scope:helloworld.HelloRequest)
- private static final HelloRequest DEFAULT_INSTANCE;
-
- static {
- DEFAULT_INSTANCE = new HelloRequest();
- }
-
- public static HelloRequest getDefaultInstance() {
- return DEFAULT_INSTANCE;
- }
-
- private static final com.google.protobuf.Parserstring name = 1;
- */
- String getName();
-
- /**
- * string name = 1;
- */
- com.google.protobuf.ByteString
- getNameBytes();
-}
diff --git a/dubbo-rpc/dubbo-rpc-grpc/src/test/java/org/apache/dubbo/rpc/protocol/grpc/support/HelloWorldProto.java b/dubbo-rpc/dubbo-rpc-grpc/src/test/java/org/apache/dubbo/rpc/protocol/grpc/support/HelloWorldProto.java
deleted file mode 100644
index 6254ebb5b9..0000000000
--- a/dubbo-rpc/dubbo-rpc-grpc/src/test/java/org/apache/dubbo/rpc/protocol/grpc/support/HelloWorldProto.java
+++ /dev/null
@@ -1,90 +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.
- */
-
-// Generated by the protocol buffer compiler. DO NOT EDIT!
-// source: helloworld.proto
-
-package org.apache.dubbo.rpc.protocol.grpc.support;
-
-public final class HelloWorldProto {
- private HelloWorldProto() {
- }
-
- public static void registerAllExtensions(
- com.google.protobuf.ExtensionRegistryLite registry) {
- }
-
- public static void registerAllExtensions(
- com.google.protobuf.ExtensionRegistry registry) {
- registerAllExtensions(
- (com.google.protobuf.ExtensionRegistryLite) registry);
- }
-
- static final com.google.protobuf.Descriptors.Descriptor
- internal_static_helloworld_HelloRequest_descriptor;
- static final
- com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
- internal_static_helloworld_HelloRequest_fieldAccessorTable;
- static final com.google.protobuf.Descriptors.Descriptor
- internal_static_helloworld_HelloReply_descriptor;
- static final
- com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
- internal_static_helloworld_HelloReply_fieldAccessorTable;
-
- public static com.google.protobuf.Descriptors.FileDescriptor
- getDescriptor() {
- return descriptor;
- }
-
- private static com.google.protobuf.Descriptors.FileDescriptor
- descriptor;
-
- static {
- String[] descriptorData = {
- "\n\020helloworld.proto\022\nhelloworld\"\034\n\014HelloR" +
- "equest\022\014\n\004name\030\001 \001(\t\"\035\n\nHelloReply\022\017\n\007me" +
- "ssage\030\001 \001(\tB6\n\033org.apache.dubbo.demo.hel" +
- "loB\017HelloWorldProtoP\001\242\002\003HLWb\006proto3"
- };
- com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
- new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
- public com.google.protobuf.ExtensionRegistry assignDescriptors(
- com.google.protobuf.Descriptors.FileDescriptor root) {
- descriptor = root;
- return null;
- }
- };
- com.google.protobuf.Descriptors.FileDescriptor
- .internalBuildGeneratedFileFrom(descriptorData,
- new com.google.protobuf.Descriptors.FileDescriptor[] {
- }, assigner);
- internal_static_helloworld_HelloRequest_descriptor =
- getDescriptor().getMessageTypes().get(0);
- internal_static_helloworld_HelloRequest_fieldAccessorTable = new
- com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
- internal_static_helloworld_HelloRequest_descriptor,
- new String[] {"Name",});
- internal_static_helloworld_HelloReply_descriptor =
- getDescriptor().getMessageTypes().get(1);
- internal_static_helloworld_HelloReply_fieldAccessorTable = new
- com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
- internal_static_helloworld_HelloReply_descriptor,
- new String[] {"Message",});
- }
-
- // @@protoc_insertion_point(outer_class_scope)
-}
diff --git a/dubbo-rpc/dubbo-rpc-grpc/src/main/java/org/apache/dubbo/rpc/protocol/grpc/GrpcConfig.java b/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/GrpcHttp2Protocol.java
similarity index 82%
rename from dubbo-rpc/dubbo-rpc-grpc/src/main/java/org/apache/dubbo/rpc/protocol/grpc/GrpcConfig.java
rename to dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/GrpcHttp2Protocol.java
index 08b2f6a7b2..1b00e5ff09 100644
--- a/dubbo-rpc/dubbo-rpc-grpc/src/main/java/org/apache/dubbo/rpc/protocol/grpc/GrpcConfig.java
+++ b/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/GrpcHttp2Protocol.java
@@ -14,8 +14,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.dubbo.rpc.protocol.grpc;
-public class GrpcConfig {
+package org.apache.dubbo.rpc.protocol.tri;
+import org.apache.dubbo.common.extension.Activate;
+
+@Activate
+public class GrpcHttp2Protocol extends TripleHttp2Protocol {
}
diff --git a/dubbo-rpc/dubbo-rpc-grpc/src/main/java/org/apache/dubbo/rpc/protocol/grpc/interceptors/ClientInterceptor.java b/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/GrpcProtocol.java
similarity index 68%
rename from dubbo-rpc/dubbo-rpc-grpc/src/main/java/org/apache/dubbo/rpc/protocol/grpc/interceptors/ClientInterceptor.java
rename to dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/GrpcProtocol.java
index 33beddfbba..38519e4c42 100644
--- a/dubbo-rpc/dubbo-rpc-grpc/src/main/java/org/apache/dubbo/rpc/protocol/grpc/interceptors/ClientInterceptor.java
+++ b/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/GrpcProtocol.java
@@ -14,14 +14,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.dubbo.rpc.protocol.grpc.interceptors;
-import org.apache.dubbo.common.extension.ExtensionScope;
-import org.apache.dubbo.common.extension.SPI;
+package org.apache.dubbo.rpc.protocol.tri;
-/**
- * Adapt to the standard Dubbo SPI, so that we can leverage the advantages of Dubbo ExtensionLoader.
- */
-@SPI(scope = ExtensionScope.FRAMEWORK)
-public interface ClientInterceptor extends io.grpc.ClientInterceptor {
+import org.apache.dubbo.rpc.model.FrameworkModel;
+
+public class GrpcProtocol extends TripleProtocol {
+
+ public GrpcProtocol(FrameworkModel frameworkModel) {
+ super(frameworkModel);
+ }
}
diff --git a/dubbo-rpc/dubbo-rpc-triple/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.remoting.api.WireProtocol b/dubbo-rpc/dubbo-rpc-triple/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.remoting.api.WireProtocol
index 2280d84378..ba8d12687b 100644
--- a/dubbo-rpc/dubbo-rpc-triple/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.remoting.api.WireProtocol
+++ b/dubbo-rpc/dubbo-rpc-triple/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.remoting.api.WireProtocol
@@ -1 +1,2 @@
-tri=org.apache.dubbo.rpc.protocol.tri.TripleHttp2Protocol
\ No newline at end of file
+tri=org.apache.dubbo.rpc.protocol.tri.TripleHttp2Protocol
+grpc=org.apache.dubbo.rpc.protocol.tri.GrpcHttp2Protocol
\ No newline at end of file
diff --git a/dubbo-rpc/dubbo-rpc-triple/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.rpc.Protocol b/dubbo-rpc/dubbo-rpc-triple/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.rpc.Protocol
index cdcb95fa7c..3cb3ffb116 100644
--- a/dubbo-rpc/dubbo-rpc-triple/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.rpc.Protocol
+++ b/dubbo-rpc/dubbo-rpc-triple/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.rpc.Protocol
@@ -1 +1,2 @@
-tri=org.apache.dubbo.rpc.protocol.tri.TripleProtocol
\ No newline at end of file
+tri=org.apache.dubbo.rpc.protocol.tri.TripleProtocol
+grpc=org.apache.dubbo.rpc.protocol.tri.GrpcProtocol
\ No newline at end of file
diff --git a/dubbo-rpc/pom.xml b/dubbo-rpc/pom.xml
index 091f8e9a7a..752b6c560c 100644
--- a/dubbo-rpc/pom.xml
+++ b/dubbo-rpc/pom.xml
@@ -34,7 +34,6 @@