Package org.jboss.modules.security
Class ModularProtectionDomain
java.lang.Object
java.security.ProtectionDomain
org.jboss.modules.security.ModularProtectionDomain
A protection domain which has a (modular) class loader but whose dynamicity is selectable.
- Author:
- David M. Lloyd
-
Constructor Summary
ConstructorsConstructorDescriptionModularProtectionDomain(CodeSource codeSource, PermissionCollection permissions, ModuleClassLoader moduleClassLoader) Construct a new, static instance.ModularProtectionDomain(CodeSource codeSource, PermissionCollection permissions, ModuleClassLoader moduleClassLoader, boolean dynamic) Construct a new instance. -
Method Summary
Modifier and TypeMethodDescriptionbooleanimplies(Permission permission) Determine if the permission collection of this protection domain implies the given permission.toString()Get a string representation of this protection domain.Methods inherited from class java.security.ProtectionDomain
getClassLoader, getCodeSource, getPermissions, getPrincipals, staticPermissionsOnly
-
Constructor Details
-
ModularProtectionDomain
public ModularProtectionDomain(CodeSource codeSource, PermissionCollection permissions, ModuleClassLoader moduleClassLoader, boolean dynamic) Construct a new instance. Thedynamicparameter determines whether the policy is consulted for permission checks; iffalse, then only the specified permission collection is consulted.- Parameters:
codeSource- the code source of the protection domain (must not benull)permissions- the permission collection (must not benull)moduleClassLoader- the module class loader (must not benull)dynamic-trueif the protection domain should be dynamic,falseotherwise
-
ModularProtectionDomain
public ModularProtectionDomain(CodeSource codeSource, PermissionCollection permissions, ModuleClassLoader moduleClassLoader) Construct a new, static instance. Only the specified permission collection is consulted for permission checks.- Parameters:
codeSource- the code source of the protection domain (must not benull)permissions- the permission collection (must not benull)moduleClassLoader- the module class loader (must not benull)
-
-
Method Details
-
implies
Determine if the permission collection of this protection domain implies the given permission. This is just a shortcut for callinggetPermissions().implies(permission).- Overrides:
impliesin classProtectionDomain- Parameters:
permission- the permission to check (must not benull)- Returns:
trueif the permission is implied,falseotherwise.
-
toString
Get a string representation of this protection domain.- Overrides:
toStringin classProtectionDomain- Returns:
- the string representation (not
null)
-