Class Layer1ApiStrategiesEchoMessagesLayer

All Implemented Interfaces:
AutoCloseable, Layer1ApiAdminListenable, Layer1ApiAdminListener, Layer1ApiAdminProvider, Layer1ApiDataListenable, Layer1ApiDataListener, Layer1ApiDataProvider, Layer1ApiInstrumentListenable, Layer1ApiInstrumentListener, Layer1ApiInstrumentProvider, Layer1ApiListener, Layer1ApiMboDataListenable, Layer1ApiMboDataListener, Layer1ApiProvider, Layer1ApiTradingListenable, Layer1ApiTradingListener, Layer1ApiTradingProvider, LayerApiListenable, Layer1ApiTimeSource

public class Layer1ApiStrategiesEchoMessagesLayer extends Layer1ApiInjectorRelay
If message of type Layer1ApiStrategiesEchoMessagesLayer.StrategyEchoMessage is sent using Layer1ApiAdminProvider.sendUserMessage(Object) Layer1ApiStrategiesEchoMessagesLayer will send it back with Layer1ApiAdminListener.onUserMessage(Object)} It will be done in ASYNCHRONOUS manner. It will still be in sync with data coming from provider, but sendUserMessage will likely return before the message reaches the target.
  • Constructor Details

    • Layer1ApiStrategiesEchoMessagesLayer

      public Layer1ApiStrategiesEchoMessagesLayer(Layer1ApiProvider provider)
  • Method Details

    • sendUserMessage

      public Object sendUserMessage(Object data)
      Description copied from interface: Layer1ApiAdminProvider
      Send a downstream event. Allows incorporating arbitrary functionality into protocol.

      This is the extension point of the downstream direction: the caller hands an arbitrary object to the layer below, which either handles it or passes it further down. The counterpart for the upstream direction is Layer1ApiAdminListener.onUserMessage(Object).

      The call is synchronously propagated downstream. It must eventually be consumed by a layer, that will stop propagation and return the result back upwards. Layers are also allowed to alter it without consuming. Layers that do not recognize a message must forward it unchanged (see Layer1ApiRelay). Messages that implement Layer1ApiIgnorableDownwardMessage may reach the bottom of the stack unhandled. All others throw if unhandled.

      Some messages are requests whose reply is not the return value but an upstream onUserMessage that arrives later, possibly after this method has returned.

      Specified by:
      sendUserMessage in interface Layer1ApiAdminProvider
      Overrides:
      sendUserMessage in class Layer1ApiRelay
      Parameters:
      data - Message content, never null
      Returns:
      response of the handling layer, or null if the message has no synchronous response or nobody handled it