@Test public void canTalkToTwoDifferentTimeLockServers() { ConjureTimelockService secondTimelockService = getAtlasDbDialogueServiceProvider(secondServerPort) .getConjureTimelockService(); assertTimestampRange(conjureTimelockService, FIRST_LOWER, FIRST_UPPER); assertTimestampRange(secondTimelockService, SECOND_LOWER, SECOND_UPPER); }
ConjureTimelockService getConjureTimelockService() { ConjureTimelockServiceBlocking longTimeoutService = dialogueClientFactory.get(ConjureTimelockServiceBlocking.class, TIMELOCK_LONG_TIMEOUT); ConjureTimelockServiceBlocking shortTimeoutService = dialogueClientFactory.get(ConjureTimelockServiceBlocking.class, TIMELOCK_SHORT_TIMEOUT); ConjureTimelockServiceBlockingMetrics conjureTimelockServiceBlockingMetrics = ConjureTimelockServiceBlockingMetrics.of(taggedMetricRegistry); ShortAndLongTimeoutServices<ConjureTimelockService> shortAndLongTimeoutServices = ImmutableShortAndLongTimeoutServices.<ConjureTimelockServiceBlocking>builder() .longTimeout(longTimeoutService) .shortTimeout(shortTimeoutService) .build() .map(proxy -> FastFailoverProxy.newProxyInstance(ConjureTimelockServiceBlocking.class, () -> proxy)) .map(service -> AtlasDbMetrics.instrumentWithTaggedMetrics( taggedMetricRegistry, ConjureTimelockServiceBlocking.class, service)) .map(instrumentedService -> new DialogueAdaptingConjureTimelockService(instrumentedService, conjureTimelockServiceBlockingMetrics)); return new TimeoutSensitiveConjureTimelockService(shortAndLongTimeoutServices); }
AtlasDbDialogueServiceProvider { ConjureTimelockService getConjureTimelockService() { ConjureTimelockServiceBlocking longTimeoutService = dialogueClientFactory.get(ConjureTimelockServiceBlocking.class, TIMELOCK_LONG_TIMEOUT); ConjureTimelockServiceBlocking shortTimeoutService = dialogueClientFactory.get(ConjureTimelockServiceBlocking.class, TIMELOCK_SHORT_TIMEOUT); ConjureTimelockServiceBlockingMetrics conjureTimelockServiceBlockingMetrics = ConjureTimelockServiceBlockingMetrics.of(taggedMetricRegistry); ShortAndLongTimeoutServices<ConjureTimelockService> shortAndLongTimeoutServices = ImmutableShortAndLongTimeoutServices.<ConjureTimelockServiceBlocking>builder() .longTimeout(longTimeoutService) .shortTimeout(shortTimeoutService) .build() .map(proxy -> FastFailoverProxy.newProxyInstance(ConjureTimelockServiceBlocking.class, () -> proxy)) .map(service -> AtlasDbMetrics.instrumentWithTaggedMetrics( taggedMetricRegistry, ConjureTimelockServiceBlocking.class, service)) .map(instrumentedService -> new DialogueAdaptingConjureTimelockService(instrumentedService, conjureTimelockServiceBlockingMetrics)); return new TimeoutSensitiveConjureTimelockService(shortAndLongTimeoutServices); } }
AtlasDbDialogueServiceProvider { ConjureTimelockService getConjureTimelockService() { ConjureTimelockServiceBlocking longTimeoutService = dialogueClientFactory.get(ConjureTimelockServiceBlocking.class, TIMELOCK_LONG_TIMEOUT); ConjureTimelockServiceBlocking shortTimeoutService = dialogueClientFactory.get(ConjureTimelockServiceBlocking.class, TIMELOCK_SHORT_TIMEOUT); ConjureTimelockServiceBlockingMetrics conjureTimelockServiceBlockingMetrics = ConjureTimelockServiceBlockingMetrics.of(taggedMetricRegistry); ShortAndLongTimeoutServices<ConjureTimelockService> shortAndLongTimeoutServices = ImmutableShortAndLongTimeoutServices.<ConjureTimelockServiceBlocking>builder() .longTimeout(longTimeoutService) .shortTimeout(shortTimeoutService) .build() .map(proxy -> FastFailoverProxy.newProxyInstance(ConjureTimelockServiceBlocking.class, () -> proxy)) .map(service -> AtlasDbMetrics.instrumentWithTaggedMetrics( taggedMetricRegistry, ConjureTimelockServiceBlocking.class, service)) .map(instrumentedService -> new DialogueAdaptingConjureTimelockService(instrumentedService, conjureTimelockServiceBlockingMetrics)); return new TimeoutSensitiveConjureTimelockService(shortAndLongTimeoutServices); } private  AtlasDbDialogueServiceProvider(DialogueClients.ReloadingFactory dialogueClientFactory,
            TaggedMetricRegistry taggedMetricRegistry); }
