java.lang.Object
java.security.PolicySpi
Deprecated, for removal: This API element is subject to removal in a future version.
This class is only useful in conjunction with the Security Manager, which is deprecated and subject to removal in a future release. Consequently, this class is also deprecated and subject to removal. There is no replacement for the Security Manager or this class.
此类为
Policy类定义了服务提供者接口(SPI)。该类中的所有抽象方法必须由每个希望提供Policy实现的服务提供者来实现。
此抽象类的子类实现必须提供一个以Policy.Parameters对象作为输入参数的公共构造函数。如果构造函数不理解Policy.Parameters输入,则必须抛出IllegalArgumentException异常。
- 自版本:
- 1.6
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected PermissionCollectionengineGetPermissions(CodeSource codesource) 已弃用,将来会移除:此API元素可能在将来的版本中被移除。返回一个包含授予指定CodeSource的权限集的PermissionCollection对象。protected PermissionCollectionengineGetPermissions(ProtectionDomain domain) 已弃用,将来会移除:此API元素可能在将来的版本中被移除。返回一个包含授予指定ProtectionDomain的权限集的PermissionCollection对象。protected abstract booleanengineImplies(ProtectionDomain domain, Permission permission) 已弃用,将来会移除:此API元素可能在将来的版本中被移除。检查策略是否已向ProtectionDomain授予权限。protected void已弃用,将来会移除:此API元素可能在将来的版本中被移除。刷新/重新加载策略配置。
-
Constructor Details
-
PolicySpi
public PolicySpi()Deprecated, for removal: This API element is subject to removal in a future version.子类调用的构造函数。
-
-
Method Details
-
engineImplies
Deprecated, for removal: This API element is subject to removal in a future version.检查策略是否已向ProtectionDomain授予权限。- 参数:
-
domain- 要检查的ProtectionDomain。 -
permission- 检查此权限是否授予指定域。 - 返回:
-
如果权限已授予该域,则返回boolean
true。
-
engineRefresh
protected void engineRefresh()Deprecated, for removal: This API element is subject to removal in a future version.刷新/重新加载策略配置。此方法的行为取决于实现。例如,在基于文件的策略上调用refresh将导致重新读取文件。此方法的默认实现不执行任何操作。如果策略实现支持刷新操作,则应重写此方法。
-
engineGetPermissions
Deprecated, for removal: This API element is subject to removal in a future version.返回一个包含授予指定CodeSource的权限集的PermissionCollection对象。此方法的默认实现返回Policy.UNSUPPORTED_EMPTY_COLLECTION对象。如果策略实现可以返回授予CodeSource的权限集,则可以重写此方法。
- 参数:
-
codesource- 已授予返回的PermissionCollection的CodeSource。 - 返回:
- 授予指定CodeSource的权限集。如果支持此操作,则返回的权限集必须是新的可变实例,并且必须支持异构Permission类型。如果不支持此操作,则返回Policy.UNSUPPORTED_EMPTY_COLLECTION。
-
engineGetPermissions
Deprecated, for removal: This API element is subject to removal in a future version.返回一个包含授予指定ProtectionDomain的权限集的PermissionCollection对象。此方法的默认实现返回Policy.UNSUPPORTED_EMPTY_COLLECTION对象。如果策略实现可以返回授予ProtectionDomain的权限集,则可以重写此方法。
- 参数:
-
domain- 已授予返回的PermissionCollection的ProtectionDomain。 - 返回:
- 授予指定ProtectionDomain的权限集。如果支持此操作,则返回的权限集必须是新的可变实例,并且必须支持异构Permission类型。如果不支持此操作,则返回Policy.UNSUPPORTED_EMPTY_COLLECTION。
-