protected override void OnStart(string[] args) { Logger.Current.BinaryFileTraceLevel = TracerX.TraceLevel.Verbose; Logger.DefaultBinaryFile.Open(); IKernel kernel = new StandardKernel(new AutoMapperModule(), new BusinessModule(), new NHibernateModule(), new WCFModule()); _serviceManager = kernel.Get<ServiceManager>(); _serviceThread = new Thread(_serviceManager.RunServiceManager); _serviceThread.Start(); _host = getServiceHost(kernel,typeof(ILocationService), new Uri("http://localhost:9090/Jimbe")); _host.Open(); }
protected override void OnStop() { if (_serviceThread.IsAlive && _serviceManager!=null) { _serviceManager.RequestStop(); _serviceThread.Join(); _serviceThread = null; _serviceManager = null; } if(_host!=null) { _host.Close(); _host = null; } }
public LocationService(IRepositoryFactory repositoryFactory, ServiceManager serviceManager, IMappingEngine engine) { _repositoryFactory = repositoryFactory; _serviceManager = serviceManager; _engine = engine; }