Top Fields Constructors Methods
org.jboss.modules

pack-priv final Class ModulesPolicy

extends Policy
Class Inheritance
Imports
java.security.AllPermission, .CodeSource, .Permission, .PermissionCollection, .Permissions, .Policy, .ProtectionDomain, .Provider

Deprecated

as a consequence of Policy being deprecated. See corresponding docs for further information.

Field Summary

Modifier and TypeField and Description
private static final AllPermission
pack-priv static final Permissions
private static final CodeSource
private final Policy
policy

Deprecated as a consequence of Policy being deprecated.
Inherited from java.security.Policy:
UNSUPPORTED_EMPTY_COLLECTION

Constructor Summary

AccessConstructor and Description
pack-priv
ModulesPolicy(final Policy policy)

Deprecated as a consequence of Policy being deprecated.

Method Summary

Modifier and TypeMethod and Description
private static Permissions
public Policy.Parameters
getParameters()

Overrides java.security.Policy.getParameters.

Deprecated as a consequence of Policy.Parameters being deprecated.
Return Policy parameters.
public PermissionCollection
getPermissions(final CodeSource
the CodeSource to which the returned PermissionCollection has been granted.
codesource
)

Overrides java.security.Policy.getPermissions.

Return a PermissionCollection object containing the set of permissions granted to the specified CodeSource.
public PermissionCollection
getPermissions(final ProtectionDomain
the ProtectionDomain to which the returned PermissionCollection has been granted.
domain
)

Overrides java.security.Policy.getPermissions.

Return a PermissionCollection object containing the set of permissions granted to the specified ProtectionDomain.
public Provider
getProvider()

Overrides java.security.Policy.getProvider.

Return the Provider of this policy.
public String
getType()

Overrides java.security.Policy.getType.

Return the type of this Policy.
public boolean
implies(final ProtectionDomain
the ProtectionDomain to test
domain
,
final Permission
the Permission object to be tested for implication.
permission
)

Overrides java.security.Policy.implies.

Evaluates the global policy for the permissions granted to the ProtectionDomain and tests whether the permission is granted.
public void
refresh()

Overrides java.security.Policy.refresh.

Refreshes/reloads the policy configuration.
Inherited from java.security.Policy:
getInstancegetInstancegetInstancegetPolicysetPolicy

Field Detail

ALL_PERMISSIONback to summary
private static final AllPermission ALL_PERMISSION
DEFAULT_PERMISSION_COLLECTIONback to summary
pack-priv static final Permissions DEFAULT_PERMISSION_COLLECTION
ourCodeSourceback to summary
private static final CodeSource ourCodeSource
policyback to summary
private final Policy policy

Deprecated

as a consequence of Policy being deprecated. See corresponding docs for further information.

Constructor Detail

ModulesPolicyback to summary
pack-priv ModulesPolicy(final Policy policy)

Deprecated

as a consequence of Policy being deprecated. See corresponding docs for further information.

Method Detail

getAllPermissionback to summary
private static Permissions getAllPermission()
getParametersback to summary
public Policy.Parameters getParameters()

Overrides java.security.Policy.getParameters.

Doc from java.security.Policy.getParameters.

Deprecated

as a consequence of Policy.Parameters being deprecated. See corresponding docs for further information.

Return Policy parameters.

This Policy instance will only have parameters if it was obtained via a call to Policy.getInstance. Otherwise this method returns null.

Returns:Policy.Parameters

Policy parameters, or null.

getPermissionsback to summary
public PermissionCollection getPermissions(final CodeSource codesource)

Overrides java.security.Policy.getPermissions.

Doc from java.security.Policy.getPermissions.

Return a PermissionCollection object containing the set of permissions granted to the specified CodeSource.

Applications are discouraged from calling this method since this operation may not be supported by all policy implementations. Applications should solely rely on the implies method to perform policy checks. If an application absolutely must call a getPermissions method, it should call getPermissions(ProtectionDomain).

The default implementation of this method returns Policy.UNSUPPORTED_EMPTY_COLLECTION. This method can be overridden if the policy implementation can return a set of permissions granted to a CodeSource.

Parameters
codesource:CodeSource

the CodeSource to which the returned PermissionCollection has been granted.

Returns:PermissionCollection

a set of permissions granted to the specified CodeSource. If this operation is supported, the returned set of permissions must be a new mutable instance and it must support heterogeneous Permission types. If this operation is not supported, Policy.UNSUPPORTED_EMPTY_COLLECTION is returned.

getPermissionsback to summary
public PermissionCollection getPermissions(final ProtectionDomain domain)

Overrides java.security.Policy.getPermissions.

Doc from java.security.Policy.getPermissions.

Return a PermissionCollection object containing the set of permissions granted to the specified ProtectionDomain.

Applications are discouraged from calling this method since this operation may not be supported by all policy implementations. Applications should rely on the implies method to perform policy checks.

The default implementation of this method first retrieves the permissions returned via getPermissions(CodeSource) (the CodeSource is taken from the specified ProtectionDomain), as well as the permissions located inside the specified ProtectionDomain. All of these permissions are then combined and returned in a new PermissionCollection object. If getPermissions(CodeSource) returns Policy.UNSUPPORTED_EMPTY_COLLECTION, then this method returns the permissions contained inside the specified ProtectionDomain in a new PermissionCollection object.

This method can be overridden if the policy implementation supports returning a set of permissions granted to a ProtectionDomain.

Parameters
domain:ProtectionDomain

the ProtectionDomain to which the returned PermissionCollection has been granted.

Returns:PermissionCollection

a set of permissions granted to the specified ProtectionDomain. If this operation is supported, the returned set of permissions must be a new mutable instance and it must support heterogeneous Permission types. If this operation is not supported, Policy.UNSUPPORTED_EMPTY_COLLECTION is returned.

getProviderback to summary
public Provider getProvider()

Overrides java.security.Policy.getProvider.

Doc from java.security.Policy.getProvider.

Return the Provider of this policy.

This Policy instance will only have a provider if it was obtained via a call to Policy.getInstance. Otherwise this method returns null.

Returns:Provider

the Provider of this policy, or null.

getTypeback to summary
public String getType()

Overrides java.security.Policy.getType.

Doc from java.security.Policy.getType.

Return the type of this Policy.

This Policy instance will only have a type if it was obtained via a call to Policy.getInstance. Otherwise this method returns null.

Returns:String

the type of this Policy, or null.

impliesback to summary
public boolean implies(final ProtectionDomain domain, final Permission permission)

Overrides java.security.Policy.implies.

Doc from java.security.Policy.implies.

Evaluates the global policy for the permissions granted to the ProtectionDomain and tests whether the permission is granted.

Parameters
domain:ProtectionDomain

the ProtectionDomain to test

permission:Permission

the Permission object to be tested for implication.

Returns:boolean

true if "permission" is a proper subset of a permission granted to this ProtectionDomain.

refreshback to summary
public void refresh()

Overrides java.security.Policy.refresh.

Doc from java.security.Policy.refresh.

Refreshes/reloads the policy configuration. The behavior of this method depends on the implementation. For example, calling refresh on a file-based policy will cause the file to be re-read.

The default implementation of this method does nothing. This method should be overridden if a refresh operation is supported by the policy implementation.