导航菜单

页面标题

页面副标题

SpeedCash v6.5.1482 - f.java 源代码

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

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


package io.grpc.okhttp;

import com.google.common.base.MoreObjects;
import com.google.common.base.Preconditions;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import io.grpc.InternalChannelz;
import io.grpc.InternalInstrumented;
import io.grpc.InternalLogId;
import io.grpc.ServerStreamTracer;
import io.grpc.internal.InternalServer;
import io.grpc.internal.ObjectPool;
import io.grpc.internal.ServerListener;
import io.grpc.okhttp.f;
import io.grpc.okhttp.h;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.SocketAddress;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.Executor;
import java.util.concurrent.ScheduledExecutorService;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.net.ServerSocketFactory;

public final class f implements InternalServer {
    public static final Logger n = Logger.getLogger(f.class.getName());
    public final SocketAddress a;
    public final ServerSocketFactory b;
    public final ObjectPool<Executor> c;
    public final ObjectPool<ScheduledExecutorService> d;
    public final h.b e;
    public final InternalChannelz f;
    public ServerSocket g;
    public SocketAddress h;
    public InternalInstrumented<InternalChannelz.SocketStats> i;
    public Executor j;
    public ScheduledExecutorService k;
    public ServerListener l;
    public boolean m;

    public static final class a implements InternalInstrumented<InternalChannelz.SocketStats> {
        public final InternalLogId a;
        public final ServerSocket b;

        public a(ServerSocket serverSocket) {
            this.b = serverSocket;
            this.a = InternalLogId.allocate(a.class, String.valueOf(serverSocket.getLocalSocketAddress()));
        }

        public InternalLogId getLogId() {
            return this.a;
        }

        public ListenableFuture<InternalChannelz.SocketStats> getStats() {
            return Futures.immediateFuture(new InternalChannelz.SocketStats((InternalChannelz.TransportStats) null, this.b.getLocalSocketAddress(), (SocketAddress) null, new InternalChannelz.SocketOptions.Builder().build(), (InternalChannelz.Security) null));
        }

        public String toString() {
            return MoreObjects.toStringHelper(this).add("logId", this.a.getId()).add("socket", this.b).toString();
        }
    }

    public f(OkHttpServerBuilder okHttpServerBuilder, List<? extends ServerStreamTracer.Factory> list, InternalChannelz internalChannelz) {
        this.a = (SocketAddress) Preconditions.checkNotNull(okHttpServerBuilder.b, "listenAddress");
        this.b = (ServerSocketFactory) Preconditions.checkNotNull(okHttpServerBuilder.g, "socketFactory");
        this.c = (ObjectPool) Preconditions.checkNotNull(okHttpServerBuilder.e, "transportExecutorPool");
        this.d = (ObjectPool) Preconditions.checkNotNull(okHttpServerBuilder.f, "scheduledExecutorServicePool");
        this.e = new h.b(okHttpServerBuilder, list);
        this.f = (InternalChannelz) Preconditions.checkNotNull(internalChannelz, "channelz");
    }

    public final void b() {
        while (true) {
            try {
                try {
                    h hVar = new h(this.e, this.g.accept());
                    hVar.d0(this.l.transportCreated(hVar));
                } catch (IOException e) {
                    if (!this.m) {
                        throw e;
                    }
                    this.l.serverShutdown();
                    return;
                }
            } catch (Throwable th) {
                n.log(Level.SEVERE, "Accept loop failed", th);
                this.l.serverShutdown();
                return;
            }
        }
    }

    @Override
    public SocketAddress getListenSocketAddress() {
        return this.h;
    }

    @Override
    public List<? extends SocketAddress> getListenSocketAddresses() {
        return Collections.singletonList(getListenSocketAddress());
    }

    @Override
    public InternalInstrumented<InternalChannelz.SocketStats> getListenSocketStats() {
        return this.i;
    }

    @Override
    public List<InternalInstrumented<InternalChannelz.SocketStats>> getListenSocketStatsList() {
        return Collections.singletonList(getListenSocketStats());
    }

    @Override
    public void shutdown() {
        if (this.m) {
            return;
        }
        this.m = true;
        if (this.g == null) {
            return;
        }
        this.f.removeListenSocket(this.i);
        try {
            this.g.close();
        } catch (IOException unused) {
            n.log(Level.WARNING, "Failed closing server socket", this.g);
        }
        this.j = this.c.returnObject(this.j);
        this.k = this.d.returnObject(this.k);
    }

    @Override
    public void start(ServerListener serverListener) throws IOException {
        this.l = (ServerListener) Preconditions.checkNotNull(serverListener, "listener");
        ServerSocket createServerSocket = this.b.createServerSocket();
        try {
            createServerSocket.bind(this.a);
            this.g = createServerSocket;
            this.h = createServerSocket.getLocalSocketAddress();
            this.i = new a(createServerSocket);
            this.j = this.c.getObject();
            this.k = this.d.getObject();
            this.f.addListenSocket(this.i);
            this.j.execute(new Runnable() {
                @Override
                public final void run() {
                    f.this.b();
                }
            });
        } catch (IOException e) {
            createServerSocket.close();
            throw e;
        }
    }
}