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

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

There is a newer version: 0.36.1
Show newest version
//
// 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);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy