- java.lang.Object
-
- javax.security.auth.SubjectDomainCombiner
-
- All Implemented Interfaces:
- DomainCombiner
public class SubjectDomainCombiner extends Object implements DomainCombiner
ASubjectDomainCombiner
updates ProtectionDomains with Principals from theSubject
associated with thisSubjectDomainCombiner
.
-
-
Constructor Summary
Constructors Constructor and Description SubjectDomainCombiner(Subject subject)
Associate the providedSubject
with thisSubjectDomainCombiner
.
-
Method Summary
Methods Modifier and Type Method and Description ProtectionDomain[]
combine(ProtectionDomain[] currentDomains, ProtectionDomain[] assignedDomains)
Update the relevant ProtectionDomains with the Principals from theSubject
associated with thisSubjectDomainCombiner
.Subject
getSubject()
Get theSubject
associated with thisSubjectDomainCombiner
.
-
-
-
Constructor Detail
-
SubjectDomainCombiner
public SubjectDomainCombiner(Subject subject)
Associate the providedSubject
with thisSubjectDomainCombiner
.- Parameters:
subject
- theSubject
to be associated with with thisSubjectDomainCombiner
.
-
-
Method Detail
-
getSubject
public Subject getSubject()
Get theSubject
associated with thisSubjectDomainCombiner
.- Returns:
- the
Subject
associated with thisSubjectDomainCombiner
, ornull
if noSubject
is associated with thisSubjectDomainCombiner
. - Throws:
SecurityException
- if the caller does not have permission to get theSubject
associated with thisSubjectDomainCombiner
.
-
combine
public ProtectionDomain[] combine(ProtectionDomain[] currentDomains, ProtectionDomain[] assignedDomains)
Update the relevant ProtectionDomains with the Principals from theSubject
associated with thisSubjectDomainCombiner
.A new
ProtectionDomain
instance is created for eachProtectionDomain
in the currentDomains array. Each newProtectionDomain
instance is created using theCodeSource
,Permission
s andClassLoader
from the correspondingProtectionDomain
in currentDomains, as well as with the Principals from theSubject
associated 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:
combine
in interfaceDomainCombiner
- 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 executingProtectionDomain
residing at the beginning of the array. This parameter may benull
if 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 benull
if 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
.
-
-
Document created the 11/06/2005, last modified the 04/03/2020
Source of the printed document:https://www.gaudry.be/en/java-api-rf-javax/security/auth/SubjectDomainCombiner.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.