javax.security.auth
Class SubjectDomainCombiner
- java.lang.Object
-
- javax.security.auth.SubjectDomainCombiner
-
- All Implemented Interfaces:
- java.security.DomainCombiner
public class SubjectDomainCombiner extends java.lang.Object implements java.security.DomainCombinerASubjectDomainCombinerupdates ProtectionDomains with Principals from theSubjectassociated with thisSubjectDomainCombiner.
-
-
Constructor Summary
Constructors Constructor and Description SubjectDomainCombiner(Subject subject)Associate the providedSubjectwith thisSubjectDomainCombiner.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.security.ProtectionDomain[]combine(java.security.ProtectionDomain[] currentDomains, java.security.ProtectionDomain[] assignedDomains)Update the relevant ProtectionDomains with the Principals from theSubjectassociated with thisSubjectDomainCombiner.SubjectgetSubject()Get theSubjectassociated with thisSubjectDomainCombiner.
-
-
-
Constructor Detail
-
SubjectDomainCombiner
public SubjectDomainCombiner(Subject subject)
Associate the providedSubjectwith thisSubjectDomainCombiner.- Parameters:
subject- theSubjectto be associated with with thisSubjectDomainCombiner.
-
-
Method Detail
-
getSubject
public Subject getSubject()
Get theSubjectassociated with thisSubjectDomainCombiner.- Returns:
- the
Subjectassociated with thisSubjectDomainCombiner, ornullif noSubjectis associated with thisSubjectDomainCombiner. - Throws:
java.lang.SecurityException- if the caller does not have permission to get theSubjectassociated with thisSubjectDomainCombiner.
-
combine
public java.security.ProtectionDomain[] combine(java.security.ProtectionDomain[] currentDomains, java.security.ProtectionDomain[] assignedDomains)Update the relevant ProtectionDomains with the Principals from theSubjectassociated with thisSubjectDomainCombiner.A new
ProtectionDomaininstance is created for eachProtectionDomainin the currentDomains array. Each newProtectionDomaininstance is created using theCodeSource,Permissions andClassLoaderfrom the correspondingProtectionDomainin currentDomains, as well as with the Principals from theSubjectassociated with thisSubjectDomainCombiner.All of the newly instantiated ProtectionDomains are combined into a new array. The ProtectionDomains from the assignedDomains array are appended to this new array, and the result is returned.
Note that optimizations such as the removal of duplicate ProtectionDomains may have occurred. In addition, caching of ProtectionDomains may be permitted.
- Specified by:
combinein interfacejava.security.DomainCombiner- Parameters:
currentDomains- the ProtectionDomains associated with the current execution Thread, up to the most recent privilegedProtectionDomain. The ProtectionDomains are are listed in order of execution, with the most recently executingProtectionDomainresiding at the beginning of the array. This parameter may benullif the current execution Thread has no associated ProtectionDomains.assignedDomains- the ProtectionDomains inherited from the parent Thread, or the ProtectionDomains from the privileged context, if a call to AccessController.doPrivileged(..., context) had occurred This parameter may benullif there were no ProtectionDomains inherited from the parent Thread, or from the privileged context.- Returns:
- a new array consisting of the updated ProtectionDomains,
or
null.
-
-