AtlasDbDialogueServiceProvider { ConjureTimelockService getConjureTimelockService() { ConjureTimelockServiceBlocking longTimeoutService = dialogueClientFactory.get(ConjureTimelockServiceBlocking.class, TIMELOCK_LONG_TIMEOUT); ConjureTimelockServiceBlocking shortTimeoutService = dialogueClientFactory.get(ConjureTimelockServiceBlocking.class, TIMELOCK_SHORT_TIMEOUT); ConjureTimelockServiceBlockingMetrics conjureTimelockServiceBlockingMetrics = ConjureTimelockServiceBlockingMetrics.of(taggedMetricRegistry); ShortAndLongTimeoutServices<ConjureTimelockService> shortAndLongTimeoutServices = ImmutableShortAndLongTimeoutServices.<ConjureTimelockServiceBlocking>builder() .longTimeout(longTimeoutService) .shortTimeout(shortTimeoutService) .build() .map(proxy -> FastFailoverProxy.newProxyInstance(ConjureTimelockServiceBlocking.class, () -> proxy)) .map(service -> AtlasDbMetrics.instrumentWithTaggedMetrics( taggedMetricRegistry, ConjureTimelockServiceBlocking.class, service)) .map(instrumentedService -> new DialogueAdaptingConjureTimelockService(instrumentedService, conjureTimelockServiceBlockingMetrics)); return new TimeoutSensitiveConjureTimelockService(shortAndLongTimeoutServices); } private  AtlasDbDialogueServiceProvider(DialogueClients.ReloadingFactory dialogueClientFactory,
            TaggedMetricRegistry taggedMetricRegistry); static AtlasDbDialogueServiceProvider create(
            Refreshable<ServerListConfig> timeLockServerListConfig,
            DialogueClients.ReloadingFactory baseFactory,
            UserAgent userAgent,
            TaggedMetricRegistry taggedMetricRegistry); }
AtlasDbDialogueServiceProvider { ConjureTimelockService getConjureTimelockService() { ConjureTimelockServiceBlocking longTimeoutService = dialogueClientFactory.get(ConjureTimelockServiceBlocking.class, TIMELOCK_LONG_TIMEOUT); ConjureTimelockServiceBlocking shortTimeoutService = dialogueClientFactory.get(ConjureTimelockServiceBlocking.class, TIMELOCK_SHORT_TIMEOUT); ConjureTimelockServiceBlockingMetrics conjureTimelockServiceBlockingMetrics = ConjureTimelockServiceBlockingMetrics.of(taggedMetricRegistry); ShortAndLongTimeoutServices<ConjureTimelockService> shortAndLongTimeoutServices = ImmutableShortAndLongTimeoutServices.<ConjureTimelockServiceBlocking>builder() .longTimeout(longTimeoutService) .shortTimeout(shortTimeoutService) .build() .map(proxy -> FastFailoverProxy.newProxyInstance(ConjureTimelockServiceBlocking.class, () -> proxy)) .map(service -> AtlasDbMetrics.instrumentWithTaggedMetrics( taggedMetricRegistry, ConjureTimelockServiceBlocking.class, service)) .map(instrumentedService -> new DialogueAdaptingConjureTimelockService(instrumentedService, conjureTimelockServiceBlockingMetrics)); return new TimeoutSensitiveConjureTimelockService(shortAndLongTimeoutServices); } private  AtlasDbDialogueServiceProvider(DialogueClients.ReloadingFactory dialogueClientFactory,
            TaggedMetricRegistry taggedMetricRegistry); static AtlasDbDialogueServiceProvider create(
            Refreshable<ServerListConfig> timeLockServerListConfig,
            DialogueClients.ReloadingFactory baseFactory,
            UserAgent userAgent,
            TaggedMetricRegistry taggedMetricRegistry);  }