IHttpStoredContext インターフェイス

格納されているデータのコンテキスト情報を定義します。

構文

class IHttpStoredContext  

メソッド

次の表に、IHttpStoredContext クラスによって公開されるメソッドの一覧を示します。

名前 説明
CleanupStoredContext 格納されているコンテキストをクリーンアップします。

派生クラス

名前 説明
IWebSocketContext 1 つの TCP ソケットを介した双方向 WebSocket 通信のコンテキスト サポートを表します。

解説

多くの IIS 7 クラスでは、 private IDispensedHttpModuleContextContainer ポインターがメンバー変数として保持されています。 これらのクラスは、 IHttpApplicationIHttpConnectionIHttpContextIHttpFileInfoIHttpSiteIHttpUrlInfoIMetadataInfo など、さまざまなインターフェイスを実装します。

これらの各インターフェイスは、引数を受け入れず、IHttpModuleContextContainer ポインターを返すGetModuleContextContainer メソッドを定義します。 さまざまな GetModuleContextContainer メソッドが呼び出されると、これらの実装者のほとんどは、 private データをアップキャスト IHttpModuleContextContainerとして返します。 これにより、インターフェイスの実装者は、これらのコンテナーの有効期間を維持しながら、カスタム コンテナーを公開できます。

IHttpStoredContext インターフェイスを実装するカスタム クラスを定義し、new演算子を呼び出すことによって、このIHttpStoredContext クラス実装者へのポインターを作成できます。 その後、IHttpModuleContextContainer::SetModuleContext メソッドと IHttpModuleContextContainer::GetModuleContext メソッドをそれぞれ呼び出すことによって、IHttpModuleContextContainer ポインターに対してこのポインターを追加および取得できます。

IHttpStoredContext ポインターが不要になると、CleanupStoredContext メソッドが内部的に呼び出されます。ここで、IHttpStoredContext インターフェイス メソッドの実装者は通常、delete``thisを呼び出す必要があります。

注意事項

dynamic_cast演算子を使用してIHttpModuleContextContainerIDispensedHttpModuleContextContainerにダウンキャストするのは安全な操作ですが、このキャストは実行しないでください。 IDispensedHttpModuleContextContainer インターフェイスは、基本インターフェイスに ReleaseContainer メソッドを 1 つだけ追加します。このメソッドは内部でのみ呼び出す必要があります。

要件

説明
クライアント - Windows Vista 上の IIS 7.0
- Windows 7 上の IIS 7.5
- Windows 8 上の IIS 8.0
- Windows 10 上の IIS 10.0
[サーバー] - Windows Server 2008 上の IIS 7.0
- Windows Server 2008 R2 上の IIS 7.5
- Windows Server 2012 上の IIS 8.0
- Windows Server 2012 R2 上の IIS 8.5
- Windows Server 2016 上の IIS 10.0
Product - IIS 7.0、IIS 7.5、IIS 8.0、IIS 8.5、IIS 10.0
- IIS Express 7.5、IIS Express 8.0、IIS Express 10.0
ヘッダー Httpserv.h

参照

Web Server Core インターフェイス