Get ServerTransport

@param serverConfig ServerTransportConfig
@return ServerTransport
345104
public static ServerTransport getServerTransport(ServerTransportConfig serverConfig) {
        ServerTransport serverTransport = ExtensionLoaderFactory.getExtensionLoader(ServerTransport.class)
            .getExtension(serverConfig.getContainer(),
                new Class[] { ServerTransportConfig.class },
                new Object[] { serverConfig });
        if (serverTransport != null) {
            String key = Integer.toString(serverConfig.getPort());
            SERVER_TRANSPORT_MAP.put(key, serverTransport);
        }
        return serverTransport;
    }
1191423
public static function server()
    {
        $configFile = ServerApp::getInstance()->getConfigFile();
        $content = file_get_contents($configFile);
        $config = json_decode($content, true);
        if (!is_array($config)) {
            throw new InitiallyRpcException("Server config error: format error");
        } else if (!isset($config["transport"])) {
            throw new InitiallyRpcException("Server config error: undefined transport");
        }

        $serverConfig = new Server();
        $serverConfig->setTransport($config["transport"]);
        if (isset($config["services"]) && is_array($config["services"]) && !empty($config["services"])) {
            foreach ($config["services"] as $key => $value) {
                if (!is_array($value)) {
                    throw new InitiallyRpcException("Server config error: service format error");
                } else if (!isset($value["interface"])) {
                    throw new InitiallyRpcException("Server config error: undefined interface");
                } else if (!isset($value["reference"])) {
                    throw new InitiallyRpcException("Server config error: undefined reference");
                }

                $service = new Service();
                $service->setInterface($value["interface"]);
                $service->setReference($value["reference"]);
                $serverConfig->addService($service);
            }
        }

        return $serverConfig;
    }
53547
public Configuration getConfiguration() {
		if (configuration == null) {
			try {
				configuration = new PropertiesConfiguration(getClass().getResource("/nextserver.properties"));
			} catch (ConfigurationException e) {
				throw new RuntimeException(e);
			}
		}		
		return configuration;
	}
494663
@Override
	public IHttpTransport getTransport() {
		 IAggregatorExtension ext = getExtensions(IHttpTransportExtensionPoint.ID).iterator().next();
		 return (IHttpTransport)(ext != null ? ext.getInstance() : null);
	}
1110667
public static ProviderInfo convertProviderToProviderInfo(ProviderConfig config, ServerConfig server) {
        ProviderInfo providerInfo = new ProviderInfo()
            .setPort(server.getPort())
            .setWeight(config.getWeight())
            .setSerializationType(config.getSerialization())
            .setProtocolType(server.getProtocol())
            .setPath(server.getContextPath());
        String host = server.getHost();
        if (NetUtils.isLocalHost(host) || NetUtils.isAnyHost(host)) {
            host = SystemInfo.getLocalHost();
        }
        providerInfo.setHost(host);
        return providerInfo;
    }
489341
private static HttpTransportOptions getHttpTransportOptions(ConnectionParameters parameters) {
    HttpTransportOptions.Builder httpOptionsBuilder = HttpTransportOptions.newBuilder();
    httpOptionsBuilder.setConnectTimeout(parameters.getConnectionTimeout());
    httpOptionsBuilder.setReadTimeout(parameters.getReadTimeout());

    HttpTransportFactory httpTransportFactory = parameters.getHttpTransportFactory();
    if (httpTransportFactory != null) {
      httpOptionsBuilder.setHttpTransportFactory(httpTransportFactory);
    }
    return httpOptionsBuilder.build();
  }
670844
private static ClusterManagerService.Client getCMSClient(CoronaConf conf)
    throws TTransportException {
    InetSocketAddress address = NetUtils.createSocketAddr(conf
        .getClusterManagerAddress());
    TFramedTransport transport = new TFramedTransport(
      new TSocket(address.getHostName(), address.getPort()));
    ClusterManagerService.Client client = new ClusterManagerService.Client(
        new TBinaryProtocol(transport));
    transport.open();
    return client;
  }
1191360
function getTransports(config) {
  var transports = {
    console: {
      level: config.level,
      handleExceptions: true,
      colorize: true,
      prettyPrint: true
    },
    file: {
      level: config.level,
      filename: path.join(config.file.dir, FILE_NAME),
      maxsize: config.file.maxsize,
      maxFiles: config.file.maxfiles,
      json: false,
      timestamp: true
    }
  };
  transports.error = {
    filename: path.join(config.file.dir, ERROR_FILE_NAME),
    maxsize: config.file.maxsize,
    maxFiles: config.file.maxfiles,
    timestamp: true,
    json: true,
    prettyPrint: true
  };

  return transports;
}
1077842
@Override
	public ThriftServer getThriftServer(String serverName, int serverPort, TProcessor processor) {
		return new ThreadPoolThriftServerImpl(serverName, serverPort, thriftServerConfiguration, processor);
	}
122138
protected static BeanDefinition getServerConfigurationBeanDefinition(){
        String className = ServerConfiguration.class.getName();
        GenericBeanDefinition result = new GenericBeanDefinition();
        result.setAutowireCandidate(true);
        result.setScope(BeanDefinition.SCOPE_SINGLETON);
        result.setBeanClass(Server.class);
        result.setFactoryMethodName("getConfig");
        result.setAttribute("id", className);
        result.setAttribute("name", className);
        return result;
    }
376417
public OperationFuture<ServerMetadata> create(CreateServerConfig config) {
        BaseServerResponse response = client.create(
            serverConverter.buildCreateServerRequest(
                config,
                config.getCustomFields().isEmpty() ?
                    null :
                    client.getCustomFields())
        );

        return postProcessBuildServerResponse(response, config);
    }
1310605
@Override
	public ThriftServer getThriftServer(String serverName, int serverPort, Map<String, Service> serviceMap) {
		return getThriftServer(serverName, serverPort, buildMultiplexedProcessor(serviceMap));
	}
710459
@Override
	public ThriftServer getThriftServer(int serverPort, Map<String, Service> serviceMap) {
		return getThriftServer(String.format("ThriftServer-%d", serverPort), serverPort, serviceMap);
	}
64414
public static ServiceTransportBootstrap rsocketServiceTransport(ServiceTransportBootstrap opts) {
    return opts.resources(RSocketTransportResources::new)
        .client(RSocketServiceTransport.INSTANCE::clientTransport)
        .server(RSocketServiceTransport.INSTANCE::serverTransport);
  }
968845
public static int getFreePort(int defaultPort) throws IOException {
    try (
        ServerSocket serverSocket = new ServerSocket(defaultPort)
    ) {
      return serverSocket.getLocalPort();
    } catch (IOException e) {
      return getFreePort();
    }
  }
716073
@Override
	public ThriftServer getThriftServer(String serverName, int serverPort, Service service) {
		return getThriftServer(serverName, serverPort, new ServiceProcessor(service));
	}
622451
public OperationFuture<ServerMetadata> importServer(ImportServerConfig config) {
        BaseServerResponse response = client.importServer(
            serverConverter.buildImportServerRequest(
                config,
                config.getCustomFields().isEmpty() ?
                    null :
                    client.getCustomFields()
            )
        );

        return postProcessBuildServerResponse(response, config);
    }