• Core
  • Infrastructure
  • Web
  • Extensions
Search Results for

    Show / Hide Table of Contents
    View Source

    Class MainDom

    Provides the full implementation of IMainDom.

    Inheritance
    System.Object
    Namespace: Umbraco.Cms.Core.Runtime
    Assembly: Umbraco.Core.dll
    Syntax
    public class MainDom : IMainDom, IRegisteredObject
    Remarks

    When an AppDomain starts, it tries to acquire the main domain status.

    When an AppDomain stops (eg the application is restarting) it should release the main domain status.

    Constructors

    View Source

    MainDom(ILogger<MainDom>, IMainDomLock)

    Declaration
    public MainDom(ILogger<MainDom> logger, IMainDomLock systemLock)
    Parameters
    Type Name Description
    ILogger<MainDom> logger
    IMainDomLock systemLock

    Properties

    View Source

    IsMainDom

    Gets a value indicating whether the current domain is the main domain.

    Declaration
    public bool IsMainDom { get; }
    Property Value
    Type Description
    System.Boolean
    Remarks

    Acquire must be called first else this will always return false

    Methods

    View Source

    Acquire(IApplicationShutdownRegistry)

    Tries to acquire the MainDom, returns true if successful else false

    Declaration
    public bool Acquire(IApplicationShutdownRegistry hostingEnvironment)
    Parameters
    Type Name Description
    IApplicationShutdownRegistry hostingEnvironment
    Returns
    Type Description
    System.Boolean
    View Source

    Dispose()

    Declaration
    public void Dispose()
    View Source

    Dispose(Boolean)

    Declaration
    protected virtual void Dispose(bool disposing)
    Parameters
    Type Name Description
    System.Boolean disposing
    View Source

    GetMainDomId(IHostingEnvironment)

    Declaration
    public static string GetMainDomId(IHostingEnvironment hostingEnvironment)
    Parameters
    Type Name Description
    IHostingEnvironment hostingEnvironment
    Returns
    Type Description
    System.String
    View Source

    Register(Nullable<Action>, Nullable<Action>, Int32)

    Registers a resource that requires the current AppDomain to be the main domain to function.

    Declaration
    public bool Register(Action? install = null, Action? release = null, int weight = 100)
    Parameters
    Type Name Description
    System.Nullable<Action> install

    An action to execute when registering.

    System.Nullable<Action> release

    An action to execute before the AppDomain releases the main domain status.

    System.Int32 weight

    An optional weight (lower goes first).

    Returns
    Type Description
    System.Boolean

    A value indicating whether it was possible to register.

    Remarks

    If registering is successful, then the install action is guaranteed to execute before the AppDomain releases the main domain status.

    Explicit Interface Implementations

    View Source

    IRegisteredObject.Stop(Boolean)

    Declaration
    void IRegisteredObject.Stop(bool immediate)
    Parameters
    Type Name Description
    System.Boolean immediate
    • Improve this Doc
    • View Source
    In This Article
    • Constructors
      • MainDom(ILogger<MainDom>, IMainDomLock)
    • Properties
      • IsMainDom
    • Methods
      • Acquire(IApplicationShutdownRegistry)
      • Dispose()
      • Dispose(Boolean)
      • GetMainDomId(IHostingEnvironment)
      • Register(Nullable<Action>, Nullable<Action>, Int32)
    • Explicit Interface Implementations
      • IRegisteredObject.Stop(Boolean)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX