JavaTM Platform
Standard Ed. 6

java.security
インタフェース DomainCombiner

既知の実装クラスの一覧:
SubjectDomainCombiner

public interface DomainCombiner

DomainCombiner では、動的に現行の AccessControlContext に関連した ProtectionDomains を変更する手段を提供します。  

DomainCombiner は、AccessControlContext の適切なコンストラクタにパラメータとして渡されます。次に、この新たに構築されたコンテキストは、AccessController.doPrivileged(..., context) メソッドに渡されて、指定されたコンテキストとそれに関連した DomainCombiner を現行の実行 Thread にバインドします。その後、AccessController.getContext または AccessController.checkPermission を呼び出すと、DomainCombiner.combine が呼び出されます。  

combine メソッドには引数が 2 つあります。第 1 引数は、現在実行中の Thread の、AccessController.doPrivileged を最後に呼び出してからの、ProtectionDomains の配列を表します。doPrivileged の呼び出しがない場合、第 1 引数には実行中の Thread からのすべての ProtectionDomains が含まれます。第 2 引数は継承された ProtectionDomains の配列を表します。 この引数は null の場合もあります。ProtectionDomains は親 Thread か、特権付きコンテキストから継承されます。doPrivileged の呼び出しがない場合、第 2 引数に親 Thread から継承された ProtectionDomains が含まれます。doPrivileged が 1 回以上呼び出され、最新の呼び出しが doPrivileged(action, context) である場合は、第 2 引数に特権付きコンテキストからの ProtectDomains が含まれます。最新の呼び出しが doPrivileged(action) である場合、特権付きコンテキストは存在せず、第 2 引数は null になります。  

combine メソッドでは、ProtectionDomains の 2 通りの入力配列を調べ、変更された ProtectionDomains を含む配置を 1 つ返します。もっとも単純な場合、combine メソッドは、2 つのスタックを 1 つに統合します。複雑になると、このメソッドは、ProtectionDomains の変更済みスタックを返します。変更には、新規 ProtectionDomains の追加、特定の ProtectionDomains の削除、または簡単に変更された既存の ProtectionDomains があります。ProtectionDomains に対する再順序付けとその他の最適化もまた許可されます。通常、combine メソッドは、DomainCombiner でカプセル化された情報に関するメソッドの変更を基にします。  

AccessController.getContext メソッドは、組み合わされた ProtectionDomains のスタックを DomainCombiner から受け取った後、DomainCombiner と、組み合わされた ProtectionDomains の 2 つを持つ新規 AccessControlContext を返します。

導入されたバージョン:
1.3
関連項目:
AccessController, AccessControlContext

メソッドの概要
 ProtectionDomain[] combine(ProtectionDomain[] currentDomains, ProtectionDomain[] assignedDomains)
          指定された ProtectionDomains を変更または更新します。
 

メソッドの詳細

combine

ProtectionDomain[] combine(ProtectionDomain[] currentDomains,
                           ProtectionDomain[] assignedDomains)
指定された ProtectionDomains を変更または更新します。ProtectionDomains は、指定された ProtectionDomains に追加されたり、削除されたりすることがあります。ProtectionDomains はまた、再順序付けされることもあります。個別の ProtectionDomains の場合、Permissions の新規セットなどを使って変更されることがあります。

パラメータ:
currentDomains - 実行中の Thread に関連した ProtectionDomains。最新の特権付き ProtectionDomain によって異なる。ProtectionDomains は、最後に実行した ProtectionDomain を配列の先頭にして、実行された順で列挙される。実行中の Thread に ProtectionDomain が関連付けられていない場合、このパラメータは null になる可能性がある

assignedDomains - 継承された ProtectionDomains の配列。ProtectionDomains は親 Thread か、特権付きの AccessControlContext から継承されている。継承された ProtectionDomain が存在しない場合、このパラメータは null になる可能性がある
戻り値:
変更された ProtectionDomain で構成される新規配列、または null

JavaTM Platform
Standard Ed. 6

バグの報告と機能のリクエスト
さらに詳しい API リファレンスおよび開発者ドキュメントについては、Java SE 開発者用ドキュメントを参照してください。開発者向けの詳細な解説、概念の概要、用語の定義、バグの回避策、およびコード実例が含まれています。

Copyright 2009 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Documentation Redistribution Policy も参照してください。