public static void main(String[] args, BatfishLogger logger, BindPortFutures portFutures) { mainInit(args); // Supply ports early if known before binding int configuredPoolPort = _settings.getServicePoolPort(); if (configuredPoolPort > 0) { portFutures.getPoolPort().complete(configuredPoolPort); } int configuredWorkPort = _settings.getServiceWorkPort(); if (configuredWorkPort > 0) { portFutures.getWorkPort().complete(configuredWorkPort); } int configuredWorkV2Port = _settings.getServiceWorkV2Port(); if (configuredWorkV2Port > 0) { portFutures.getWorkV2Port().complete(configuredWorkV2Port); } _logger = logger; mainRun(portFutures); }
try { _client.getSettings().setCoordinatorWorkPort(bindPortFutures.getWorkPort().get()); _client.getSettings().setCoordinatorWorkV2Port(bindPortFutures.getWorkV2Port().get()); } catch (ExecutionException | InterruptedException e) { System.err.println("org.batfish.allinone: Worker initialization failed: " + e.getMessage());
private static void initWorkManager(BindPortFutures bindPortFutures) { _workManager = new WorkMgr( _settings, _logger, new FileBasedIdManager(_settings.getContainersLocation()), new FileBasedStorage(_settings.getContainersLocation(), _logger)); _workManager.startWorkManager(); // Initialize and start the work manager service using the legacy API and Jettison. startWorkManagerService( WorkMgrService.class, Lists.newArrayList(JettisonFeature.class, MultiPartFeature.class), _settings.getServiceWorkPort(), bindPortFutures.getWorkPort()); // Initialize and start the work manager service using the v2 RESTful API and Jackson. startWorkManagerService( WorkMgrServiceV2.class, Lists.newArrayList( ServiceObjectMapper.class, JacksonFeature.class, ApiKeyAuthenticationFilter.class, VersionCompatibilityFilter.class), _settings.getServiceWorkV2Port(), bindPortFutures.getWorkV2Port()); }