Lines Matching refs:Policy

47  * A Policy object is responsible for determining whether code executing
51 * <p> There is only one Policy object installed in the runtime at any
52 * given time. A Policy object can be installed by calling the
53 * <code>setPolicy</code> method. The installed Policy object can be
56 * <p> If no Policy object has been installed in the runtime, a call to
57 * <code>getPolicy</code> installs an instance of the default Policy
59 * The default Policy implementation can be changed by setting the value
61 * file) to the fully qualified name of the desired Policy subclass
67 * <p> Application code can directly subclass Policy to provide a custom
68 * implementation. In addition, an instance of a Policy object can be
72 * <p> Once a Policy instance has been installed (either by default, or by
76 * can perform SecurityManager-protected operations. How a Policy object
77 * retrieves its policy data is up to the Policy implementation itself.
79 * in a serialized binary file of the Policy class, or in a database.
87 * in a particular ProtectionDomain. This is dependent on the Policy
98 public abstract class Policy {
110 final Policy policy;
114 PolicyInfo(Policy policy, boolean initialized) {
144 * Returns the installed Policy object. This value should not be cached,
149 * to ensure it's ok to get the Policy object.
151 * @return the installed Policy.
156 * getting the Policy object.
159 * @see #setPolicy(java.security.Policy)
161 public static Policy getPolicy()
170 * Returns the installed Policy object, skipping the security check.
173 * @return the installed Policy.
175 static Policy getPolicyNoCheck()
181 synchronized (Policy.class) {
196 (Policy) Class.forName(policy_class).newInstance(),
208 Policy polFile = new sun.security.provider.PolicyFile();
213 Policy pol = AccessController.doPrivileged(
214 new PrivilegedAction<Policy>() {
215 public Policy run() {
225 return (extcl != null ? (Policy)Class.forName(
260 * Sets the system-wide Policy object. This method first calls
263 * permission to ensure it's ok to set the Policy.
265 * @param p the new system Policy object.
270 * setting the Policy.
276 public static void setPolicy(Policy p)
284 synchronized (Policy.class) {
295 private static void initPolicy (final Policy p) {
298 * security checks fulfilling a call to either Policy.implies
299 * or Policy.getPermissions. If this does occur the provider
309 * Policy.implies or Policy.getPermissions during this
312 * This Policy superclass caches away the ProtectionDomain and
313 * statically binds permissions so that legacy Policy
327 * calls to Policy.implies or Policy.getPermissions.
337 Policy pol = policy.get().policy;
357 * Returns a Policy object of the specified type.
361 * A new Policy object encapsulating the
368 * @param type the specified Policy type. See the Policy section in the
370 * "{@docRoot}/../technotes/guides/security/StandardNames.html#Policy">
372 * for a list of standard Policy types.
374 * @param params parameters for the Policy, which may be null.
376 * @return the new Policy object.
379 * to get a Policy instance for the specified type.
393 public static Policy getInstance(String type, Policy.Parameters params)
398 GetInstance.Instance instance = GetInstance.getInstance("Policy",
412 * Returns a Policy object of the specified type.
414 * <p> A new Policy object encapsulating the
422 * @param type the specified Policy type. See the Policy section in the
424 * "{@docRoot}/../technotes/guides/security/StandardNames.html#Policy">
426 * for a list of standard Policy types.
428 * @param params parameters for the Policy, which may be null.
432 * @return the new Policy object.
435 * to get a Policy instance for the specified type.
453 public static Policy getInstance(String type,
454 Policy.Parameters params,
464 GetInstance.Instance instance = GetInstance.getInstance("Policy",
479 * Returns a Policy object of the specified type.
481 * <p> A new Policy object encapsulating the
486 * @param type the specified Policy type. See the Policy section in the
488 * "{@docRoot}/../technotes/guides/security/StandardNames.html#Policy">
490 * for a list of standard Policy types.
492 * @param params parameters for the Policy, which may be null.
496 * @return the new Policy object.
499 * to get a Policy instance for the specified type.
513 public static Policy getInstance(String type,
514 Policy.Parameters params,
524 GetInstance.Instance instance = GetInstance.getInstance("Policy",
538 private static Policy handleException(NoSuchAlgorithmException nsae)
548 * Return the Provider of this Policy.
550 * <p> This Policy instance will only have a Provider if it
551 * was obtained via a call to <code>Policy.getInstance</code>.
554 * @return the Provider of this Policy, or null.
563 * Return the type of this Policy.
565 * <p> This Policy instance will only have a type if it
566 * was obtained via a call to <code>Policy.getInstance</code>.
569 * @return the type of this Policy, or null.
578 * Return Policy parameters.
580 * <p> This Policy instance will only have parameters if it
581 * was obtained via a call to <code>Policy.getInstance</code>.
584 * @return Policy parameters, or null.
588 public Policy.Parameters getParameters() {
604 * Policy.UNSUPPORTED_EMPTY_COLLECTION. This method can be
616 * Policy.UNSUPPORTED_EMPTY_COLLECTION is returned.
619 return Policy.UNSUPPORTED_EMPTY_COLLECTION;
637 * returns Policy.UNSUPPORTED_EMPTY_COLLECTION, then this method
652 * Policy.UNSUPPORTED_EMPTY_COLLECTION is returned.
758 * This subclass is returned by the getInstance calls. All Policy calls
761 private static class PolicyDelegate extends Policy {
766 private Policy.Parameters params;
769 String type, Policy.Parameters params) {
778 @Override public Policy.Parameters getParameters() { return params; }
801 * This represents a marker interface for Policy parameters.
811 * methods in the Policy class when those operations are not
812 * supported by the Policy implementation.