Example #1
0
        public ResourceLoadProvider(ConcurrentDictionary <Guid, List <IResource> > workspaceResources, IServerVersionRepository serverVersionRepository, IEnumerable <DynamicService> managementServices = null)
            : this(new FileWrapper())
        {
            try
            {
                _perfCounter = CustomContainer.Get <IWarewolfPerformanceCounterLocater>().GetCounter("Count of requests for workflows which don't exist");
            }
            catch (Exception e)
            {
                Dev2Logger.Warn("Error getting perf counters. " + e.Message, "Warewolf Warn");
            }
            if (managementServices != null)
            {
                foreach (var service in managementServices)
                {
                    var resource = new ManagementServiceResource(service);
                    ManagementServices.TryAdd(resource.ResourceID, resource);
                }
            }
            _workspaceResources      = workspaceResources;
            _serverVersionRepository = serverVersionRepository;
            LoadFrequentlyUsedServices();

            _typeCache = new TypeCache();
            LoadResourceTypeCache();
        }
 public ResourceLoadProvider(ConcurrentDictionary <Guid, List <IResource> > workspaceResources, IEnumerable <DynamicService> managementServices = null)
     : this(new FileWrapper())
 {
     // MUST load management services BEFORE server workspace!!
     try
     {
         _perfCounter = CustomContainer.Get <IWarewolfPerformanceCounterLocater>().GetCounter("Count of requests for workflows which don’t exist");
     }
     // ReSharper disable once EmptyGeneralCatchClause
     catch (Exception)
     {
     }
     if (managementServices != null)
     {
         foreach (var service in managementServices)
         {
             var resource = new ManagementServiceResource(service);
             ManagementServices.TryAdd(resource.ResourceID, resource);
         }
     }
     _workspaceResources = workspaceResources;
     LoadFrequentlyUsedServices();
 }