다음을 통해 공유


ApplicationPool 클래스

정의

IIS 7 애플리케이션 풀을 구성하고 관리하는 메서드 및 속성을 제공합니다.

public ref class ApplicationPool sealed : Microsoft::Web::Administration::ConfigurationElement
public sealed class ApplicationPool : Microsoft.Web.Administration.ConfigurationElement
type ApplicationPool = class
    inherit ConfigurationElement
Public NotInheritable Class ApplicationPool
Inherits ConfigurationElement
상속
ApplicationPool

예제

다음 예제에서는 클래스의 여러 메서드와 속성을 구현합니다 ApplicationPool . 다음은 서비스 모듈에서 개체를 ApplicationPool 검색하고, 개체의 ApplicationPool 속성 값을 수정하고, 개체를 속성 모음에 배치하고, 페이지 모듈에 속성 값을 표시하는 예제입니다.

서비스 모듈:

// Gets the application pool collection from the server.
[ModuleServiceMethod(PassThrough = true)]
public ArrayList GetApplicationPoolCollection()
{
    // Use an ArrayList to transfer objects to the client.
    ArrayList arrayOfApplicationBags = new ArrayList();

    ServerManager serverManager = new ServerManager();
    ApplicationPoolCollection applicationPoolCollection = serverManager.ApplicationPools;
    foreach (ApplicationPool applicationPool in applicationPoolCollection)
    {
        PropertyBag applicationPoolBag = new PropertyBag();
        applicationPoolBag[ServerManagerDemoGlobals.ApplicationPoolArray] = applicationPool;
        arrayOfApplicationBags.Add(applicationPoolBag);
        // If the applicationPool is stopped, restart it.
        if (applicationPool.State == ObjectState.Stopped)
        {
            applicationPool.Start();
        }
        // Set the CPU limit to a maximum of 25.
        if (applicationPool.Cpu.Limit > 25)
        {
            applicationPool.Cpu.Limit = 25;
        }
        // Set the process model max process to 1 to prohibit Web Garden
        if (applicationPool.ProcessModel.MaxProcesses > 1)
        {
            applicationPool.ProcessModel.MaxProcesses = 1;
        }
        // Set the recycling time to a maximum of one day (1440 minutes).
        if (applicationPool.Recycling.PeriodicRestart.Time.TotalMinutes > 1440)
        {
            applicationPool.Recycling.PeriodicRestart.Time = TimeSpan.FromMinutes(1440);
        }
    }

    // CommitChanges to persist the changes to the ApplicationHost.config.
    serverManager.CommitChanges();
    return arrayOfApplicationBags;
}

페이지 모듈:

// Get the ApplicationPool collection
ArrayList applicationPoolCollectionArray = _serviceProxy.GetApplicationPoolCollection();
string applicationdisplay = null;
applicationdisplay = "\nThere are " +
    applicationPoolCollectionArray.Count.ToString() + " applicationPools.\n";
foreach (PropertyBag bag in applicationPoolCollectionArray)
{
    ApplicationPool applicationPool = (ApplicationPool)bag[ServerManagerDemoGlobals.ApplicationPoolArray];
    applicationdisplay += "  " + applicationPool.Name + ":\n";
    applicationdisplay += "    FrameworkVersion - " + applicationPool.ManagedRuntimeVersion + "\n";
    applicationdisplay += "    State: " + applicationPool.State + "\n";
    applicationdisplay += "    WorkerProcesses: " + applicationPool.WorkerProcesses.Count + "\n";
    foreach (WorkerProcess workerProcess in applicationPool.WorkerProcesses)
    {
        applicationdisplay += "       " + workerProcess.ToString() + "\n";
    }
    applicationdisplay += "    CPU limit: " + applicationPool.Cpu.Limit.ToString() + "\n";
    applicationdisplay += "    MaxProcesses: " + applicationPool.ProcessModel.MaxProcesses.ToString() + "\n";
    applicationdisplay += "    Restart time: " + applicationPool.Recycling.PeriodicRestart.Time.TotalMinutes + "\n\n";
}

설명

이 클래스는 애플리케이션 풀에 대한 구성 및 관리 기능을 제공합니다. 이 클래스의 속성은 일반적으로 IIS 7 구성 시스템의 applicationPools 구성 요소 특성에 직접 해당합니다.

응용 프로그램 풀은 작업자 프로세스와 연결되고, 하나 이상의 응용 프로그램이 포함되어 있으며, 여러 응용 프로그램 간의 격리를 제공합니다.

속성

Attributes

이 요소의 특성 목록을 포함하는 구성 특성 컬렉션을 가져옵니다.

(다음에서 상속됨 ConfigurationElement)
AutoStart

IIS가 시작될 때 현재 애플리케이션 풀이 자동으로 시작되는지 여부를 나타내는 값을 가져오거나 설정합니다.

