/// <summary> /// Raises <see cref="ShutdownCompleted"/> event. /// </summary> /// <param name="e">The <see cref="MsgPack.Rpc.Protocols.ShutdownCompletedEventArgs"/> instance containing the event data.</param> /// <exception cref="ArgumentNullException"> /// <paramref name="e"/> is <c>null</c>. /// </exception> protected virtual void OnShutdownCompleted( ShutdownCompletedEventArgs e ) { if ( e == null ) { throw new ArgumentNullException( "e" ); } Contract.EndContractBlock(); MsgPackRpcServerProtocolsTrace.TraceEvent( MsgPackRpcServerProtocolsTrace.ManagerShutdownCompleted, "Manager shutdown is completed. {{ \"Manager\" : \"{0}\" }}", this ); var handler = Interlocked.CompareExchange( ref this._shutdownCompleted, null, null ); if ( handler != null ) { handler( this, e ); } }
/// <summary> /// Raises <see cref="ShutdownCompleted"/> event. /// </summary> /// <param name="e">The <see cref="MsgPack.Rpc.Protocols.ShutdownCompletedEventArgs"/> instance containing the event data.</param> /// <exception cref="ArgumentNullException"> /// <paramref name="e"/> is <c>null</c>. /// </exception> protected virtual void OnShutdownCompleted( ShutdownCompletedEventArgs e ) { if ( e == null ) { throw new ArgumentNullException( "e" ); } Contract.EndContractBlock(); var handler = Interlocked.CompareExchange( ref this._shutdownCompleted, null, null ); if ( handler != null ) { handler( this, e ); } Interlocked.Exchange( ref this._isInShutdown, 0 ); }