Class FXPostAllocationAdapter


  • public class FXPostAllocationAdapter
    extends java.lang.Object

    An FXPostAllocationAdapter services trading capabalities for Post Allocations. This includes allocation of ESP, RFS and Limit Order trades that meet the criteria for allocation.

    Typically, an FXPostAllocationAdapter will be set up as follows:

     FXTradeAdapter tradeAdapter = new FXTradeAdapter(dataSource);
     FXPostAllocationAdapter fxPostAllocationAdapter = new FXPostAllocationAdapter(tradeAdapter);
    
     PostTradeAllocationListenerFactory factory = new MyPostTradeAllocationListenerFactoryImpl();
     fxPostAllocationAdapter.registerPostAllocationTradeListenerFactory(factory);
     

    Typically the same tradeAdapter that was passed to your FXOrdersAdapter will also be passed to the FXPostAllocationAdapter

    • Constructor Detail

      • FXPostAllocationAdapter

        public FXPostAllocationAdapter​(com.caplin.datasource.DataSource dataSource)
                                throws java.io.IOException
        Constructs the FXPostAllocationAdapter that will utilise the specified Datasource and its configuration for communication with the Motif.

        Uses a default ThreadMode of ThreadMode.SharedThreads

        Parameters:
        dataSource - The Datasource that will be used to receive requests for Post Allocation trades.
        Throws:
        java.io.IOException - if an error occurred reading configuration files for the adapter.
      • FXPostAllocationAdapter

        public FXPostAllocationAdapter​(com.caplin.datasource.DataSource dataSource,
                                       ThreadMode threadMode)
                                throws java.io.IOException
        Constructs the FXPostAllocationAdapter that will utilise the specified Datasource and its configuration for communication with the Motif.
        Parameters:
        dataSource - The Datasource that will be used to receive requests for Post Allocation trades.
        threadMode - The thread mode to use for trades being made through the Adapter.
        Throws:
        java.io.IOException - if an error occurred reading configuration files for the adapter.
      • FXPostAllocationAdapter

        public FXPostAllocationAdapter​(TradeAdapter tradeAdapter)
        Constructs the FXPostAllocationAdapter that will utilise the specified TradingAdapter and it's underlying Datasource configuration for communication with the Motif.
        Parameters:
        tradeAdapter - The TradeAdapter containing the Datasource that will be used to receive requests for Post Allocation trades.
    • Method Detail

      • registerPostAllocationTradeListenerFactory

        public void registerPostAllocationTradeListenerFactory​(PostTradeAllocationListenerFactory factory)
        Registers a factory that will listen to Post Allocation workflows initiated from the client.
        Parameters:
        factory - The factory that will be asked to create the PostTradeAllocationListener
      • registerPostAllocationTradeViewListener

        public void registerPostAllocationTradeViewListener​(SubjectParser<AllocationViewEvent> subjectParser,
                                                            PostTradeAllocationViewListener listener)
        Registers the listener that will service the request to view the details of already allocated trades.

        Also registers a parser that will parse the request to a domain specific object.

        Parameters:
        subjectParser - The parser that will parse the clients request to view allocations into a domain specific object.
        listener - The listener that will be called to service the request to view details of already allocated trades.
      • registerPostAllocationTradeViewListener

        public void registerPostAllocationTradeViewListener​(PostTradeAllocationViewListener listener)
        Registers the listener that will service the request to view the details of already allocated trades.
        Parameters:
        listener - The listener that will be called to service the request to view details of already allocated trades.