Package velox.api.layer1.layers
Interface Layer1ApiTimeSource
- All Known Implementing Classes:
Layer1ApiDepthFreezer,Layer1ApiInjectorRelay,Layer1ApiRelay,Layer1ApiStrategiesEchoMessagesLayer
public interface Layer1ApiTimeSource
Allows taking a shortcut when responding to
Layer1ApiAdminProvider.getCurrentTime(). See
Layer1ApiRelay.getTimeSource() to understand the mechanism. In short:
even if layer implemented Layer1ApiAdminProvider.getCurrentTime() it can
still allow a shortcut by implementing this interface.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic @interfaceMarkLayer1ApiAdminProvider.getCurrentTime()implementation with this to confirm you are supporting the shortcut -
Method Summary
Modifier and TypeMethodDescriptionReturns the provider whoseLayer1ApiAdminProvider.getCurrentTime()should be called instead of this layer's own.static Layer1ApiProvidergetTimeSource(Layer1ApiProvider provider) Resolves the effective time source ofprovider.
-
Method Details
-
getTimeSource
Layer1ApiProvider getTimeSource()Returns the provider whoseLayer1ApiAdminProvider.getCurrentTime()should be called instead of this layer's own. For a pass-through layer this is the nearest layer below that does not allow the shortcut, i.e. the one that really knows the time. Callers cache the result, so it must not change during the layer's lifetime. -
getTimeSource
Resolves the effective time source ofprovider. If itsgetCurrentTime()is annotated withLayer1ApiTimeSource.Layer1TimeSourceShortcutAllowed, delegates togetTimeSource()of that provider (recursing down the chain). Otherwise,provideritself is the time source.
-