io.deephaven.proto.DeephavenChannelWithClientInterceptors Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of deephaven-proto-backplane-grpc Show documentation
Show all versions of deephaven-proto-backplane-grpc Show documentation
The Deephaven proto-backplane-grpc
//
// Copyright (c) 2016-2024 Deephaven Data Labs and Patent Pending
//
package io.deephaven.proto;
import io.grpc.Channel;
import io.grpc.ClientInterceptor;
import io.grpc.ClientInterceptors;
import io.grpc.stub.AbstractStub;
import java.util.Objects;
final class DeephavenChannelWithClientInterceptors extends DeephavenChannelMixin {
private final ClientInterceptor[] clientInterceptors;
public DeephavenChannelWithClientInterceptors(DeephavenChannel delegate, ClientInterceptor... clientInterceptors) {
super(delegate);
this.clientInterceptors = Objects.requireNonNull(clientInterceptors);
}
@Override
protected > S mixin(S stub) {
return stub.withInterceptors(clientInterceptors);
}
@Override
protected Channel mixinChannel(Channel channel) {
return ClientInterceptors.intercept(channel, clientInterceptors);
}
}