/// <summary>
        /// Initializes a new instance of the <see cref="AsyncMonitorAttribute" /> class.
        /// </summary>
        /// <param name="step">The step.</param>
        /// <param name="timing">The timing.</param>
        /// <param name="handlerType">The type of the monitored handler (used to extract the assembly qualified type name for instrumentation purposes)</param>
        public AsyncMonitorAttribute(int step, HandlerTiming timing, Type handlerType)
            : base(step, timing)
        {
            _handlerName = handlerType.AssemblyQualifiedName;
            var monitoringSetting = MonitoringConfigurationSection.GetConfiguration();

            _monitoringEnabled = monitoringSetting.Monitor.IsMonitoringEnabled;
            _instanceName = monitoringSetting.Monitor.InstanceName;
        }
Beispiel #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RequestHandlerAttribute" /> class.
        /// </summary>
        /// <param name="step">The step.</param>
        /// <param name="timing">The timing.</param>
        /// <param name="handlerType">The type of the monitored handler (used to extract the assembly qualified type name for instrumentation purposes)</param>
        public MonitorAttribute(int step, HandlerTiming timing, Type handlerType)
            : base(step, timing)
        {
            _handlerName = handlerType.AssemblyQualifiedName;
            var monitoringSetting = MonitoringConfigurationSection.GetConfiguration();

            _monitoringEnabled = monitoringSetting.Monitor.IsMonitoringEnabled;
            _instanceName      = monitoringSetting.Monitor.InstanceName;
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="RequestHandlerAttribute" /> class.
 /// </summary>
 /// <param name="backstop">if set to <c>true</c> [backstop].</param>
 /// <param name="circuitBreaker">if set to <c>true</c> [circuit breaker].</param>
 /// <param name="step">The step.</param>
 /// <param name="timing">The timing.</param>
 public FallbackPolicyAsyncAttribute(
     bool backstop, 
     bool circuitBreaker, 
     int step, 
     HandlerTiming timing = HandlerTiming.Before) 
     : base(step, timing)
 {
     _backstop = backstop;
     _circuitBreaker = circuitBreaker;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="RequestHandlerAttribute" /> class.
 /// </summary>
 /// <param name="backstop">if set to <c>true</c> [backstop].</param>
 /// <param name="circuitBreaker">if set to <c>true</c> [circuit breaker].</param>
 /// <param name="step">The step.</param>
 /// <param name="timing">The timing.</param>
 public FallbackPolicyAsyncAttribute(
     bool backstop,
     bool circuitBreaker,
     int step,
     HandlerTiming timing = HandlerTiming.Before)
     : base(step, timing)
 {
     _backstop       = backstop;
     _circuitBreaker = circuitBreaker;
 }
Beispiel #5
0
 public MonitorEvent(
     string instanceName,
     MonitorEventType eventType, 
     string handlerName,
     IRequest targetHandlerRequest,
     DateTime eventTime, 
     HandlerTiming timing)
     :base(new Guid())
 {
     InstanceName = instanceName;
     EventType = eventType;
     HandlerName = handlerName;
     TargetHandlerRequest = targetHandlerRequest;
     EventTime = eventTime;
     Timing = timing;
 }
Beispiel #6
0
 public ValidationAttribute(int step, HandlerTiming timing)
     : base(step, timing)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="UseCommandSourcingAsyncAttribute"/> class.
 /// </summary>
 /// <param name="step">The step.</param>
 /// <param name="timing">The timing.</param>
 public UseCommandSourcingAsyncAttribute(int step, HandlerTiming timing = HandlerTiming.Before)
     : base(step, timing)
 { }
 public TimeoutPolicyAttribute(int milliseconds, int step, HandlerTiming timing = HandlerTiming.Before) : base(step, timing)
 {
     this.milliseconds = milliseconds;
 }
 public MyPostLoggingHandlerAsyncAttribute(int step, HandlerTiming timing)
     : base(step, timing)
 {
 }
Beispiel #10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TimeoutPolicyAttribute"/> class.
 /// </summary>
 /// <param name="milliseconds">The milliseconds.</param>
 /// <param name="step">The step.</param>
 /// <param name="timing">The timing.</param>
 public TimeoutPolicyAttribute(int milliseconds, int step, HandlerTiming timing = HandlerTiming.Before) : base(step, timing)
 {
     this.milliseconds = milliseconds;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="RequestHandlerAttribute"/> class.
 /// </summary>
 /// <param name="step">The step.</param>
 /// <param name="contextKey">An identifier for the context in which the command has been processed (for example, the name of the handler)</param>
 /// <param name="onceOnly">Should we prevent duplicate messages i.e. seen already</param>
 /// <param name="timing">The timing.</param>
 /// <param name="onceOnlyAction">Action to take if prevent duplicate messages, and we receive a duplicate message</param>
 public UseInboxAttribute(int step, string contextKey = null, bool onceOnly = false, HandlerTiming timing = HandlerTiming.Before, OnceOnlyAction onceOnlyAction = OnceOnlyAction.Throw)
     : base(step, timing)
 {
     ContextKey     = contextKey;
     OnceOnly       = onceOnly;
     OnceOnlyAction = onceOnlyAction;
 }
 public MonitoringAttribute(int step, HandlerTiming timing)
     : base(step, timing)
 {
 }
 public MyPostLoggingHandlerAttribute(int step, HandlerTiming timing)
     : base(step, timing)
 {
 }
Beispiel #14
0
 public TraceAttribute(int step, HandlerTiming timing)
     : base(step, timing)
 {
 }
 protected RequestHandlerAttribute(int step, HandlerTiming timing = HandlerTiming.Before)
 {
     this.step = step;
     this.timing = timing;
 }
 /// <summary>
 /// Initialises a new instance of the <see cref="FeatureSwitchAttribute"/> class.
 /// </summary>
 /// <param name="handler">The handler to feature switch</param>
 /// <param name="status">The status of the feature switch</param>
 /// <param name="step">The step.</param>
 /// <param name="timing">The timing.</param>
 public FeatureSwitchAttribute(Type handler, FeatureSwitchStatus status, int step, HandlerTiming timing = HandlerTiming.Before) : base(step, timing)
 {
     _handler = handler;
     _status  = status;
 }
Beispiel #17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MonitorAsyncAttribute" /> class.
 /// </summary>
 /// <param name="step">The step.</param>
 /// <param name="timing">The timing.</param>
 /// <param name="handlerType">The type of the monitored handler (used to extract the assembly qualified type name for instrumentation purposes)</param>
 public MonitorAsyncAttribute(int step, HandlerTiming timing, Type handlerType)
     : base(step, timing)
 {
     _handlerName             = handlerType.FullName;
     _handlerFullAssemblyName = handlerType.AssemblyQualifiedName;
 }
 public RequestValidationAttribute(int step, HandlerTiming timing = HandlerTiming.Before) : base(step, timing)
 {
 }
Beispiel #19
0
 public TraceAttribute(int step, HandlerTiming timing) 
     : base(step, timing)
 { }
 public MyPreValidationHandlerAttribute(int step, HandlerTiming timing)
     : base(step, timing)
 {
 }
Beispiel #21
0
 public TestPreValidationHandlerAttribute(int step, HandlerTiming timing)
     : base(step, timing)
 {
 }
 public HeartbeatAttribute(int step, HandlerTiming timing = HandlerTiming.After) : base(step, timing)
 {
 }
Beispiel #23
0
 public MyPostAuditHandlerAttribute(int step, HandlerTiming timing)
     : base(step, timing)
 {
 }
Beispiel #24
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RequestHandlerAttribute" /> class.
 /// </summary>
 /// <param name="step">The step.</param>
 /// <param name="timing">The timing.</param>
 /// <param name="handlerType">The type of the monitored handler (used to extract the assembly qualified type name for instrumentation purposes)</param>
 public MonitorAttribute(int step, HandlerTiming timing, Type handlerType)
     : base(step, timing)
 {
     _handlerName = handlerType.FullName;
     _handlerFullAssemblyName = handlerType.AssemblyQualifiedName;
 }
 public MyPreValidationHandlerAsyncAttribute(int step, HandlerTiming timing)
     : base(step, timing)
 {
 }
 protected RequestHandlerAttribute(int step, HandlerTiming timing = HandlerTiming.Before)
 {
     this.step   = step;
     this.timing = timing;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="RequestHandlerAttribute"/> class.
 /// </summary>
 /// <param name="step">The step.</param>
 /// <param name="contextKey">An identifier for the context in which the command has been processed (for example, the type of the handler)</param>
 /// <param name="onceOnly">Should we prevent duplicate messages i.e. seen already</param>
 /// <param name="timing">The timing.</param>
 /// <param name="onceOnlyAction">Action to take if prevent duplicate messages, and we receive a duplicate message</param>
 public UseInboxAttribute(int step, Type contextKey, bool onceOnly = false, HandlerTiming timing = HandlerTiming.Before, OnceOnlyAction onceOnlyAction = OnceOnlyAction.Throw)
     : this(step, contextKey.FullName, onceOnly, timing, onceOnlyAction)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="RequestHandlerAttribute"/> class.
 /// </summary>
 /// <param name="step">The step.</param>
 /// <param name="contextKey">An identifier for the context in which the command has been processed (for example, the name of the handler)</param>
 /// <param name="onceOnly">Should we prevent duplicate messages i.e. seen already</param>
 /// <param name="timing">The timing.</param>
 public UseCommandSourcingAttribute(int step, string contextKey = null, bool onceOnly = false, HandlerTiming timing = HandlerTiming.Before)
     : base(step, timing)
 {
     ContextKey = contextKey;
     OnceOnly   = onceOnly;
 }
 public MyAbortingHandlerAttribute(int step, HandlerTiming timing) : base(step, timing) {}
Beispiel #30
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UseCommandSourcingAsyncAttribute"/> class.
 /// </summary>
 /// <param name="step">The step.</param>
 /// <param name="timing">The timing.</param>
 public UseCommandSourcingAsyncAttribute(int step, HandlerTiming timing = HandlerTiming.Before)
     : base(step, timing)
 {
 }
 public RequestLoggingAttribute(int step, HandlerTiming timing)
     : base(step, timing)
 {}
 /// <summary>
 /// Initializes a new instance of the <see cref="RequestHandlerAttribute" /> class.
 /// </summary>
 /// <param name="step">The step.</param>
 /// <param name="timing">The timing.</param>
 public RequestLoggingAttribute(int step, HandlerTiming timing)
     : base(step, timing)
 {
 }
 public StepsAndTimingAttribute(int step, HandlerTiming timing)
     : base(step, timing)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="RequestHandlerAttribute"/> class.
 /// </summary>
 /// <param name="step">The step.</param>
 /// <param name="onceOnly">Should we prevent duplicate messages i.e. seen already</param>
 /// <param name="timing">The timing.</param>
 public UseCommandSourcingAttribute(int step, bool onceOnly = false, HandlerTiming timing = HandlerTiming.Before) : base(step, timing)
 {
     OnceOnly = onceOnly;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="RequestHandlerAttribute"/> class.
 /// </summary>
 /// <param name="step">The step.</param>
 /// <param name="contextKey">An identifier for the context in which the command has been processed (for example, the type of the handler)</param>
 /// <param name="onceOnly">Should we prevent duplicate messages i.e. seen already</param>
 /// <param name="timing">The timing.</param>
 public UseCommandSourcingAttribute(int step, Type contextKey, bool onceOnly = false, HandlerTiming timing = HandlerTiming.Before)
     : this(step, contextKey.FullName, onceOnly, timing)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="UseCommandSourcingAsyncAttribute"/> class.
 /// </summary>
 /// <param name="step">The step.</param>
 /// <param name="onceOnly">Should we prevent duplicate messages i.e. seen already</param>
 /// <param name="contextKey">An identifier for the context in which the command has been processed (for example, the name of the handler)</param>
 /// <param name="timing">The timing.</param>
 /// <param name="onceOnlyAction">Action to take if prevent duplicate messages, and we receive a duplicate message</param>
 public UseCommandSourcingAsyncAttribute(int step, bool onceOnly = false, string contextKey = null, HandlerTiming timing = HandlerTiming.Before, OnceOnlyAction onceOnlyAction = OnceOnlyAction.Throw)
     : base(step, timing)
 {
     OnceOnly       = onceOnly;
     ContextKey     = contextKey;
     OnceOnlyAction = onceOnlyAction;
 }
 public MyAbortingHandlerAttribute(int step, HandlerTiming timing) : base(step, timing)
 {
 }
 public ValidationAttribute(int step, HandlerTiming timing)
     : base(step, timing)
 {}
 public override void InitializeFromAttributeParams(params object[] initializerList)
 {
     step   = (int)initializerList[0];
     timing = (HandlerTiming)initializerList[1];
 }
Beispiel #40
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RequestHandlerAttribute" /> class.
 /// </summary>
 /// <param name="step">The step.</param>
 /// <param name="timing">The timing.</param>
 public MonitorAttribute(int step, HandlerTiming timing)
     : base(step, timing)
 {
     var monitoringSetting = ConfigurationManager.AppSettings["IsMonitoringEnabled"];
     _monitoringEnabled = Convert.ToBoolean(monitoringSetting);
 }