/// <summary>
        /// 
        /// </summary>
        public override bool ArbiterUnInitialize()
        {
            // Unregister.
            RegisterSourceMessage register = new RegisterSourceMessage(false);
            register.RequestResponce = false;
            this.Send(register);

            //ChangeOperationalState(OperationalStateEnum.UnInitialized);
            return base.ArbiterUnInitialize();
        }
Exemple #2
0
        /// <summary>
        ///
        /// </summary>
        public override bool ArbiterUnInitialize()
        {
            // Unregister.
            RegisterSourceMessage register = new RegisterSourceMessage(false);

            register.RequestResponce = false;
            this.Send(register);

            //ChangeOperationalState(OperationalStateEnum.UnInitialized);
            return(base.ArbiterUnInitialize());
        }
Exemple #3
0
        public void RegisterSource()
        {
            RegisterSourceMessage message = new RegisterSourceMessage(true);

            message.SourceType      = SourceTypeEnum.DataProvider | SourceTypeEnum.Live | SourceTypeEnum.HighPriority;
            message.RequestResponse = false;

            SendAddressed(_integrationServer.SubscriptionClientID, message);

            message                 = new RegisterSourceMessage(true);
            message.SourceType      = SourceTypeEnum.OrderExecution | SourceTypeEnum.Live;
            message.RequestResponse = false;

            SendAddressed(_integrationServer.SubscriptionClientID, message);
        }
        /// <summary>
        /// 
        /// </summary>
        public override bool ArbiterInitialize(Arbiter.Arbiter arbiter)
        {
            if (base.ArbiterInitialize(arbiter) == false)
            {
                return false;
            }

            //ChangeOperationalState(OperationalStateEnum.Operational);

            RegisterSourceMessage register = new RegisterSourceMessage(_sourceType, true);
            register.RequestResponce = false;
            this.Send(register);

            return true;
        }
Exemple #5
0
        /// <summary>
        ///
        /// </summary>
        public override bool ArbiterInitialize(Arbiter.Arbiter arbiter)
        {
            if (base.ArbiterInitialize(arbiter) == false)
            {
                return(false);
            }

            //ChangeOperationalState(OperationalStateEnum.Operational);

            RegisterSourceMessage register = new RegisterSourceMessage(_sourceType, true);

            register.RequestResponce = false;
            this.Send(register);

            return(true);
        }
        public override bool ArbiterUnInitialize()
        {
            RegisterSourceMessage register = new RegisterSourceMessage(false);

            register.RequestResponce = false;
            this.Send(register);

            if (_integrationClient != null)
            {
                lock (this)
                {
                    if (Arbiter != null)
                    {
                        Arbiter.RemoveClient(_integrationClient);
                    }

                    _integrationClient.ConnectionStatusChangedEvent -= new TransportIntegrationClient.ConnectionStatusChangedDelegate(_integrationClient_ConnectionStatusChangedEvent);
                    _integrationClient = null;
                }
            }

            return(base.ArbiterUnInitialize());
        }
Exemple #7
0
        protected ResponceMessage Receive(RegisterSourceMessage message)
        {
            if (message.Register)
            {// Registration.
                if (message.SourceType.HasValue == false)
                {
                    SystemMonitor.OperationWarning("Source type not specified.");
                    if (message.RequestResponce)
                    {
                        return(new ResponceMessage(false)
                        {
                            ResultMessage = "Source type not specified."
                        });
                    }
                }

                _sources.Register(new SourceInfo(message.SourceType.Value, message.TransportInfo));
            }
            else
            {// Unregistration.
                _sources.UnRegister(message.SourceType, message.TransportInfo);
            }

            this.Send(new SourcesUpdateMessage(new List <SourceInfo>(_sources.SourcesArray), true));

            if (SourcesUpdateEvent != null)
            {
                SourcesUpdateEvent(this);
            }

            if (message.RequestResponce)
            {
                return(new ResponceMessage(true));
            }

            return(null);
        }
        void Receive(RegisterSourceMessage message)
        {
            _proxyTransportInfo = message.TransportInfo;

            RegisterSourceMessage localRegistrationMessage = new RegisterSourceMessage(
                message.SourceType.Value, message.Register);

            localRegistrationMessage.RequestResponce = false;

            this.Send(localRegistrationMessage);

            if (OperationalState != OperationalStateEnum.Operational)
            {
                if (OperationalState == OperationalStateEnum.Initializing ||
                    OperationalState == OperationalStateEnum.Initialized)
                {
                    ChangeOperationalState(OperationalStateEnum.Operational);
                }
                else
                {
                    SystemMonitor.OperationError("Adapter received a subscription confirmation, but not in expected state.");
                }
            }
        }
        public void RegisterSource()
        {
            RegisterSourceMessage message = new RegisterSourceMessage(true);
            message.SourceType = SourceTypeEnum.DataProvider | SourceTypeEnum.Live | SourceTypeEnum.HighPriority;
            message.RequestResponce = false;

            SendAddressed(_integrationServer.SubscriptionClientID, message);

            message = new RegisterSourceMessage(true);
            message.SourceType = SourceTypeEnum.OrderExecution | SourceTypeEnum.Live;
            message.RequestResponce = false;

            SendAddressed(_integrationServer.SubscriptionClientID, message);
        }
        void Receive(RegisterSourceMessage message)
        {
            _proxyTransportInfo = message.TransportInfo;

            RegisterSourceMessage localRegistrationMessage = new RegisterSourceMessage(
                message.SourceType.Value, message.Register);

            localRegistrationMessage.RequestResponce = false;

            this.Send(localRegistrationMessage);

            if (OperationalState != OperationalStateEnum.Operational)
            {
                if (OperationalState == OperationalStateEnum.Initializing
                    || OperationalState == OperationalStateEnum.Initialized)
                {

                    ChangeOperationalState(OperationalStateEnum.Operational);
                }
                else
                {
                    SystemMonitor.OperationError("Adapter received a subscription confirmation, but not in expected state.");
                }
            }
        }
        public override bool ArbiterUnInitialize()
        {
            RegisterSourceMessage register = new RegisterSourceMessage(false);
            register.RequestResponce = false;
            this.Send(register);

            if (_integrationClient != null)
            {
                lock (this)
                {
                    if (Arbiter != null)
                    {
                        Arbiter.RemoveClient(_integrationClient);
                    }

                    _integrationClient.ConnectionStatusChangedEvent -= new TransportIntegrationClient.ConnectionStatusChangedDelegate(_integrationClient_ConnectionStatusChangedEvent);
                    _integrationClient = null;
                }
            }

            return base.ArbiterUnInitialize();
        }
        protected ResponseMessage Receive(RegisterSourceMessage message)
        {
            if (message.Register)
            {// Registration.
                if (message.SourceType.HasValue == false)
                {
                    SystemMonitor.OperationWarning("Source type not specified.");
                    if (message.RequestResponse)
                    {
                        return new ResponseMessage(false) { ResultMessage = "Source type not specified." };
                    }
                }

                _sources.Register(new SourceInfo(message.SourceType.Value, message.TransportInfo));
            }
            else
            {// Unregistration.
                _sources.UnRegister(message.SourceType, message.TransportInfo);
            }

            this.Send(new SourcesUpdateMessage(new List<SourceInfo>(_sources.SourcesArray), true));

            if (SourcesUpdateEvent != null)
            {
                SourcesUpdateEvent(this);
            }

            if (message.RequestResponse)
            {
                return new ResponseMessage(true);
            }

            return null;
        }