public void StartUp() { _applicationController = ContextRegistry.GetContext()["ApplicationController"] as ApplicationController; if (_applicationController != null) { _applicationController.StartServer(); } _service = ContextRegistry.GetContext()["OrderExecutionService"] as OrderExecutionService; }
/// <summary> /// Argument Constructor /// </summary> /// <param name="orderExecutionService">Provides communication access with Order Execution Server</param> public OrderExecutionManager(OrderExecutionService orderExecutionService) { // Save object reference _orderExecutionService = orderExecutionService; SubscribeExecutionServiceEvents(); // Start Service _orderExecutionService.StartService(); }
/// <summary> /// Argument Constructor /// </summary> /// <param name="orderExecutionService">Provides communication access with Order Execution Server</param> public OrderExecutionController(OrderExecutionService orderExecutionService) { // Initialize Manager _orderExecutionManager = new OrderExecutionManager(orderExecutionService); // Intialize local maps _providersMap = new Dictionary <string, OrderExecutionProvider>(); // Subscribe Application events SubscribeEvents(); // Subscribe Order Execution Manager events SubscribeManagerEvents(); }
private static void ProcessAllOrders(IDictionary <Guid, IOrder> orders) { OrderProcessingService orderProcessingService = new OrderProcessingService(); IOrderExecutionService orderExecutionService = new OrderExecutionService(); MembershipProcessingStrategy membershipProcessingStrategy = new MembershipProcessingStrategy(orderExecutionService); ProductOrderProcessingStrategy productOrderProcessingStrategy = new ProductOrderProcessingStrategy(orderExecutionService); VideoRequestProcessingStrategy videoRquestProcessingStrategy = new VideoRequestProcessingStrategy(orderExecutionService); Console.WriteLine("\n\t\t---------------------------------------------\n"); Console.WriteLine("\n\t\t*********************************************\n"); Console.WriteLine("\n\t\t* PROCESSING ALL THE PLACED ORDERS *\n"); try { foreach (KeyValuePair <Guid, IOrder> kvp in orders) { string name = kvp.Value.GetType().Name.ToUpper(); switch ((OrderType)Enum.Parse(typeof(OrderType), name)) { case OrderType.MEMBERSHIP: orderProcessingService.SetOrderProcessingStrategy(membershipProcessingStrategy); orderProcessingService.ProcessOrder(kvp.Value); break; case OrderType.PRODUCT: orderProcessingService.SetOrderProcessingStrategy(productOrderProcessingStrategy); orderProcessingService.ProcessOrder(kvp.Value); break; case OrderType.VIDEO: orderProcessingService.SetOrderProcessingStrategy(videoRquestProcessingStrategy); orderProcessingService.ProcessOrder(kvp.Value); break; default: break; } } } catch (Exception ex) { Console.WriteLine(ex.Message); } Console.WriteLine("\n\t\t*********************************************\n"); Console.WriteLine("\n\t\t---------------------------------------------\n"); Console.WriteLine("\n\t\t* ALL ORDERS HAS BEEN PROCESSED *\n"); }
public void Setup() { // Initialize and Start Order Execution Engine Server _oEapplicationController = ContextRegistry.GetContext()["ApplicationController"] as OeApplicationController; if (_oEapplicationController != null) { _oEapplicationController.StartServer(); } Thread.Sleep(1000); // Initialize and Start Position Engine Server _applicationController = new ApplicationController(new PositionEngineMqServer("PEMQConfig.xml"), new PositionMessageProcessor()); if (_applicationController != null) { _applicationController.StartServer(); } // Initialize Position Engine Service _positionEngineService = ContextRegistry.GetContext()["PositionEngineService"] as PositionEngineService; // Initialize Order Execution Service _orderExecutionService = ContextRegistry.GetContext()["OrderExecutionService"] as OrderExecutionService; }