All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.deephaven.proto.DeephavenChannelWithClientInterceptors Maven / Gradle / Ivy

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);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy