public FinalReceiver( IGrandOutputSink common, HandlerBase[] handlers, IRouteConfigurationLock configLock ) { Debug.Assert( handlers != null ); CommonSink = common; Handlers = handlers; ConfigLock = configLock; }
public FinalReceiver(IGrandOutputSink common, HandlerBase[] handlers, IRouteConfigurationLock configLock) { Debug.Assert(handlers != null); CommonSink = common; Handlers = handlers; ConfigLock = configLock; }
internal StandardChannel( IGrandOutputSink commonSink, EventDispatcher dispatcher, IRouteConfigurationLock configLock, HandlerBase[] handlers, string configurationName, GrandOutputChannelConfigData configData ) { _dispatcher = dispatcher; _receiver = new EventDispatcher.FinalReceiver( commonSink, handlers, configLock ); _receiverNoCommonSink = new EventDispatcher.FinalReceiver( null, handlers, configLock ); _configurationName = configurationName; if( configData != null ) _minimalFilter = configData.MinimalFilter; }
protected override HandlerBase DoCreate(IActivityMonitor monitor, IRouteConfigurationLock configLock, ActionConfiguration c) { var a = c.GetType().GetTypeInfo().GetCustomAttribute <HandlerTypeAttribute>(); if (a == null) { throw new CKException("A [HandlerType(typeof(H))] attribute (where H is a CK.Monitoring.GrandOutputHandlers.HandlerBase class) is missing on class '{0}'.", c.GetType().FullName); } return((HandlerBase)Activator.CreateInstance(a.HandlerType, c)); }
/// <summary> /// Must be implemented to create the final route class that encapsulates the array of actions of a route. /// </summary> /// <param name="monitor">Monitor to use if needed to comment route creation.</param> /// <param name="configLock"> /// Configuration lock. It must not be solicited during the creation of the route: a route that delays /// its work can keep a reference to it and use it as needed. /// </param> /// <param name="actions">Array of actions for the route.</param> /// <param name="configurationName">The <see cref="RouteConfiguration"/> name.</param> /// <param name="configData">Configuration data of the route.</param> /// <param name="routePath">Path to this route: parent route objects are already created.</param> /// <returns>Final route actions encapsulation.</returns> internal protected abstract TRoute DoCreateFinalRoute(IActivityMonitor monitor, IRouteConfigurationLock configLock, TAction[] actions, string configurationName, object configData, IReadOnlyList <TRoute> routePath);
/// <summary> /// Must me implemented to create a sequence action. /// </summary> /// <param name="monitor">Monitor to use if needed.</param> /// <param name="configLock"> /// Configuration lock. It must not be solicited during the creation of the sequence: a sequence that delays /// its work can keep a reference to it and use it as needed. /// </param> /// <param name="c">Configuration of the sequence action.</param> /// <param name="children">Array of already created children action.</param> /// <returns>A sequence action.</returns> protected abstract TAction DoCreateSequence(IActivityMonitor monitor, IRouteConfigurationLock configLock, ActionSequenceConfiguration c, TAction[] children);
/// <summary> /// Must me implemented to create a parallel action. /// </summary> /// <param name="monitor">Monitor to use if needed.</param> /// <param name="configLock"> /// Configuration lock. It must not be solicited during the creation of the parallel: if the parallel delays /// its work, it can keep a reference to it and use it as needed. /// </param> /// <param name="c">Configuration of the parallel action.</param> /// <param name="children">Array of already created children action.</param> /// <returns>A parallel action.</returns> protected abstract TAction DoCreateParallel(IActivityMonitor monitor, IRouteConfigurationLock configLock, ActionParallelConfiguration c, TAction[] children);
/// <summary> /// Must be implemented to create a <typeparamref name="TAction"/> from a <see cref="ActionConfiguration"/> object /// that is guaranteed to not be a composite (a parallel or a sequence). /// </summary> /// <param name="monitor">Monitor to use if needed.</param> /// <param name="configLock"> /// Configuration lock. It must not be solicited during the creation of the action: an action that delay /// its work can keep a reference to it and use it when needed. /// </param> /// <param name="c">Configuration of the action.</param> /// <returns>The created action.</returns> protected abstract TAction DoCreate(IActivityMonitor monitor, IRouteConfigurationLock configLock, ActionConfiguration c);
protected internal override IChannel DoCreateFinalRoute(IActivityMonitor monitor, IRouteConfigurationLock configLock, HandlerBase[] actions, string configurationName, object configData, IReadOnlyList <IChannel> routePath) { return(new StandardChannel(_grandOutput.CommonSink, _dispatcher, configLock, actions, configurationName, (GrandOutputChannelConfigData)configData)); }
protected override HandlerBase DoCreateSequence(IActivityMonitor monitor, IRouteConfigurationLock configLock, ActionSequenceConfiguration c, HandlerBase[] children) { return(new SequenceHandler(c, children)); }
protected override HandlerBase DoCreateParallel(IActivityMonitor monitor, IRouteConfigurationLock configLock, ActionParallelConfiguration c, HandlerBase[] children) { return(new ParallelHandler(c, children)); }
internal FinalRoute(IRouteConfigurationLock useLock, ITestIt[] actions, string name) { _useLock = useLock; Actions = actions; _name = name; }
internal StandardChannel(IGrandOutputSink commonSink, EventDispatcher dispatcher, IRouteConfigurationLock configLock, HandlerBase[] handlers, string configurationName, GrandOutputChannelConfigData configData) { _dispatcher = dispatcher; _receiver = new EventDispatcher.FinalReceiver(commonSink, handlers, configLock); _receiverNoCommonSink = new EventDispatcher.FinalReceiver(null, handlers, configLock); _configurationName = configurationName; if (configData != null) { _minimalFilter = configData.MinimalFilter; } }
protected override FinalRoute DoCreateFinalRoute(IActivityMonitor monitor, IRouteConfigurationLock configLock, ITestIt[] actions, string configurationName, object configData, IReadOnlyList <FinalRoute> parentPath) { return(new FinalRoute(configLock, actions, configurationName)); }
protected override ITestIt DoCreateSequence(IActivityMonitor monitor, IRouteConfigurationLock configLock, ActionSequenceConfiguration c, ITestIt[] children) { return(new TestSequence(monitor, c, children)); }
protected override ITestIt DoCreateParallel(IActivityMonitor monitor, IRouteConfigurationLock configLock, ActionParallelConfiguration c, ITestIt[] children) { return(new TestParallel(monitor, c, children)); }
protected override ITestIt DoCreate(IActivityMonitor monitor, IRouteConfigurationLock configLock, ActionConfiguration c) { ActionTypeAttribute a = c.GetType().GetTypeInfo().GetCustomAttribute <ActionTypeAttribute>(); return((ITestIt)Activator.CreateInstance(a.ActionType, monitor, c)); }