AppPool.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / SMSvcHost / System / ServiceModel / Activation / AppPool.cs / 1 / AppPool.cs

                            //------------------------------------------------------------------------------ 
// Copyright (c) Microsoft Corporation.  All rights reserved.
//-----------------------------------------------------------------------------

namespace System.ServiceModel.Activation 
{
    using System; 
    using System.Collections.Generic; 
    using System.Diagnostics;
    using System.Security.Principal; 
    using System.ServiceModel;
    using System.ServiceModel.Diagnostics;

    class AppPool 
    {
        string appPoolId; 
        List apps; 
        bool enabled;
        SecurityIdentifier securityIdentifier; 

        internal AppPool(string appPoolId, bool enabled, SecurityIdentifier securityIdentifier)
        {
            this.apps = new List(); 
            this.appPoolId = appPoolId;
            this.enabled = enabled; 
            this.securityIdentifier = securityIdentifier; 
        }
 
        internal string AppPoolId { get { return appPoolId; } }
        internal bool Enabled { get { return enabled; } }

        internal void AddApp(App app) 
        {
            lock(this.apps) 
            { 
                this.apps.Add(app);
            } 
        }

        internal void RemoveApp(App app)
        { 
            lock(this.apps)
            { 
                this.apps.Remove(app); 
            }
        } 

        internal IEnumerable SnapshotApps()
        {
            lock(this.apps) 
            {
                return new List(this.apps); 
            } 
        }
 
        internal void OnDeleted()
        {
            // We should have removed all apps.
            DiagnosticUtility.DebugAssert(apps.Count == 0, ""); 
            this.enabled = false;
        } 
 
        internal void SetEnabledState(bool enabled)
        { 
            if (this.enabled != enabled)
            {
                this.enabled = enabled;
 
                foreach (App app in apps)
                { 
                    app.OnAppPoolStateChanged(); 
                }
            } 
        }

        internal bool IsEnabled
        { 
            get
            { 
                return this.enabled; 
            }
        } 

        internal void SetIdentity(SecurityIdentifier securityIdentifier)
        {
            this.securityIdentifier = securityIdentifier; 
        }
    } 
 
}
 

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.


                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK