public UsageView(ICustomer client, string question = "", bool emptyResponse = false, Style style = null) { coordinator = CoordinatorManager.Instance.CoordinatorOfType <IServiceCoordinator>(); #region Precondizioni if (client == null) { throw new ArgumentNullException("client null"); } if (question == null) { throw new ArgumentNullException("question null"); } if (coordinator == null) { throw new InvalidOperationException("Il coordinatore degli utilizzi non è disponibile"); } #endregion InitializeComponent(); _client = client; _question.Text = question; _emptyResponse = emptyResponse; _usageList = _view; _usages = coordinator.Usages; ActiveControl = _view; this.ApplyStyle(style); }
public PacketManagerPresenter(PacketManagerView view) { #region Precondizioni if (view == null) { throw new ArgumentNullException("view null"); } #endregion view.AddButton.Click += AddHandler; if (view.RetrieveTagInformation <AuthorizationLevel>("authorizationLevel") < AuthorizationLevel.BASIC_STAFF) { view.ActionPanel.Enabled = false; view.ActionPanel.Visible = false; } _packetList = view.ListView; coordinator = CoordinatorManager.Instance.CoordinatorOfType <IServiceCoordinator>(); if (coordinator == null) { throw new InvalidOperationException("Il coordinatore dei paccheti non è disponibile"); } _packets = coordinator.Packets; coordinator.ServiceChanged += ServiceChangedHandler; // Popolo la list view all'avvio ServiceChangedHandler(this, EventArgs.Empty); }
public ShutdownHandler( ISubscriptionManager subscriptionManager, IServiceCoordinator serviceCoordinator) { SubscriptionManager = subscriptionManager; ServiceCoordinator = serviceCoordinator; }
public WindowsServiceHost([NotNull] ServiceDescription description, [NotNull] IServiceCoordinator coordinator) { if (description == null) throw new ArgumentNullException("description"); if (coordinator == null) throw new ArgumentNullException("coordinator"); _coordinator = coordinator; _description = description; }
public virtual Host Build() { _coordinator = new ServiceCoordinator(new PoolFiber(), ExecutePreStartActions, ExecutePostStartActions, ExecutePostStopActions, _timeout); _serviceBuilders.Each(x => { _coordinator.CreateService(x.Name, x.Build); }); return(CreateHost(_coordinator)); }
Host CreateHost(IServiceCoordinator coordinator) { if (Process.GetCurrentProcess().GetParent().ProcessName == "services") { _log.Debug("Running as a Windows service, using the service host"); return(new WindowsServiceHost(_description, coordinator)); } _log.Debug("Running as a console application, using the console host"); return(new ConsoleRunHost(_description, coordinator)); }
public ConsoleRunHost([NotNull] ServiceDescription description, [NotNull] IServiceCoordinator coordinator, [NotNull]Os osCommands) { if (description == null) throw new ArgumentNullException("description"); if (coordinator == null) throw new ArgumentNullException("coordinator"); if(osCommands ==null) throw new ArgumentNullException("osCommands"); _description = description; _coordinator = coordinator; _osCommands = osCommands; }
Host CreateHost(IServiceCoordinator coordinator, Os osCommands) { var process = Process.GetCurrentProcess().GetParent(); if (process != null && process.ProcessName == "services") { _log.Debug("Running as a Windows service, using the service host"); return(new WindowsServiceHost(_description, coordinator)); } _log.Debug("Running as a console application, using the console host"); return(new ConsoleRunHost(_description, coordinator, osCommands)); }
public ConsoleRunHost([NotNull] ServiceDescription description, [NotNull] IServiceCoordinator coordinator) { if (description == null) { throw new ArgumentNullException("description"); } if (coordinator == null) { throw new ArgumentNullException("coordinator"); } _description = description; _coordinator = coordinator; }
public WindowsServiceHost([NotNull] ServiceDescription description, [NotNull] IServiceCoordinator coordinator) { if (description == null) { throw new ArgumentNullException("description"); } if (coordinator == null) { throw new ArgumentNullException("coordinator"); } _coordinator = coordinator; _description = description; }
public virtual Host Build() { _coordinator = new ServiceCoordinator(new PoolFiber(), ExecutePreStartActions, ExecutePostStartActions, ExecutePostStopActions, _timeout); _serviceBuilders.Each(x => { _coordinator.CreateService(x.Name, x.Build); }); //TODO: feels like it should be a builder var osCommands = OsDetector.DetectOs(); return(CreateHost(_coordinator, osCommands)); }
public ConsoleRunHost([NotNull] ServiceDescription description, [NotNull] IServiceCoordinator coordinator, [NotNull] Os osCommands) { if (description == null) { throw new ArgumentNullException("description"); } if (coordinator == null) { throw new ArgumentNullException("coordinator"); } if (osCommands == null) { throw new ArgumentNullException("osCommands"); } _description = description; _coordinator = coordinator; _osCommands = osCommands; }
void ShutdownCoordinator() { try { _log.Info("[Topshelf] Stopping"); _coordinator.Stop(); } catch (Exception ex) { _log.Error("The service did not shut down gracefully", ex); } finally { _coordinator.Dispose(); _coordinator = null; _log.Info("[Topshelf] Stopped"); } }
protected override void OnStop() { try { _log.Info("[Topshelf] Stopping"); _coordinator.Stop(); } catch (Exception ex) { _log.Fatal("The service did not shut down gracefully", ex); throw; } finally { _coordinator.Dispose(); _coordinator = null; _log.Info("[Topshelf] Stopped"); } }
protected override void OnStop() { try { _log.Info("[Topshelf] Stopping"); _coordinator.Stop(); } catch (Exception ex) { _log.Fatal("The service did not shut down gracefully", ex); throw; } finally { _coordinator.Dispose(); _coordinator = null; _log.Info("[Topshelf] Stopped"); } }
public ServiceManagerPresenter(ServiceManagerView view) { view.AddButton.Click += AddHandler; view.DeleteButton.Click += DeleteHandeler; _serviceList = view.ListView; coordinator = CoordinatorManager.Instance.CoordinatorOfType <IServiceCoordinator>(); if (coordinator == null) { throw new InvalidOperationException("Il coordinatore dei servizi non è disponibile"); } if (view.RetrieveTagInformation <AuthorizationLevel>("authorizationLevel") < AuthorizationLevel.BASIC_STAFF) { view.ActionPanel.Enabled = false; view.ActionPanel.Visible = false; } _services = coordinator.Services; coordinator.ServiceChanged += ServiceChangedHandler; // Popolo la list view all'avvio ServiceChangedHandler(this, EventArgs.Empty); }
public SelectionPacket(DateRange range = null, string question = "", bool emptyResponse = false, Style style = null) { coordinator = CoordinatorManager.Instance.CoordinatorOfType <IServiceCoordinator>(); #region Precondizioni if (question == null) { throw new ArgumentNullException("question null"); } if (coordinator == null) { throw new InvalidOperationException("Il coordinatore dei pacchetti non è disponibile"); } #endregion InitializeComponent(); _range = range; _question.Text = question; _emptyResponse = emptyResponse; _packetList = _view; _packets = coordinator.Packets; ActiveControl = _view; this.ApplyStyle(style); }
public HaltMinionHandler(IServiceCoordinator coordinator) { Coordinator = coordinator; }
public InventoryServiceTask(IServiceCoordinator serviceCoordinator) { this.serviceCoordinator = serviceCoordinator; }
void ExecutePostStopActions(IServiceCoordinator coordinator) { _postStopActions.Each(x => x(coordinator)); }
void Ignored(IServiceCoordinator coordinator) { }
public PaymentServiceTask(IServiceCoordinator serviceCoordinator) { this.serviceCoordinator = serviceCoordinator; }
public AccountServiceTask(IServiceCoordinator serviceCoordinator) { this.serviceCoordinator = serviceCoordinator; }
public ServiceCommand(IServiceCoordinator coordinator, WinServiceSettings settings) { _coordinator = coordinator; _settings = settings; }
public ConsoleRunHost(ServiceDescription description, IServiceCoordinator coordinator) { _description = description; _coordinator = coordinator; }
public ConsoleHost(IServiceCoordinator coordinator) { _coordinator = coordinator; }
public WinServiceHost(IServiceCoordinator coordinator, ServiceName fullServiceName) { _coordinator = coordinator; _fullServiceName = fullServiceName; }
public ConsoleRunHost(ServiceDescription description, IServiceCoordinator coordinator) { _description = description; _coordinator = coordinator; }
public CommandLineHost(ServiceName name, IServiceCoordinator coordinator) { _serviceName = name; _coordinator = coordinator; }
public WindowsServiceHost(ServiceDescription description, IServiceCoordinator coordinator) { _coordinator = coordinator; _description = description; }
public ServiceHost(IServiceCoordinator coordinator) { _coordinator = coordinator; }
public WindowsServiceHost(ServiceDescription description, IServiceCoordinator coordinator) { _coordinator = coordinator; _description = description; }
public RunCommand(IServiceCoordinator coordinator, string serviceName) { _coordinator = coordinator; _serviceName = serviceName; }
public ConsoleHost( ServiceName name, IServiceCoordinator serviceCoordinator ) { Name = name; ServiceCoordinator = serviceCoordinator; }
public ConsoleHost(ServiceName name, IServiceCoordinator serviceCoordinator) { Name = name; ServiceCoordinator = serviceCoordinator; }
public DaemonHost(IServiceCoordinator serviceCoordinator, ServiceName name) { ServiceCoordinator = serviceCoordinator; Name = name; }
void ExecutePreStartActions(IServiceCoordinator coordinator) { _preStartActions.Each(x => x(coordinator)); }
public RunCommand(IServiceCoordinator coordinator) { _coordinator = coordinator; }
public CategoryService(IServiceCoordinator serviceCoordinator) { this._serviceCoordinator = serviceCoordinator; }
public DaemonHost( IServiceCoordinator serviceCoordinator, ServiceName name ) { ServiceCoordinator = serviceCoordinator; Name = name; }
void ShutdownCoordinator() { try { _log.Info("[Topshelf] Stopping"); _coordinator.Stop(); } catch (Exception ex) { _log.Error("The service did not shut down gracefully", ex); } finally { _coordinator.Dispose(); _coordinator = null; _log.Info("[Topshelf] Stopped"); } }
//public ProductController() //{ // string connectionString = "";//todo use IOC later // // this._service = new ServiceCoordinator(connectionString); //} public ProductController(Infrastructure.Entities.InventoryContext context) { this._service = new ServiceCoordinator(context); //this._service = service; }
public ConsoleHost(IServiceCoordinator coordinator) { _coordinator = coordinator; }
public ProductService(IServiceCoordinator serviceCoordinator) { this._serviceCoordinator = serviceCoordinator; }