Orchard Source Analysis (5.2): beginrequest Event Handling (Defaultorchardhost.beginrequest method)

Source: Internet
Author: User

The purpose of BeginRequest event processing is to ensure that all shells have been loaded, or reloaded when the extension has changed. void iorchardhost . BeginRequest () { logger.debug ( "beginrequest"); beginrequest ();        } protected virtual void beginrequest () { //Ensure all shell contexts is loaded, or need to be reloaded if //extensions have changed monitorextensions ();buildcurrent (); startupdatedshells ();         }Through the analysis of the Iorchardhost.initialize method, the Monitorextensions and Buildcurrent methods are not unfamiliar. Here is the main focus on the Startupdateshells method: void startupdatedshells () { lock (_synclock) { If (_tenantstorestart.any ()) { foreach (var settings in _tenantstorestart.distinct (). ToList ()) { Activateshell (settings);                     }_tenantstorestart = Enumerable. empty<shellsettings > ();                 }            }        }_tenantstorestart is a collection of shellsettings: Private IEnumerable <shellsettings> _tenantstorestart; The function of this method is to reactivate the shell. In orchard, the concept of a subweb (Tenant) is proposed to increase the site density, which means that an application domain can have multiple subwebs. The shell is a sub-site (Tenant)-level singleton, in other words the shell represents a subweb. This is the way to reactivate the shell when some configuration changes to the orchard, and this change is only for some or some Shell, and there is no need to restart the entire application. As an example of the image point, we sometimes need to restart the operating system after Windows installs or updates the application, while sometimes we just need to restart the application. With respect to the shell, we have a dedicated space to introduce, including what the shell is and what it does, and how to create and activate operational analytics in more detail.Related types:Orchard.Environment.DefaultOrchardHost:IOrchardHost

Orchard Source Analysis (5.2): beginrequest Event Handling (Defaultorchardhost.beginrequest method)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.