-
- All Known Implementing Classes:
- SubjectDomainCombiner
public interface DomainCombiner
ADomainCombiner
provides a means to dynamically update the ProtectionDomains associated with the currentAccessControlContext
.A
DomainCombiner
is passed as a parameter to the appropriate constructor forAccessControlContext
. The newly constructed context is then passed to theAccessController.doPrivileged(..., context)
method to bind the provided context (and associatedDomainCombiner
) with the current execution Thread. Subsequent calls toAccessController.getContext
orAccessController.checkPermission
cause theDomainCombiner.combine
to get invoked.The combine method takes two arguments. The first argument represents an array of ProtectionDomains from the current execution Thread, since the most recent call to
AccessController.doPrivileged
. If no call to doPrivileged was made, then the first argument will contain all the ProtectionDomains from the current execution Thread. The second argument represents an array of inherited ProtectionDomains, which may benull
. ProtectionDomains may be inherited from a parent Thread, or from a privileged context. If no call to doPrivileged was made, then the second argument will contain the ProtectionDomains inherited from the parent Thread. If one or more calls to doPrivileged were made, and the most recent call was to doPrivileged(action, context), then the second argument will contain the ProtectionDomains from the privileged context. If the most recent call was to doPrivileged(action), then there is no privileged context, and the second argument will benull
.The
combine
method investigates the two input arrays of ProtectionDomains and returns a single array containing the updated ProtectionDomains. In the simplest case, thecombine
method merges the two stacks into one. In more complex cases, thecombine
method returns a modified stack of ProtectionDomains. The modification may have added new ProtectionDomains, removed certain ProtectionDomains, or simply updated existing ProtectionDomains. Re-ordering and other optimizations to the ProtectionDomains are also permitted. Typically thecombine
method bases its updates on the information encapsulated in theDomainCombiner
.After the
AccessController.getContext
method receives the combined stack of ProtectionDomains back from theDomainCombiner
, it returns a new AccessControlContext that has both the combined ProtectionDomains as well as theDomainCombiner
.- Since:
- 1.3
- See Also:
AccessController
,AccessControlContext
-
-
Method Summary
Methods Modifier and Type Method and Description ProtectionDomain[]
combine(ProtectionDomain[] currentDomains, ProtectionDomain[] assignedDomains)
Modify or update the provided ProtectionDomains.
-
-
-
Method Detail
-
combine
ProtectionDomain[] combine(ProtectionDomain[] currentDomains, ProtectionDomain[] assignedDomains)
Modify or update the provided ProtectionDomains. ProtectionDomains may be added to or removed from the given ProtectionDomains. The ProtectionDomains may be re-ordered. Individual ProtectionDomains may be modified (with a new set of Permissions, for example).- 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
- an array of inherited ProtectionDomains. ProtectionDomains may be inherited from a parent Thread, or from a privilegedAccessControlContext
. This parameter may benull
if there are no inherited ProtectionDomains.- 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-java/security/domaincombiner.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.