Ejemplo n.º 1
0
 private static void startTrafficServer(
     Properties trafficProperties, Module managerModule, Module proxyServerModule) {
   trafficProperties.put(
       ClassNamesResourceConfig.PROPERTY_CLASSNAMES,
       TrafficResource.class.getName() + " " + AdminUIResource.class.getName());
   String trafficPort = trafficProperties.getProperty(TRAFFIC_PORT);
   startUpServerWith(
       trafficPort,
       HttpServer.createPropertiesModule(trafficProperties),
       managerModule,
       proxyServerModule,
       new TrafficModule());
 }
Ejemplo n.º 2
0
 private static HttpServer startProxyServer(Properties proxyProperties, Module managerModule) {
   proxyProperties.put(
       ClassNamesResourceConfig.PROPERTY_CLASSNAMES, ProxyResource.class.getName());
   proxyProperties.put(
       ClassNamesResourceConfig.PROPERTY_CONTAINER_REQUEST_FILTERS, ProxyFilter.class.getName());
   String proxyPort = proxyProperties.getProperty(PROXY_PORT);
   String numberOfWorkers = proxyProperties.getProperty(PROXY_WORKERS);
   proxyProperties.put(
       NettyHandlerContainer.PROPERTY_BASE_URI,
       "http://" + proxyProperties.getProperty(PROXY_HOST) + ":" + proxyPort + "/");
   return startUpServerWith(
       proxyPort,
       (StringUtils.isNotBlank(numberOfWorkers)
           ? Integer.parseInt(numberOfWorkers)
           : DEFAULT_NUMBER_OF_WORKERS),
       HttpServer.createPropertiesModule(proxyProperties),
       managerModule,
       new ProxyModule());
 }