Java™ Platform
Standard Ed. 7
java.security
Class ProtectionDomain
-
-
Constructor Detail
-
ProtectionDomain
public ProtectionDomain(CodeSource codesource,
PermissionCollection permissions)
Creates a new ProtectionDomain with the given CodeSource and
Permissions. If the permissions object is not null, then
setReadOnly()) will be called on the passed in
Permissions object. The only permissions granted to this domain
are the ones specified; the current Policy will not be consulted.
- Parameters:
codesource - the codesource associated with this domainpermissions - the permissions granted to this domain
-
ProtectionDomain
public ProtectionDomain(CodeSource codesource,
PermissionCollection permissions,
ClassLoader classloader,
Principal[] principals)
Creates a new ProtectionDomain qualified by the given CodeSource,
Permissions, ClassLoader and array of Principals. If the
permissions object is not null, then
setReadOnly()
will be called on the passed in Permissions object.
The permissions granted to this domain are dynamic; they include
both the static permissions passed to this constructor, and any
permissions granted to this domain by the current Policy at the
time a permission is checked.
This constructor is typically used by
ClassLoaders
and DomainCombiners which delegate to
Policy to actively associate the permissions granted to
this domain. This constructor affords the
Policy provider the opportunity to augment the supplied
PermissionCollection to reflect policy changes.
- Parameters:
codesource - the CodeSource associated with this domainpermissions - the permissions granted to this domainclassloader - the ClassLoader associated with this domainprincipals - the array of Principals associated with this
domain. The contents of the array are copied to protect against
subsequent modification.- Since:
- 1.4
- See Also:
Policy.refresh(),
Policy.getPermissions(ProtectionDomain)
Java™ Platform
Standard Ed. 7
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2020, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.