本文整理汇总了Java中com.sun.rmi.rmid.ExecPermission类的典型用法代码示例。如果您正苦于以下问题:Java ExecPermission类的具体用法?Java ExecPermission怎么用?Java ExecPermission使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ExecPermission类属于com.sun.rmi.rmid包,在下文中一共展示了ExecPermission类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkConfiguration
import com.sun.rmi.rmid.ExecPermission; //导入依赖的package包/类
/**
* Prints warning message if installed Policy is the default Policy
* implementation and globally granted permissions do not include
* AllPermission or any ExecPermissions/ExecOptionPermissions.
*/
static void checkConfiguration() {
Policy policy =
AccessController.doPrivileged(new PrivilegedAction<Policy>() {
public Policy run() {
return Policy.getPolicy();
}
});
if (!(policy instanceof PolicyFile)) {
return;
}
PermissionCollection perms = getExecPermissions();
for (Enumeration<Permission> e = perms.elements();
e.hasMoreElements();)
{
Permission p = e.nextElement();
if (p instanceof AllPermission ||
p instanceof ExecPermission ||
p instanceof ExecOptionPermission)
{
return;
}
}
System.err.println(getTextResource("rmid.exec.perms.inadequate"));
}