コード例 #1
0
        /// <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;
        }
コード例 #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;
        }
コード例 #3
0
 /// <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;
 }
コード例 #4
0
 /// <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;
 }
コード例 #5
0
ファイル: MonitorEvent.cs プロジェクト: 40a/Paramore
 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;
 }
コード例 #6
0
 public ValidationAttribute(int step, HandlerTiming timing)
     : base(step, timing)
 {
 }
コード例 #7
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)
 { }
コード例 #8
0
 public TimeoutPolicyAttribute(int milliseconds, int step, HandlerTiming timing = HandlerTiming.Before) : base(step, timing)
 {
     this.milliseconds = milliseconds;
 }
コード例 #9
0
 public MyPostLoggingHandlerAsyncAttribute(int step, HandlerTiming timing)
     : base(step, timing)
 {
 }
コード例 #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;
 }
コード例 #11
0
 /// <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;
 }
コード例 #12
0
 public MonitoringAttribute(int step, HandlerTiming timing)
     : base(step, timing)
 {
 }
コード例 #13
0
 public MyPostLoggingHandlerAttribute(int step, HandlerTiming timing)
     : base(step, timing)
 {
 }
コード例 #14
0
 public TraceAttribute(int step, HandlerTiming timing)
     : base(step, timing)
 {
 }
コード例 #15
0
 protected RequestHandlerAttribute(int step, HandlerTiming timing = HandlerTiming.Before)
 {
     this.step = step;
     this.timing = timing;
 }
コード例 #16
0
 /// <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;
 }
コード例 #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;
 }
コード例 #18
0
 public RequestValidationAttribute(int step, HandlerTiming timing = HandlerTiming.Before) : base(step, timing)
 {
 }
コード例 #19
0
ファイル: TraceAttribute.cs プロジェクト: clegendre/Paramore
 public TraceAttribute(int step, HandlerTiming timing) 
     : base(step, timing)
 { }
コード例 #20
0
 public MyPreValidationHandlerAttribute(int step, HandlerTiming timing)
     : base(step, timing)
 {
 }
コード例 #21
0
 public TestPreValidationHandlerAttribute(int step, HandlerTiming timing)
     : base(step, timing)
 {
 }
コード例 #22
0
 public HeartbeatAttribute(int step, HandlerTiming timing = HandlerTiming.After) : base(step, timing)
 {
 }
コード例 #23
0
 public MyPostAuditHandlerAttribute(int step, HandlerTiming timing)
     : base(step, timing)
 {
 }
コード例 #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;
 }
コード例 #25
0
 public MyPreValidationHandlerAsyncAttribute(int step, HandlerTiming timing)
     : base(step, timing)
 {
 }
コード例 #26
0
 protected RequestHandlerAttribute(int step, HandlerTiming timing = HandlerTiming.Before)
 {
     this.step   = step;
     this.timing = timing;
 }
コード例 #27
0
 /// <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)
 {
 }
コード例 #28
0
 /// <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;
 }
コード例 #29
0
 public MyAbortingHandlerAttribute(int step, HandlerTiming timing) : base(step, timing) {}
コード例 #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)
 {
 }
コード例 #31
0
 public RequestLoggingAttribute(int step, HandlerTiming timing)
     : base(step, timing)
 {}
コード例 #32
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 RequestLoggingAttribute(int step, HandlerTiming timing)
     : base(step, timing)
 {
 }
コード例 #33
0
 public StepsAndTimingAttribute(int step, HandlerTiming timing)
     : base(step, timing)
 {
 }
コード例 #34
0
 /// <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;
 }
コード例 #35
0
 /// <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)
 {
 }
コード例 #36
0
 /// <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;
 }
コード例 #37
0
 public MyAbortingHandlerAttribute(int step, HandlerTiming timing) : base(step, timing)
 {
 }
コード例 #38
0
 public ValidationAttribute(int step, HandlerTiming timing)
     : base(step, timing)
 {}
コード例 #39
0
 public override void InitializeFromAttributeParams(params object[] initializerList)
 {
     step   = (int)initializerList[0];
     timing = (HandlerTiming)initializerList[1];
 }
コード例 #40
0
ファイル: MonitorAttribute.cs プロジェクト: 40a/Paramore
 /// <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);
 }