Пример #1
0
 public AddOrder(CommandFactory commandFactory,
                 IFixMessageGenerator fixMessageGenerator,
                 OrderMediator orderMediator,
                 FixSessionID sessionID,
                 OrderData orderData,
                 string execID)
 {
     _commandFactory = commandFactory;
     _fixMessageGenerator = fixMessageGenerator;
     _orderMediator = orderMediator;
     _sessionID = sessionID;
     _orderData = orderData;
     _execID = execID;
 }
Пример #2
0
 public CancelOrder(CommandFactory commandFactory,
                    IFixMessageGenerator messageGenerator,
                    OrderMediator orderMediator,
                    FixSessionID sessionID,
                    long orderID,
                    string clOrdID,
                    string origClOrdID,
                    string execID)
 {
     _commandFactory = commandFactory;
     _messageGenerator = messageGenerator;
     _orderMediator = orderMediator;
     _sessionID = sessionID;
     _orderID = orderID;
     _clOrdID = clOrdID;
     _origClOrdID = origClOrdID;
     _execID = execID;
 }
Пример #3
0
        public ServerApplication(Action<string> messageCallback)
        {
            _messageCallback = messageCallback;

            // Were this a production server I'd recommend getting all these types from a
            // type provider layer (MEF, Castle, etc)
            var sessionRepository = new SessionRepository();
            var fixSessionFacade = new StandardFixFacade(messageCallback);
            _sessionMediator = new SessionMediator(sessionRepository, fixSessionFacade);

            _inputQueue = new CommandQueue();
            _outputQueue = new CommandQueue();

            var asyncProcessing = new TaskBasedCommandProcessingStrategy();
            var syncProcessing = new SynchronousCommandProcessingStrategy();
            _inputCommandProcessor = new CommandProcessor(asyncProcessing, _inputQueue);
            _outputCommandProcessor = new CommandProcessor(syncProcessing, _outputQueue);

            var orderMatcher = new StandardOrderMatcher();
            var orderRepository = new StandardOrderRepository(orderMatcher);
            _orderMediator = new OrderMediator(orderRepository, OnOrderMatched);

            _commandFactory = new CommandFactory(_inputQueue,
                                                 _outputQueue,
                                                 _orderMediator,
                                                 _sessionMediator);

            var messageHandlerCommandFactory = new MessageHandlerCommandFactory(_sessionMediator,
                                                                                _commandFactory);

            var fix42MessageGenerator = new Fix42MessageGenerator();
            _fix42MessageHandler = new Fix42MessageHandler(messageHandlerCommandFactory,
                                                           fix42MessageGenerator,
                                                           fixSessionFacade,
                                                           GenExecID);

            var fix44MessageGenerator = new Fix44MessageGenerator();
            _fix44MessageHandler = new Fix44MessageHandler(messageHandlerCommandFactory,
                                                           fix44MessageGenerator,
                                                           fixSessionFacade,
                                                           GenExecID);
        }
 public MessageHandlerCommandFactory(SessionMediator sessionMediator,
                                     CommandFactory commandFactory)
 {
     _sessionMediator = sessionMediator;
     _commandFactory = commandFactory;
 }