Esempio n. 1
0
 void CreateDirectoryMonitor()
 {
     var message = new CreateShelfService("TopShelf.DirectoryMonitor",
                                          ShelfType.Internal,
                                          typeof(DirectoryMonitorBootstrapper));
     _serviceChannel.Send(message);
 }
Esempio n. 2
0
        void CreateDirectoryMonitor()
        {
            var message = new CreateShelfService("TopShelf.DirectoryMonitor",
                                                 ShelfType.Internal,
                                                 typeof(DirectoryMonitorBootstrapper));

            _serviceChannel.Send(message);
        }
Esempio n. 3
0
        void OnCreateShelfService(CreateShelfService message)
        {
            _log.InfoFormat("[Topshelf] Create Shelf Service: {0}{1}", message.ServiceName,
                            message.BootstrapperType == null
                                                ? ""
                                                : " ({0})".FormatWith(message.BootstrapperType.ToShortTypeName()));

            ActorFactory <IServiceController> factory = _controllerFactory.CreateFactory(inbox =>
            {
                IServiceController controller = new ShelfServiceController(inbox, message.ServiceName, this, message.ShelfType,
                                                                           message.BootstrapperType, message.AssemblyNames);
                _serviceCache.Add(message.ServiceName, controller);

                return(controller);
            });

            ActorInstance instance = factory.GetActor();

            _actorCache.Add(message.ServiceName, instance);

            instance.Send(new CreateService(message.ServiceName));
        }