private Service DoCreateService(IServiceAddress serviceAddress, ServiceType serviceType, IServiceConnector connector) { Service service = null; if (serviceType == ServiceType.Manager) { if (manager == null) { string npath = Path.Combine(basePath, "manager"); if (!Directory.Exists(npath)) Directory.CreateDirectory(npath); manager = new FileSystemManagerService(connector, basePath, npath, serviceAddress); } service = manager; } else if (serviceType == ServiceType.Root) { if (root == null) { string npath = Path.Combine(basePath, "root"); if (!Directory.Exists(npath)) Directory.CreateDirectory(npath); root = new FileSystemRootService(connector, npath); } service = root; } else if (serviceType == ServiceType.Block) { if (block == null) { string npath = Path.Combine(basePath, "block"); if (!Directory.Exists(npath)) Directory.CreateDirectory(npath); block = new FileSystemBlockService(connector, npath); } service = block; } if (service != null) { service.Started += ServiceStarted; service.Stopped += ServiceStopped; } return service; }
public PathAccess(RootService service, string pathName) { this.service = service; this.pathName = pathName; proposalQueue = new List<object>(); }
public MessageProcessor(RootService service) { this.service = service; }
public PathConnection(RootService service, PathInfo pathInfo, IServiceConnector connector, IServiceAddress[] managerServers, INetworkCache cache, ServiceStatusTracker statusTracker) { this.service = service; this.pathInfo = pathInfo; treeSystem = new NetworkTreeSystem(connector, managerServers, cache, statusTracker); }
public MemoryPathAccess(RootService service, string pathName) : base(service, pathName) { }
protected override void OnStop() { if (configTimer != null) { configTimer.Dispose(); configTimer = null; } if (manager != null) { manager.Dispose(); manager = null; } if (root != null) { root.Dispose(); root = null; } if (block != null) { block.Dispose(); block = null; } }
protected override void Dispose(bool disposing) { if (disposing) { if (manager != null) { manager.Dispose(); manager = null; } if (root != null) { root.Dispose(); root = null; } if (block != null) { block.Dispose(); block = null; } } base.Dispose(disposing); }
public void StopService(ServiceType serviceType) { lock (serverManagerLock) { if (serviceType == ServiceType.Manager && manager != null) { manager.Stop(); manager = null; } else if (serviceType == ServiceType.Root && root != null) { root.Stop(); root = null; } else if (serviceType == ServiceType.Block && block != null) { block.Stop(); block = null; } } }
public void StartService(ServiceType serviceType) { // Start the services, lock (serverManagerLock) { IService service = serviceFactory.CreateService(address, serviceType, connector); if (service == null) throw new ApplicationException("Unable to create service of tyoe " + serviceType); service.Start(); if (serviceType == ServiceType.Manager) manager = (ManagerService)service; else if (serviceType == ServiceType.Root) root = (RootService)service; else if (serviceType == ServiceType.Block) block = (BlockService) service; } }
public PathConnection(RootService service, string pathName, IServiceConnector connector, IServiceAddress manager, INetworkCache networkCache) { this.service = service; this.pathName = pathName; treeSystem = new NetworkTreeSystem(connector, manager, networkCache); }