Package org.jboss.modules.security
Class ModularProtectionDomain
- java.lang.Object
-
- java.security.ProtectionDomain
-
- org.jboss.modules.security.ModularProtectionDomain
-
public class ModularProtectionDomain extends java.security.ProtectionDomain
A protection domain which has a (modular) class loader but whose dynamicity is selectable.- Author:
- David M. Lloyd
-
-
Constructor Summary
Constructors Constructor Description ModularProtectionDomain(java.security.CodeSource codeSource, java.security.PermissionCollection permissions, ModuleClassLoader moduleClassLoader)
Construct a new, static instance.ModularProtectionDomain(java.security.CodeSource codeSource, java.security.PermissionCollection permissions, ModuleClassLoader moduleClassLoader, boolean dynamic)
Construct a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
implies(java.security.Permission permission)
Determine if the permission collection of this protection domain implies the given permission.java.lang.String
toString()
Get a string representation of this protection domain.
-
-
-
Constructor Detail
-
ModularProtectionDomain
public ModularProtectionDomain(java.security.CodeSource codeSource, java.security.PermissionCollection permissions, ModuleClassLoader moduleClassLoader, boolean dynamic)
Construct a new instance. Thedynamic
parameter 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
-true
if the protection domain should be dynamic,false
otherwise
-
ModularProtectionDomain
public ModularProtectionDomain(java.security.CodeSource codeSource, java.security.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 Detail
-
implies
public boolean implies(java.security.Permission permission)
Determine if the permission collection of this protection domain implies the given permission. This is just a shortcut for callinggetPermissions().implies(permission)
.- Overrides:
implies
in classjava.security.ProtectionDomain
- Parameters:
permission
- the permission to check (must not benull
)- Returns:
true
if the permission is implied,false
otherwise.
-
toString
public java.lang.String toString()
Get a string representation of this protection domain.- Overrides:
toString
in classjava.security.ProtectionDomain
- Returns:
- the string representation (not
null
)
-
-