ChildElements

현재 요소의 모든 자식 요소를 가져옵니다.

(다음에서 상속됨 ConfigurationElement)
Cpu

현재 애플리케이션 풀에 대한 CPU 사용량 매개 변수를 가져옵니다.

ElementTagName

IIS 7 애플리케이션 풀을 구성하고 관리하는 메서드 및 속성을 제공합니다.

(다음에서 상속됨 ConfigurationElement)
Enable32BitAppOnWin64

64비트 프로세서가 있는 컴퓨터에서 32비트 애플리케이션을 실행할 수 있는지 여부를 나타내는 값을 가져오거나 설정합니다.

Failure

현재 애플리케이션 풀이 실패할 때 수행할 작업을 가져옵니다.

IsLocallyStored

구성 요소가 특정 구성 파일에 저장되는지 여부를 나타내는 값을 가져옵니다.

(다음에서 상속됨 ConfigurationElement)
Item[String]

지정된 이름의 특성을 가져오거나 설정합니다.

(다음에서 상속됨 ConfigurationElement)
ManagedPipelineMode

현재 애플리케이션 풀에서 관리되는 애플리케이션의 파이프라인 모드를 나타내는 값을 가져오거나 설정합니다.

ManagedRuntimeVersion

현재 애플리케이션 풀에서 관리되는 애플리케이션에 사용되는 .NET Framework 버전을 가져오거나 설정합니다.

Methods

구성 요소에 대한 메서드 컬렉션을 가져옵니다.

(다음에서 상속됨 ConfigurationElement)
Name

현재 애플리케이션 풀의 이름을 가져오거나 설정합니다.

ProcessModel

현재 애플리케이션 풀에 대한 프로세스 관리 특성을 가져옵니다.

QueueLength

요청을 거부하기 전에 애플리케이션 풀에서 큐에 대기할 최대 요청 수를 가져오거나 설정합니다.

RawAttributes

IIS 7 애플리케이션 풀을 구성하고 관리하는 메서드 및 속성을 제공합니다.

(다음에서 상속됨 ConfigurationElement)
Recycling

현재 애플리케이션 풀에 대한 재활용 설정을 가져옵니다.

Schema

현재 요소의 스키마를 가져옵니다.

(다음에서 상속됨 ConfigurationElement)
StartMode

IIS 7 애플리케이션 풀을 구성하고 관리하는 메서드 및 속성을 제공합니다.

State

현재 애플리케이션 풀의 런타임 상태를 가져옵니다.

WorkerProcesses

현재 애플리케이션 풀을 서비스하는 작업자 프로세스의 컬렉션을 가져옵니다.

메서드

Delete()

IIS 7 애플리케이션 풀을 구성하고 관리하는 메서드 및 속성을 제공합니다.

(다음에서 상속됨 ConfigurationElement)
GetAttribute(String)

요청된 ConfigurationAttribute 특성을 나타내는 개체를 반환합니다.

(다음에서 상속됨 ConfigurationElement)
GetAttributeValue(String)

지정된 특성의 값을 반환합니다.

(다음에서 상속됨 ConfigurationElement)
GetChildElement(String)

현재 구성 요소 아래에 있고 지정된 이름을 가진 자식 요소를 반환합니다.

(다음에서 상속됨 ConfigurationElement)
GetChildElement(String, Type)

현재 구성 요소 아래에 있고 지정된 이름과 형식을 가진 자식 요소를 반환합니다.

(다음에서 상속됨 ConfigurationElement)
GetCollection()

현재 구성 요소의 기본 컬렉션을 반환합니다.

(다음에서 상속됨 ConfigurationElement)
GetCollection(String)

현재 구성 요소에 속하는 모든 구성 요소를 반환합니다.

(다음에서 상속됨 ConfigurationElement)
GetCollection(String, Type)

지정된 이름과 형식을 가지며 현재 구성 요소 아래에 있는 구성 요소를 반환합니다.

(다음에서 상속됨 ConfigurationElement)
GetCollection(Type)

지정된 형식을 가지며 현재 구성 요소 아래에 있는 구성 요소를 반환합니다.

(다음에서 상속됨 ConfigurationElement)
GetMetadata(String)

요소 스키마에서 메타데이터 값을 반환합니다.

(다음에서 상속됨 ConfigurationElement)
Recycle()

현재 애플리케이션 풀을 재활용합니다.

SetAttributeValue(String, Object)

지정된 특성의 값을 설정합니다.

(다음에서 상속됨 ConfigurationElement)
SetMetadata(String, Object)

요소 스키마의 메타데이터 값을 설정합니다.

(다음에서 상속됨 ConfigurationElement)
Start()

현재 애플리케이션 풀을 시작합니다.

Stop()

현재 애플리케이션 풀을 중지합니다.

적용 대상

추가 정보