The third building block for the access controller is the facility to
specify which permissions should apply to which
sources. We call this global set of permissions the security policy;
it is encapsulated by the
Establish the security policy for a Java program. The policy encapsulates a mapping between code sources and permission objects in such a way that classes loaded from particular locations or signed by specific individuals have the set of specified permissions.
A policy class is constructed as follows:
Create a policy class. The constructor should initialize the policy
object according to its internal rules (e.g., by reading the
java.policy file, as we’ll describe
Like the security manager, only a single instance of the policy class can be installed in the virtual machine at any time. However, unlike the security manager, the actual instance of the policy class can be replaced. These two methods install and retrieve the policy:
Return the currently installed policy object.
Install the given policy object, replacing whatever policy object was previously installed.
Getting and setting the ...