public void TestLoadedServiceFactoryConfigurationSection() { ServiceFactoryConfigurationSection section = ServiceFactory.LoadServiceFactoryConfiguration(); Assert.AreEqual(section.Type, ServiceFactoryType.Local); Assert.AreEqual(section.ServiceMQName, "testServiceFactory"); }
//[TestMethod] public void TestCreateServiceFactoryConfigurationSection() { ServiceFactoryConfigurationSection section = new ServiceFactoryConfigurationSection(); Configuration config = ConfigurationManager.OpenMachineConfiguration(); config.Sections.Add("serviceFactory", section); config.SaveAs("c:\\test.config"); }
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(); }
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(); }