Returns a {@link ServerBootstrap} instance for the named transport.
336525
@Override
    public synchronized ServerBootstrap newServerBootstrap() throws Exception {
        if (serverChannelFactory == null) {
            Executor workerExecutor = executorServiceFactory.newExecutorService("worker.server");
            NioDatagramWorkerPool workerPool = new NioDatagramWorkerPool(workerExecutor, 1);
            serverChannelFactory = new UdpServerChannelFactory(workerPool, timer);

            // unshared
            channelFactories.add(serverChannelFactory);
        }

        return new ServerBootstrap(serverChannelFactory);
    }
756251
public static File getBootstrapLibDir() {
        if (libDir.get() == null) {
            libDir = StaticValue.mutateStaticValue(libDir, new Utils.FileInitializer(getBootstrapJar().getParentFile()));
        }
        return libDir.get();
    }
1291225
public final UdpServer port(int port) {
		return bootstrap(b -> b.localAddress(getHost(b), port));
	}
729279
public JettyBootstrap stopServer() throws JettyBootstrapException {
        LOG.info("Stopping Server...");
        try {
            if (isServerStarted()) {
                handlers.stop();

                server.stop();

                LOG.info("Server stopped.");
            } else {
                LOG.warn("Can't stop server. Already stopped");
            }
        } catch (Exception e) {
            throw new JettyBootstrapException(e);
        }

        return this;
    }
479642
public static StreamBootstrapper getInstance(String pubId, SystemId sysId, InputStream in)
    {
        return new StreamBootstrapper(pubId, sysId, in);
    }
1146946
private BootstrapHandler loadBootstrap(String bootstrapClassName)
      throws ClassNotFoundException, IllegalAccessException, InstantiationException {
    return classLoader.loadClass(bootstrapClassName).asSubclass(BootstrapHandler.class).newInstance();
  }
474496
public RpcHandler doBootstrap(Channel channel, RpcHandler rpcHandler) {
    return new SaslRpcHandler(conf, channel, rpcHandler, secretKeyHolder);
  }
629264
@Override
	public AsyncService getAsyncService(TNonblockingTransport transport, String serviceName) throws IkasoaException {
		if (transport == null)
			throw new IllegalArgumentException("'transport' is null !");
		try {
			return StringUtil.isEmpty(serviceName)
					? new AsyncServiceClientImpl((TProtocolFactory) new TCompactProtocol.Factory(), transport)
					: new AsyncServiceClientImpl(new AsyncMultiplexedProtocolFactory(serviceName), transport);
		} catch (IOException e) {
			throw new IkasoaException(e);
		}
	}
897195
private Transport createTransport(final String profile) {
        if (getCaCapabilities(profile).isPostSupported()) {
            return transportFactory.forMethod(Method.POST, url);
        } else {
            return transportFactory.forMethod(Method.GET, url);
        }
    }
288165
public HttpServer build() {
        checkNotNull(baseUri);
        StandaloneWebConverterConfiguration configuration = makeConfiguration();
        // The configuration has to be configured both by a binder to make it injectable
        // and directly in order to trigger life cycle methods on the deployment container.
        ResourceConfig resourceConfig = ResourceConfig
                .forApplication(new WebConverterApplication(configuration))
                .register(configuration);
        if (sslContext == null) {
            return GrizzlyHttpServerFactory.createHttpServer(baseUri, resourceConfig);
        } else {
            return GrizzlyHttpServerFactory.createHttpServer(baseUri, resourceConfig, true, new SSLEngineConfigurator(sslContext));
        }
    }
88591
func (r *ServerService) GetBootstrap() *ServerGetBootstrapCall {
	c := &ServerGetBootstrapCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	return c
}
636984
@Override
	public TTransport getTransport() throws IkasoaException {
		updateServerInfo();
		ServerCheck serverCheck = getServerCheck();
		// 如果有配置检测实现,则在建立连接前尝试检测服务器,如果服务器不可用则尝试切换到另一台服务器,切换规则取决于负载均衡实现.
		// 需要注意,如果列表中的服务器全都不可用,则会无限循环下去,直到有可用的服务为止.
		if (serverCheck != null && !serverCheck.check(getServerHost(), getServerPort())) {
			serverCheckFailProcessor.process(this);
			return getTransport();
		}
		TTransport transport = super.getTransport(getServerHost(), getServerPort());
		loadBalance.next();
		return transport;
	}
989767
public ServerBootstrap resolve() throws Exception {
        if (bootstrap == null) {
            URI acceptURI = locationResolver.get();
            Map<String, Object> acceptOptions = optionsResolver.resolve();
            ChannelAddress localAddress = addressFactory.newChannelAddress(acceptURI, acceptOptions);
            LOGGER.debug("Initializing server Bootstrap binding to address " + localAddress);
            ServerBootstrap serverBootstrapCandidate = bootstrapFactory.newServerBootstrap(acceptURI.getScheme());
            acceptOptions.put("localAddress", localAddress);
            serverBootstrapCandidate.setOptions(acceptOptions);
            serverBootstrapCandidate.setPipelineFactory(pipelineFactory);
            bootstrap = serverBootstrapCandidate;
        }
        return bootstrap;
    }
826230
@Nullable
	public static SslProvider findSslSupport(Bootstrap b) {
		DeferredSslSupport ssl = BootstrapHandlers.findConfiguration(DeferredSslSupport.class, b.config().handler());

		if (ssl == null) {
			return null;
		}
		return ssl.sslProvider;
	}
1077758
private Bootstrap getNettyBootstrap() {
        Bootstrap b = new Bootstrap();
        b.group(group)
         .channel(Epoll.isAvailable() ? EpollSocketChannel.class : NioSocketChannel.class)
         .option(ChannelOption.TCP_NODELAY, true);
        return b;
    }
238940
public TransportServer createServer(
      String host, int port, List<TransportServerBootstrap> bootstraps) {
    return new TransportServer(this, host, port, rpcHandler, bootstraps);
  }
4834
@Override
    public synchronized ClientBootstrap newClientBootstrap() throws Exception {

        ClientSocketChannelFactory clientChannelFactory = this.clientChannelFactory;

        if (clientChannelFactory == null) {
            Executor bossExecutor = executorServiceFactory.newExecutorService("boss.client");
            NioClientBossPool bossPool = new NioClientBossPool(bossExecutor, 1);
            Executor workerExecutor = executorServiceFactory.newExecutorService("worker.client");
            NioWorkerPool workerPool = new NioWorkerPool(workerExecutor, 1);
            clientChannelFactory = new NioClientSocketChannelFactory(bossPool, workerPool);

            // unshared
            channelFactories.add(clientChannelFactory);
        }

        return new ClientBootstrap(clientChannelFactory) {
            @Override
            public ChannelFuture connect(final SocketAddress localAddress, final SocketAddress remoteAddress) {
                final InetSocketAddress localChannelAddress = toInetSocketAddress((ChannelAddress) localAddress);
                final InetSocketAddress remoteChannelAddress = toInetSocketAddress((ChannelAddress) remoteAddress);
                return super.connect(localChannelAddress, remoteChannelAddress);
            }
        };
    }