public void TestPinkoServiceContainerRegisterCalcEngineExtra()
        {
            var pinkoServiceContainer = new PinkoServiceContainer();
            var pinkoContainer = pinkoServiceContainer.BuildContainer();
            pinkoServiceContainer.RegisterCalcEngineExtra(pinkoContainer);

            Assert.IsNotNull(pinkoContainer.Resolve<IPinkoExpressionEngine>());
            Assert.IsNotNull(pinkoContainer.Resolve<IRxMemoryBus<PinkoExceptionDataNotSubscribed>>());

            Assert.IsNotNull(pinkoContainer.Resolve<InboundMessageReactiveListener<PinkoMsgCalculateExpression>>());
            Assert.IsNotNull(pinkoContainer.Resolve<InboundMessageReactiveListener<PinkoMsgPing>>());

            Assert.IsNotNull(pinkoContainer.Resolve<RoleBusListenerPinkoPingMessageHandle>());
            Assert.IsNotNull(pinkoContainer.Resolve<RoleUserSubscriptionHandler>());
            Assert.IsNotNull(pinkoContainer.Resolve<RoleCalculateExpressionSnapshotHandler>());
            Assert.IsNotNull(pinkoContainer.Resolve<RoleCalculateSubsCalcExpressionHandler>());

            var msgHandler = pinkoContainer.Resolve<IIncominBusMessageHandlerManager>() as IncominBusMessageHandlerManager;
            Assert.IsNotNull(msgHandler);

            Assert.IsTrue(msgHandler.CachedBusPublisher.Values.Count(x => x is InboundTypedPublisher<IBusMessageInbound, PinkoMsgClientTimeout>) == 1);
            Assert.IsTrue(msgHandler.CachedBusPublisher.Values.Count(x => x is InboundTypedPublisher<IBusMessageInbound, PinkoMsgCalculateExpression>) == 1);
            Assert.IsTrue(msgHandler.CachedBusPublisher.Values.Count(x => x is InboundTypedPublisher<IBusMessageInbound, PinkoMsgClientConnect>) == 1);
            Assert.IsTrue(msgHandler.CachedBusPublisher.Values.Count(x => x is InboundTypedPublisher<IBusMessageInbound, PinkoMsgPing>) == 1);
            //Assert.IsTrue(msgHandler.CachedBusPublisher.Values.Count(x => x is InboundTypedPublisher<IBusMessageInbound, string>) == 1);
            Assert.IsTrue(msgHandler.CachedBusPublisher.Values.Count(x => x is InboundTypedPublisher<IBusMessageInbound, PinkoMsgRoleHeartbeat>) == 1);
            Assert.IsTrue(msgHandler.CachedBusPublisher.Values.Count(x => x is InboundTypedPublisher<IBusMessageInbound, PinkoMsgCalculateExpressionResult>) == 1);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Worker Role OnStart()
        /// </summary>
        /// <returns></returns>
        public override bool OnStart()
        {
            var rtn = base.OnStart();
            var pinkoServiceContainer = new PinkoServiceContainer();

            PinkoContainer = pinkoServiceContainer.BuildContainer();  // Real Container

            PinkoApplication = PinkoContainer.Resolve<IPinkoApplication>();
            PinkoConfiguration = PinkoContainer.Resolve<IPinkoConfiguration>();
            WorkerRoleFrame = PinkoContainer.Resolve<IWorkerRoleFrame>();

            pinkoServiceContainer.RegisterCalcEngineExtra(PinkoContainer);

            return rtn;
        }
Exemplo n.º 3
0
        /// <summary>
        /// Worker Role OnStart()
        /// </summary>
        /// <returns></returns>
        public override bool OnStart()
        {
            ServicePointManager.DefaultConnectionLimit = 12;

            var rtn = base.OnStart();
            var pinkoServiceContainer = new PinkoServiceContainer();

            PinkoContainer = pinkoServiceContainer.BuildContainer();  // Real Container

            PinkoApplication = PinkoContainer.Resolve<IPinkoApplication>();
            PinkoConfiguration = PinkoContainer.Resolve<IPinkoConfiguration>();
            WorkerRoleFrame = PinkoContainer.Resolve<IWorkerRoleFrame>();

            pinkoServiceContainer.RegisterSubscriptionManagerWorkerExtra(PinkoContainer);

            return rtn;
        }