private void HandleErrorsOnGarbageSink(GarbageRegistrationKey key, Exception e) { this.TraceData(TraceEventType.Error, Resources.Error_SinkThrewUncaughtException, key, e); // TODO: Strategies for sinks that cause exceptions. }
/// <summary> /// Registers a garbage sink with the listener without activating. /// </summary> /// <param name="sink">the sink to register</param> /// <returns>A registration key for the sink</returns> /// <remarks>Sinks will not begin to recieve garbage notification /// until <em>after</em> the registration key's <em>Activate</em> /// method is called.</remarks> public ISinkRegistrationKey RegisterGarbageSink(IGarbageSink sink) { if (sink == null) throw new ArgumentNullException("sink"); GarbageRegistrationKey key = new GarbageRegistrationKey(this, sink); Util.LazyInitializeWithLock(ref _garbageNotifier, _notifierLock) .AddRegistration(key); return key; }