private void FireEvent(string message, Exception ex)
        {
            string errorMsg;

            writerLock.AcquireWriterLock(-1);

            try
            {
                SetMessage(message);
                SetException(ex);
                SetExceptionMessage(string.Empty);
                errorMsg = ExceptionMessage;
                InstrumentedEvent.FireWmiEvent(this); // fire WMI event
            }
            finally
            {
                writerLock.ReleaseWriterLock();
            }

            if (ex == null)
            {
                FireAuxEvent(message);
            }
            else
            {
                FireAuxEvent(message + SR.ExceptionString + errorMsg);
            }
        }
Ejemplo n.º 2
0
 /// <devdoc>
 /// Creates a new ExceptionHandlingEvent object and instantiates an internal event
 /// with the specified counter names.
 /// </devdoc>
 /// <summary/>
 /// <param name="counterNames"/>
 /// <exclude/>
 protected ExceptionHandlingEvent(string[] counterNames)
 {
     InternalEvent = new InstrumentedEvent(
         ExceptionHandledEvent.InstrumentationCounterCategory,
         counterNames,
         true);
 }
Ejemplo n.º 3
0
 /// <summary/>
 /// <param name="counterNames"/>
 /// <exclude/>
 /// <devdoc>
 /// Factory method to create a new InstrumentedEvent based on the counterNames
 /// </devdoc>
 protected CachingServiceEvent(string[] counterNames) : this()
 {
     internalEvent = new InstrumentedEvent(
         SR.CachingInstrumentationCounterCategory,
         counterNames,
         true);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Constructor with performance counter names only.
 /// </summary>
 /// <param name="counterNames">Array of names of performance counters defined for Logging</param>
 protected LoggingServiceEvent(string[] counterNames)
 {
     this.eventMessage  = string.Empty;
     this.internalEvent = new InstrumentedEvent(
         SR.InstrumentationCounterCategory,
         counterNames,
         true);
 }
Ejemplo n.º 5
0
 /// <summary/>
 /// <param name="connectionString"/>
 /// <exclude/>
 protected void FireEvent(string connectionString)
 {
     lock (lockObj)
     {
         Message = SR.MessageDataConnectionOpened(connectionString);
         InstrumentedEvent.FireWmiEvent(this);
     }
     FireAuxEvent(Message);
 }
Ejemplo n.º 6
0
 /// <devdoc>
 /// Creates a new ExceptionHandlingEvent object and instantiates an internal event
 /// with the specified counter names and event log ID's.
 /// </devdoc>
 /// <summary/>
 /// <param name="counterNames"/>
 /// <param name="eventLogIDs"/>
 /// <exclude/>
 protected ExceptionHandlingEvent(string[] counterNames, EventLogIdentifier[] eventLogIDs)
 {
     InternalEvent = new InstrumentedEvent(
         ExceptionHandledEvent.InstrumentationCounterCategory,
         counterNames,
         true,
         EventSourceName,
         eventLogIDs);
 }
Ejemplo n.º 7
0
 /// <summary/>
 /// <exclude/>
 protected CachingServiceEvent(string[] counterNames, EventLogIdentifier[] eventLogIdentifiers) : this()
 {
     internalEvent = new InstrumentedEvent(
         SR.CachingInstrumentationCounterCategory,
         counterNames,
         true,
         SR.CachingInstrumentationEventSource,
         eventLogIdentifiers);
 }
Ejemplo n.º 8
0
 /// <summary/>
 /// <param name="connectionString"/>
 /// <exclude/>
 private void FireEvent(string connectionString)
 {
     lock (lockObj)
     {
         Message = SR.MessageConnection(connectionString);
         InstrumentedEvent.FireWmiEvent(this);
     }
     FireAuxEvent(string.Empty);
 }
Ejemplo n.º 9
0
 /// <summary/>
 /// <param name="connectionString"/>
 /// <exclude/>
 protected void FireEvent(string connectionString)
 {
     Message = SR.ExceptionMessageDatabaseConnectionFailed(connectionString);
     lock (lockObj)
     {
         InstrumentedEvent.FireWmiEvent(this);
     }
     FireAuxEvent(Message);
 }
Ejemplo n.º 10
0
 private void FireEvent(long itemRemoved, long sizeLimit, int scavengingRange)
 {
     lock (lockObj)
     {
         this.itemRemoved     = itemRemoved;
         this.sizeLimit       = sizeLimit;
         this.scavengingRange = scavengingRange;
         InstrumentedEvent.FireWmiEvent(this);
     }
 }
        /// <summary/>
        /// <param name="message"/>
        /// <exclude/>
        protected void FireEvent(string message)
        {
            lock (lockObj)
            {
                eventMessage = message;
                InstrumentedEvent.FireWmiEvent(this);
            }

            FireAuxEvent(string.Empty);
        }
Ejemplo n.º 12
0
 /// <summary>
 /// Constructor with performance counter names and event log Ids.
 /// </summary>
 /// <param name="counterNames">Array of names of performance counters defined for Logging</param>
 /// <param name="eventLogIDs">Array of <see cref="EventLogIdentifier"></see>s</param>
 protected LoggingServiceEvent(string[] counterNames, EventLogIdentifier[] eventLogIDs)
 {
     this.eventMessage  = string.Empty;
     this.internalEvent = new InstrumentedEvent(
         SR.InstrumentationCounterCategory,
         counterNames,
         true,
         SR.InstrumentationEventSource,
         eventLogIDs);
 }
 private void FireEvent(string message, Exception ex)
 {
     lock (lockObj)
     {
         base.eventMessage        = message;
         reportedException        = ex;
         reportedExceptionMessage = string.Empty;
         InstrumentedEvent.FireWmiEvent(this);
     }
     FireAuxEvent(message + "  Exception: " + ExceptionMessage);
 }
Ejemplo n.º 14
0
        private void FireEvent(string commandText, string connectionString)
        {
            lock (lockObj)
            {
                Message          = SR.ExceptionMessageDatabaseCommandFailed(connectionString);
                this.commandText = commandText;
                InstrumentedEvent.FireWmiEvent(this);
            }

            FireAuxEvent(string.Empty);
        }
        private CachingServiceItemTurnoverEvent(string[] counterNames)
        {
            InstrumentedEvent internalEvent;

            internalEvent = new InstrumentedEvent(SR.CachingInstrumentationCounterCategory,
                                                  counterNames,
                                                  true);

            turnOverInstances     = internalEvent.GetPerformanceCounterInstances(SR.PerfCounterCacheTurnoverRate);
            totalEntriesInstances = internalEvent.GetPerformanceCounterInstances(SR.PerfCounterTotalCacheEntries);
        }
Ejemplo n.º 16
0
 private void FireEvent(string message, Exception ex, string failedConfigurationFile)
 {
     lock (lockObj)
     {
         Message = message;
         this.failedConfigurationFile = failedConfigurationFile;
         Exception        = ex;
         ExceptionMessage = string.Empty;
         InstrumentedEvent.FireWmiEvent(this);
     }
     FireAuxEvent(SR.ExceptionMessageConfigurationLoadFailed(failedConfigurationFile, ExceptionMessage));
 }
Ejemplo n.º 17
0
 private SecurityCacheReadEvent(string[] counterNames)
 {
     internalEvent = new InstrumentedEvent(
         SR.InstrumentationCounterCategory, counterNames, true);
     perfCounters = new PerformanceCounterInstances[]
     {
         internalEvent.GetPerformanceCounterInstances(SecurityServiceEvent.Counters[(int)SecurityServiceEvent.CounterID.CacheHits].CounterName),
         internalEvent.GetPerformanceCounterInstances(SecurityServiceEvent.Counters[(int)SecurityServiceEvent.CounterID.CacheMisses].CounterName),
         internalEvent.GetPerformanceCounterInstances(SecurityServiceEvent.Counters[(int)SecurityServiceEvent.CounterID.TotalCacheReads].CounterName),
         internalEvent.GetPerformanceCounterInstances(SecurityServiceEvent.Counters[(int)SecurityServiceEvent.CounterID.CacheHitRatio].CounterName)
     };
 }
Ejemplo n.º 18
0
 private CachingServiceItemReadEvent(string[] counterNames)
 {
     internalEvent = new InstrumentedEvent(
         SR.CachingInstrumentationCounterCategory, counterNames, true);
     perfCounters = new PerformanceCounterInstances[]
     {
         internalEvent.GetPerformanceCounterInstances(SR.PerfCounterCacheHitsSec),
         internalEvent.GetPerformanceCounterInstances(SR.PerfCounterCacheMissesSec),
         internalEvent.GetPerformanceCounterInstances(SR.PerfCounterCacheAccessAttempts),
         internalEvent.GetPerformanceCounterInstances(SR.PerfCounterCacheHitRatio)
     };
 }
Ejemplo n.º 19
0
        private void FireEvent(string message, Exception ex)
        {
            lock (lockObj)
            {
                Message          = message;
                Exception        = ex;
                ExceptionMessage = string.Empty;
                InstrumentedEvent.FireWmiEvent(this);
            }

            FireAuxEvent(string.Concat(message, SR.ExceptionMsg, ExceptionMessage));
        }
Ejemplo n.º 20
0
        private void FireEvent(string message, Exception ex)
        {
            lock (lockObj)
            {
                Message = message;
                failedConfigurationFile = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile;
                Exception        = ex;
                ExceptionMessage = string.Empty;
                InstrumentedEvent.FireWmiEvent(this);
            }

            FireAuxEvent(string.Concat(message, SR.ExceptionMsg, ExceptionMessage));
        }
Ejemplo n.º 21
0
 private void FireEvent(string message, bool started)
 {
     writerLock.AcquireWriterLock(LockTimeout);
     try
     {
         this.startedFlag  = started;
         this.eventMessage = message;
         InstrumentedEvent.FireWmiEvent(this);
     }
     finally
     {
         writerLock.ReleaseWriterLock();
     }
 }
Ejemplo n.º 22
0
        /// <summary/>
        /// <param name="message"/>
        /// <exclude/>
        protected void FireEvent(string message)
        {
            writerLock.AcquireWriterLock(LockTimeout);
            try
            {
                eventMessage = message;
                InstrumentedEvent.FireWmiEvent(this);
            }
            finally
            {
                writerLock.ReleaseWriterLock();
            }

            FireAuxEvent(string.Empty);
        }
Ejemplo n.º 23
0
        private void FireEvent(string message, Exception ex)
        {
            writerLock.AcquireWriterLock(LockTimeout);

            try
            {
                eventMessage            = message;
                failureException        = ex;
                failureExceptionMessage = string.Empty;

                InstrumentedEvent.FireWmiEvent(this);
            }
            finally
            {
                writerLock.ReleaseWriterLock();
            }
        }
Ejemplo n.º 24
0
 /// <summary/>
 /// <param name="counterNames"/>
 /// <exclude/>
 protected DataServiceEvent(string[] counterNames)
 {
     Message       = string.Empty;
     InternalEvent = new InstrumentedEvent(SR.CounterCategory, counterNames, true);
 }
Ejemplo n.º 25
0
 /// <summary>
 /// Default constructor.
 /// </summary>
 protected LoggingServiceEvent()
 {
     this.eventMessage  = string.Empty;
     this.internalEvent = null;
 }
Ejemplo n.º 26
0
 /// <summary/>
 /// <param name="counterNames"/>
 /// <param name="eventLogIds"/>
 /// <exclude/>
 protected DataServiceEvent(string[] counterNames, EventLogIdentifier[] eventLogIds)
 {
     Message       = string.Empty;
     InternalEvent = new InstrumentedEvent(SR.CounterCategory, counterNames, true, SR.EventSource, eventLogIds);
 }
 private void FireEventCore()
 {
     InstrumentedEvent.FireWmiEvent(this);
 }
Ejemplo n.º 28
0
 /// <summary/>
 /// <exclude/>
 protected CachingServiceEvent()
 {
     eventMessage  = string.Empty;
     internalEvent = null;
 }
Ejemplo n.º 29
0
 /// <summary/>
 /// <exclude/>
 protected SecurityCryptoServiceEvent()
 {
     this.eventMessage  = string.Empty;
     this.internalEvent = null;
 }