Top Description Fields Constructors Methods
org.jboss.modules.security

public Class ModularProtectionDomain

extends ProtectionDomain
Class Inheritance
Imports
java.security.CodeSource, .Permission, .PermissionCollection, .ProtectionDomain, org.jboss.modules.ModuleClassLoader

A protection domain which has a (modular) class loader but whose dynamicity is selectable.
Author
David M. Lloyd

Field Summary

Modifier and TypeField and Description
private final boolean

Constructor Summary

AccessConstructor and Description
public
ModularProtectionDomain(final CodeSource
the code source of the protection domain (must not be null)
codeSource
,
final PermissionCollection
the permission collection (must not be null)
permissions
,
final ModuleClassLoader
the module class loader (must not be null)
moduleClassLoader
,
boolean
true if the protection domain should be dynamic, false otherwise
dynamic
)

Construct a new instance.

public
ModularProtectionDomain(final CodeSource
the code source of the protection domain (must not be null)
codeSource
,
final PermissionCollection
the permission collection (must not be null)
permissions
,
final ModuleClassLoader
the module class loader (must not be null)
moduleClassLoader
)

Construct a new, static instance.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the permission is implied, false otherwise.
implies
(final Permission
the permission to check (must not be null)
permission
)

Overrides java.security.ProtectionDomain.implies.

Determine if the permission collection of this protection domain implies the given permission.
public String

Returns:

the string representation (not null)
toString
()

Overrides java.security.ProtectionDomain.toString.

Get a string representation of this protection domain.
Inherited from java.security.ProtectionDomain:
getClassLoadergetCodeSourcegetPermissionsgetPrincipalsstaticPermissionsOnly

Field Detail

dynamicback to summary
private final boolean dynamic

Constructor Detail

ModularProtectionDomainback to summary
public ModularProtectionDomain(final CodeSource codeSource, final PermissionCollection permissions, final ModuleClassLoader moduleClassLoader, boolean dynamic)

Construct a new instance. The dynamic parameter determines whether the policy is consulted for permission checks; if false, then only the specified permission collection is consulted.

Parameters
codeSource:CodeSource

the code source of the protection domain (must not be null)

permissions:PermissionCollection

the permission collection (must not be null)

moduleClassLoader:ModuleClassLoader

the module class loader (must not be null)

dynamic:boolean

true if the protection domain should be dynamic, false otherwise

ModularProtectionDomainback to summary
public ModularProtectionDomain(final CodeSource codeSource, final PermissionCollection permissions, final ModuleClassLoader moduleClassLoader)

Construct a new, static instance. Only the specified permission collection is consulted for permission checks.

Parameters
codeSource:CodeSource

the code source of the protection domain (must not be null)

permissions:PermissionCollection

the permission collection (must not be null)

moduleClassLoader:ModuleClassLoader

the module class loader (must not be null)

Method Detail

impliesback to summary
public boolean implies(final Permission permission)

Overrides java.security.ProtectionDomain.implies.

Determine if the permission collection of this protection domain implies the given permission. This is just a shortcut for calling getPermissions().implies(permission).

Parameters
permission:Permission

the permission to check (must not be null)

Returns:boolean

true if the permission is implied, false otherwise.

toStringback to summary
public String toString()

Overrides java.security.ProtectionDomain.toString.

Get a string representation of this protection domain.

Returns:String

the string representation (not null)