Ejemplo n.º 1
0
        public void TestLoadedServiceFactoryConfigurationSection()
        {
            ServiceFactoryConfigurationSection section = ServiceFactory.LoadServiceFactoryConfiguration();

            Assert.AreEqual(section.Type, ServiceFactoryType.Local);
            Assert.AreEqual(section.ServiceMQName, "testServiceFactory");
        }
Ejemplo n.º 2
0
        //[TestMethod]
        public void TestCreateServiceFactoryConfigurationSection()
        {
            ServiceFactoryConfigurationSection section = new ServiceFactoryConfigurationSection();
            Configuration config = ConfigurationManager.OpenMachineConfiguration();

            config.Sections.Add("serviceFactory", section);
            config.SaveAs("c:\\test.config");
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            ServiceFactoryConfigurationSection config = ServiceFactory.LoadServiceFactoryConfiguration();
            LogHandler logger = (config.Debug ? new LogHandler(Console.WriteLine) : null);

            ServiceFactory.Create().OnLog += logger;

            Console.WriteLine("Service host started...");
            Console.WriteLine("Logger Status: " + (config.Debug ? "On" : "Off"));
            Console.WriteLine("Press any key to exit and stop host...");
            Console.ReadLine();
        }
Ejemplo n.º 4
0
        static void Main(string[] args)
        {
            ServiceFactoryConfigurationSection config = ServiceFactory.LoadServiceFactoryConfiguration();

            LogHandler      logger = (config.Debug ? new LogHandler(Console.WriteLine) : null);
            MemoryServiceMQ mq     = new MemoryServiceMQ();

            mq.OnLog += logger;

            RemotingServiceHelper rh =
                new RemotingServiceHelper(config.Protocol, config.Server, config.Port);

            rh.OnLog += logger;
            rh.PublishWellKnownServiceInstance(config.ServiceMQName, typeof(IServiceMQ), mq, System.Runtime.Remoting.WellKnownObjectMode.Singleton);

            Console.WriteLine("Service MQ Server started...");
            Console.WriteLine("Logger Status: " + (config.Debug ? "On" : "Off"));
            Console.WriteLine("Press any key to exit and stop server...");
            Console.ReadLine();
        }