コード例 #1
0
        // Token: 0x06001BE9 RID: 7145 RVA: 0x00078CF0 File Offset: 0x00076EF0
        private void RecordComponentOnline(IServiceComponent component)
        {
            bool flag = false;

            if (component.IsEnabled)
            {
                ExTraceGlobals.ReplayManagerTracer.TraceDebug <string>((long)this.GetHashCode(), "ComponentManager: Component '{0}' was successfully started.", component.Name);
                ReplayCrimsonEvents.FacilityReady.Log <string>(component.Name);
            }
            else
            {
                ExTraceGlobals.ReplayManagerTracer.TraceDebug <string>((long)this.GetHashCode(), "ComponentManager: Component '{0}' was not started because it's disabled.", component.Name);
            }
            lock (this.m_locker)
            {
                if (!this.m_componentsOnline.Contains(component))
                {
                    this.m_onlineCount++;
                    this.m_componentsOnline.Add(component);
                    if (this.m_componentsOnline.Count == this.m_components.Length)
                    {
                        flag = true;
                    }
                }
            }
            if (flag)
            {
                ExTraceGlobals.ReplayManagerTracer.TraceDebug((long)this.GetHashCode(), "ComponentManager: All components have been successfully started.");
                ReplayEventLogConstants.Tuple_AllFacilitiesAreOnline.LogEvent(null, new object[0]);
                ThreadPool.QueueUserWorkItem(delegate(object param0)
                {
                    this.StopPeriodicStarter();
                });
            }
        }
コード例 #2
0
        public PropertyValueMatcher(IServiceComponent serviceComponent, IDataManager dataManager, string propertyName)
        {
            ServiceComponent = serviceComponent;
            DataManager      = dataManager;

            PropertyName = propertyName;
        }
コード例 #3
0
        /// <summary>
        /// Check for IServiceComponent modules being loaded, and when one is found, give it a child container and add it to the list
        /// </summary>
        /// <param name="e"></param>
        public void OnModuleLoaded(LoadModuleCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                try
                {
                    // get type for reflection only
                    Type moduleType = Type.GetType(e.ModuleInfo.ModuleType);

                    if (typeof(IServiceComponent).IsAssignableFrom(moduleType))
                    {
                        IServiceComponent serviceComponent = (IServiceComponent)Container.Resolve(moduleType);
                        if (e.ModuleInfo is ExtendedModuleInfo)
                        {
                            serviceComponent.ID = ((ExtendedModuleInfo)e.ModuleInfo).ModuleID;
                        }
                        Container.RegisterInstance <IServiceComponent>(e.ModuleInfo.ModuleName, serviceComponent, new ContainerControlledLifetimeManager());

                        // add to service component collection
                        ServiceComponents.Add(serviceComponent);

                        // create a child container for the component
                        serviceComponent.ComponentContainer = Container.CreateChildContainer();

                        // initialize the component
                        serviceComponent.InitializeComponent();
                    }
                }
                catch (Exception ex)
                {
                    Log.Error("Error handling module load in service component manager.", ex);
                }
            }
        }
コード例 #4
0
 // Token: 0x06001BEC RID: 7148 RVA: 0x00078F0C File Offset: 0x0007710C
 private void LogRetriableComponentStartFailed(IServiceComponent component)
 {
     ReplayEventLogConstants.Tuple_FailedToStartRetriableComponent.LogEvent(component.Name, new object[]
     {
         component.Name,
         (int)this.m_periodicStartInterval.TotalSeconds
     });
 }
コード例 #5
0
 // Token: 0x06001BEA RID: 7146 RVA: 0x00078E04 File Offset: 0x00077004
 private void RecordComponentOffline(IServiceComponent component)
 {
     if (component.IsEnabled)
     {
         lock (this.m_locker)
         {
             if (this.m_componentsOnline.Contains(component))
             {
                 this.m_onlineCount--;
                 this.m_componentsOnline.Remove(component);
             }
         }
         ExTraceGlobals.ReplayManagerTracer.TraceDebug <string>((long)this.GetHashCode(), "ComponentManager: Component '{0}' was stopped.", component.Name);
         ReplayCrimsonEvents.FacilityOffline.Log <string>(component.Name);
         return;
     }
     ExTraceGlobals.ReplayManagerTracer.TraceDebug <string>((long)this.GetHashCode(), "ComponentManager: Component '{0}' was not stopped because it's disabled.", component.Name);
 }
コード例 #6
0
 /// <summary>
 /// Instantiates a property value matcher
 /// </summary>
 /// <param name="serviceComponent">The service component to which this matcher belongs</param>
 /// <param name="objectProvider">The function used to provide the objects to use for matching</param>
 /// <param name="propertyName">The name of the property on the objects to be used for matching</param>
 public PropertyValueMatcher(IServiceComponent serviceComponent, Func <IEnumerable <T> > objectProvider, string propertyName)
 {
     ServiceComponent = serviceComponent;
     ObjectProvider   = objectProvider;
     PropertyName     = propertyName;
 }
