导航菜单

页面标题

页面副标题

SpeedCash v6.5.1482 - InProcessChannelBuilder.java 源代码

正在查看: SpeedCash v6.5.1482 应用的 InProcessChannelBuilder.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package io.grpc.inprocess;

import com.facebook.appevents.integrity.IntegrityManager;
import com.google.android.gms.common.api.Api;
import com.google.common.base.Preconditions;
import com.google.errorprone.annotations.DoNotCall;
import defpackage.i22;
import io.grpc.ChannelCredentials;
import io.grpc.ChannelLogger;
import io.grpc.ExperimentalApi;
import io.grpc.Internal;
import io.grpc.ManagedChannelBuilder;
import io.grpc.internal.AbstractManagedChannelImplBuilder;
import io.grpc.internal.ClientTransportFactory;
import io.grpc.internal.ConnectionClientTransport;
import io.grpc.internal.GrpcUtil;
import io.grpc.internal.ManagedChannelImplBuilder;
import io.grpc.internal.SharedResourceHolder;
import java.net.SocketAddress;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import javax.annotation.Nullable;

@ExperimentalApi("https://github.com/grpc/grpc-java/issues/1783")
public final class InProcessChannelBuilder extends AbstractManagedChannelImplBuilder<InProcessChannelBuilder> {
    public final ManagedChannelImplBuilder a;
    public ScheduledExecutorService b;
    public int c = Api.BaseClientBuilder.API_PRIORITY_OTHER;
    public boolean d = false;

    public final class b implements ManagedChannelImplBuilder.ClientTransportFactoryBuilder {
        public b() {
        }

        public ClientTransportFactory buildClientTransportFactory() {
            return InProcessChannelBuilder.this.b();
        }
    }

    public static final class c implements ClientTransportFactory {
        public final ScheduledExecutorService a;
        public final boolean b;
        public final int c;
        public boolean d;
        public final boolean e;

        public void close() {
            if (this.d) {
                return;
            }
            this.d = true;
            if (this.b) {
                SharedResourceHolder.release(GrpcUtil.TIMER_SERVICE, this.a);
            }
        }

        public ScheduledExecutorService getScheduledExecutorService() {
            return this.a;
        }

        public ConnectionClientTransport newClientTransport(SocketAddress socketAddress, ClientTransportFactory.ClientTransportOptions clientTransportOptions, ChannelLogger channelLogger) {
            if (this.d) {
                throw new IllegalStateException("The transport factory is closed.");
            }
            return new i22(socketAddress, this.c, clientTransportOptions.getAuthority(), clientTransportOptions.getUserAgent(), clientTransportOptions.getEagAttributes(), this.e);
        }

        public ClientTransportFactory.SwapChannelCredentialsResult swapChannelCredentials(ChannelCredentials channelCredentials) {
            return null;
        }

        public c(@Nullable ScheduledExecutorService scheduledExecutorService, int i, boolean z) {
            boolean z2 = scheduledExecutorService == null;
            this.b = z2;
            this.a = z2 ? (ScheduledExecutorService) SharedResourceHolder.get(GrpcUtil.TIMER_SERVICE) : scheduledExecutorService;
            this.c = i;
            this.e = z;
        }
    }

    public InProcessChannelBuilder(@Nullable SocketAddress socketAddress, @Nullable String str) {
        if (socketAddress != null) {
            this.a = new ManagedChannelImplBuilder(socketAddress, "localhost", new b(), (ManagedChannelImplBuilder.ChannelBuilderDefaultPortProvider) null);
        } else {
            this.a = new ManagedChannelImplBuilder(str, new b(), (ManagedChannelImplBuilder.ChannelBuilderDefaultPortProvider) null);
        }
        this.a.setStatsRecordStartedRpcs(false);
        this.a.setStatsRecordFinishedRpcs(false);
        this.a.setStatsRecordRetryMetrics(false);
        this.a.disableRetry();
    }

    public static InProcessChannelBuilder forAddress(SocketAddress socketAddress) {
        return new InProcessChannelBuilder((SocketAddress) Preconditions.checkNotNull(socketAddress, IntegrityManager.INTEGRITY_TYPE_ADDRESS), null);
    }

    public static InProcessChannelBuilder forName(String str) {
        return forAddress(new InProcessSocketAddress((String) Preconditions.checkNotNull(str, "name")));
    }

    public static InProcessChannelBuilder forTarget(String str) {
        return new InProcessChannelBuilder(null, (String) Preconditions.checkNotNull(str, "target"));
    }

    public ClientTransportFactory b() {
        return new c(this.b, this.c, this.d);
    }

    @Internal
    public ManagedChannelBuilder<?> delegate() {
        return this.a;
    }

    public InProcessChannelBuilder m63keepAliveTime(long j, TimeUnit timeUnit) {
        return this;
    }

    public InProcessChannelBuilder m65keepAliveTimeout(long j, TimeUnit timeUnit) {
        return this;
    }

    public InProcessChannelBuilder m67keepAliveWithoutCalls(boolean z) {
        return this;
    }

    public InProcessChannelBuilder propagateCauseWithStatus(boolean z) {
        this.d = z;
        return this;
    }

    public InProcessChannelBuilder scheduledExecutorService(ScheduledExecutorService scheduledExecutorService) {
        this.b = (ScheduledExecutorService) Preconditions.checkNotNull(scheduledExecutorService, "scheduledExecutorService");
        return this;
    }

    public void setStatsEnabled(boolean z) {
        this.a.setStatsEnabled(z);
    }

    public InProcessChannelBuilder m73usePlaintext() {
        return this;
    }

    public InProcessChannelBuilder m75useTransportSecurity() {
        return this;
    }

    @DoNotCall("Unsupported. Use forName() instead")
    public static InProcessChannelBuilder forAddress(String str, int i) {
        throw new UnsupportedOperationException("call forName() instead");
    }

    public InProcessChannelBuilder m69maxInboundMessageSize(int i) {
        return (InProcessChannelBuilder) super.maxInboundMessageSize(i);
    }

    public InProcessChannelBuilder m71maxInboundMetadataSize(int i) {
        Preconditions.checkArgument(i > 0, "maxInboundMetadataSize must be > 0");
        this.c = i;
        return this;
    }
}