Show / Hide Table of Contents

Class AppDomainSyncRootRegistry

Provides a centralized, thread-safe registry of SyncRoot objects keyed by symbolic names. Each key maps to exactly one synchronization object for the lifetime of the application domain.

Inheritance
System.Object
AppDomainSyncRootRegistry
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: WizardWrx
Assembly: WizardWrx.Core.dll
Syntax
public static class AppDomainSyncRootRegistry
Remarks

The canonical key format for typed overloads is:

{AssemblyQualifiedTypeName}.{MethodName}

Use the typed overloads to get strict metadata validation. The raw-key overload is provided for advanced scenarios where the caller constructs a collision-proof key manually.

Properties

| Improve this Doc View Source

RegisteredSyncRoots

Enumerate all registered synchronization roots and their keys.

Declaration
public static IReadOnlyDictionary<string, SyncRoot> RegisteredSyncRoots { get; }
Property Value
Type Description
System.Collections.Generic.IReadOnlyDictionary<System.String, SyncRoot>
Remarks

The returned dictionary is a snapshot view of the current registry contents. It is intended for diagnostics, logging, and debugging.

Methods

| Improve this Doc View Source

GetSyncRoot(String)

Retrieve the SyncRoot associated with the specified raw key. This overload does not associate explicit type/method metadata with the key; it is the caller's responsibility to ensure that the key is collision-free and intention-revealing.

Declaration
public static SyncRoot GetSyncRoot(string pstrRawKey)
Parameters
Type Name Description
System.String pstrRawKey

This System.String represents a stable, unique identifier for the lock. No metadata validation is performed for this overload.

Returns
Type Description
SyncRoot

A reference to the SyncRoot associated with the specified key.

Exceptions
Type Condition
System.ArgumentException

Thrown if pstrRawKey is null, empty, or whitespace.

| Improve this Doc View Source

GetSyncRoot(Type, String)

Construct a canonical synchronization key from a type and method name, then retrieve the associated SyncRoot. This overload enforces strict metadata consistency for the key.

Declaration
public static SyncRoot GetSyncRoot(Type ptypDeclaringType, string pstrMethodName)
Parameters
Type Name Description
System.Type ptypDeclaringType

The declaring System.Type for the method being synchronized.

System.String pstrMethodName

This System.String represents the name of the method whose execution must be serialized.

Returns
Type Description
SyncRoot

If it succeeds, the return value is a reference to the SyncRoot associated with the constructed key.

Exceptions
Type Condition
System.ArgumentNullException

An ArgumentNullException Exception is thrown if ptypDeclaringType is null.

System.ArgumentException

An ArgumentException Exception is thrown if pstrMethodName is null, empty, or whitespace.

System.InvalidOperationException

An InvalidOperationException Exception is thrown if the constructed key is already associated with a different type or method name than the one supplied.

| Improve this Doc View Source

GetSyncRoot<T>(String)

Convenience overload that infers the declaring type from the generic type parameter and the method name from the caller context.

Declaration
public static SyncRoot GetSyncRoot<T>(string pstrCallerMemberName = "")
Parameters
Type Name Description
System.String pstrCallerMemberName

The name of the calling member, supplied automatically by the compiler.

Returns
Type Description
SyncRoot

A reference to the SyncRoot associated with the constructed key.

Type Parameters
Name Description
T

The declaring type for the method being synchronized.

  • Improve this Doc
  • View Source
Back to top Generated by DocFX