コード例 #7
0
 /// <summary>
 /// Instantiates a regex matcher with the given regex provider
 /// </summary>
 /// <param name="serviceComponent"></param>
 /// <param name="dataManager"></param>
 /// <param name="regexProvider"></param>
 public RegexMatcher(IServiceComponent serviceComponent, Func <IEnumerable <IRegex> > regexProvider)
 {
     ServiceComponent = serviceComponent;
     RegexProvider    = regexProvider;
 }
コード例 #8
0
 /// <summary>
 /// Instantiates the parent-child matching processor for the given service component, data manager, and processor name
 /// </summary>
 /// <param name="serviceComponent">The service component to which this processor belongs</param>
 /// <param name="dataManager">The data manager for this processor</param>
 /// <param name="name">The name of the processor</param>
 public ParentChildMatchingProcessor(IServiceComponent serviceComponent, string name, Action <IEnumerable <TChild> > childObjectHandler)
 {
     ServiceComponent   = serviceComponent;
     Name               = name;
     ChildObjectHandler = childObjectHandler;
 }
コード例 #9
0
ファイル: all.generated.cs プロジェクト: TECKSPEED/UmbracoMVC
 /// <summary>Static getter for Service Intro</summary>
 public static string GetServiceIntro(IServiceComponent that)
 {
     return(that.GetPropertyValue <string>("serviceIntro"));
 }
コード例 #10
0
ファイル: all.generated.cs プロジェクト: TECKSPEED/UmbracoMVC
 /// <summary>Static getter for Service Icon</summary>
 public static Newtonsoft.Json.Linq.JToken GetServiceIcon(IServiceComponent that)
 {
     return(that.GetPropertyValue <Newtonsoft.Json.Linq.JToken>("serviceIcon"));
 }
コード例 #11
0
ファイル: all.generated.cs プロジェクト: TECKSPEED/UmbracoMVC
 /// <summary>Static getter for Service Button Text</summary>
 public static string GetServiceButtonText(IServiceComponent that)
 {
     return(that.GetPropertyValue <string>("serviceButtonText"));
 }
コード例 #12
0
 public RSSPollingFilter(IServiceComponent serviceComponent, IDataManager dataManager, IServiceConfigManager configManager)
 {
     ServiceComponent = serviceComponent;
     DataManager      = dataManager;
     ConfigManager    = configManager;
 }
コード例 #13
0
ファイル: MatchingProcessor.cs プロジェクト: CarlosVV/mediavf
 /// <summary>
 /// Instantiates the parent-child matching processor for the given service component, data manager, and processor name
 /// </summary>
 /// <param name="serviceComponent">The service component to which this processor belongs</param>
 /// <param name="dataManager">The data manager for this processor</param>
 /// <param name="name">The name of the processor</param>
 public ParentChildMatchingProcessor(IServiceComponent serviceComponent, string name)
 {
     ServiceComponent = serviceComponent;
     Name             = name;
 }
コード例 #14
0
        public InvokeResponse Invoke(InvokeRequest request)
        {
            InvokeResponse response = new InvokeResponse();

            if (!string.IsNullOrEmpty(request.ComponentType))
            {
                IServiceComponentManager componentManager = Container.Resolve <IServiceComponentManager>();
                IServiceComponent        component        = componentManager.ServiceComponents.FirstOrDefault(c => c != null && c.GetType().GetInterface(request.ComponentType) != null);

                if (component != null)
                {
                    MethodInfo operation = component.GetType().GetMethod(request.OperationName, request.OperationParameters.Select(op => Type.GetType(op.ParameterType)).ToArray());
                    if (operation != null)
                    {
                        try
                        {
                            SerializationUtility serializer = new SerializationUtility();

                            List <object> parameters = new List <object>();
                            foreach (InvokeParameter parameter in request.OperationParameters)
                            {
                                parameters.Add(serializer.Deserialize(Type.GetType(parameter.ParameterType), parameter.SerializedParameter));
                            }

                            object result;

                            try
                            {
                                result = operation.Invoke(component, parameters.ToArray());
                                if (result != null)
                                {
                                    response.OperationResult = serializer.Serialize(result.GetType(), result);
                                }
                            }
                            catch (Exception ex)
                            {
                                response.Error = new Exception("An exception occurred trying to invoke operation.", ex);
                            }
                        }
                        catch (Exception ex)
                        {
                            response.Error = new InvalidRequestException("An exception occurred trying to deserialize operation parameters.", ex);
                        }
                    }
                    else
                    {
                        response.Error = new InvalidRequestException("Operation not found.");
                    }
                }
                else
                {
                    response.Error = new InvalidRequestException("Component not found.");
                }
            }
            else
            {
                response.Error = new InvalidRequestException("Component type not provided.");
            }

            return(response);
        }
コード例 #15
0
ファイル: MatchingProcessor.cs プロジェクト: CarlosVV/mediavf
 public ParentChildMatchingProcessor(IServiceComponent serviceComponent, IDataManager dataManager, string name)
 {
     ServiceComponent = serviceComponent;
     DataManager      = dataManager;
     Name             = name;
 }
コード例 #16
0
ファイル: RegexMatcher.cs プロジェクト: CarlosVV/mediavf
 public RegexMatcher(IServiceComponent serviceComponent, IDataManager dataManager)
 {
     ServiceComponent = serviceComponent;
     DataManager      = dataManager;
 }