本文整理汇总了Java中sun.security.util.Debug.getInstance方法的典型用法代码示例。如果您正苦于以下问题:Java Debug.getInstance方法的具体用法?Java Debug.getInstance怎么用?Java Debug.getInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sun.security.util.Debug
的用法示例。
在下文中一共展示了Debug.getInstance方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: seeAllp
import sun.security.util.Debug; //导入方法依赖的package包/类
/**
* Return true (merge policy permissions) in the following cases:
*
* . SecurityManager is null
*
* . SecurityManager is not null,
* debug is not null,
* SecurityManager impelmentation is in bootclasspath,
* Policy implementation is in bootclasspath
* (the bootclasspath restrictions avoid recursion)
*
* . SecurityManager is not null,
* debug is null,
* caller has Policy.getPolicy permission
*/
private static boolean seeAllp() {
SecurityManager sm = System.getSecurityManager();
if (sm == null) {
return true;
} else {
Debug debug = Debug.getInstance("domain");
if (debug != null) {
if (sm.getClass().getClassLoader() == null &&
Policy.getPolicyNoCheck().getClass().getClassLoader()
== null) {
return true;
}
} else {
try {
sm.checkPermission(SecurityConstants.GET_POLICY_PERMISSION);
return true;
} catch (SecurityException se) {
// fall thru and return false
}
}
}
return false;
}
示例2: getDebug
import sun.security.util.Debug; //导入方法依赖的package包/类
static Debug getDebug()
{
if (debugInit)
return debug;
else {
if (Policy.isSet()) {
debug = Debug.getInstance("access");
debugInit = true;
}
return debug;
}
}
示例3: getDebug
import sun.security.util.Debug; //导入方法依赖的package包/类
private static synchronized Debug getDebug() {
if (!debugInit) {
debug = Debug.getInstance("access");
debugInit = true;
}
return debug;
}
示例4: getDebug
import sun.security.util.Debug; //导入方法依赖的package包/类
static Debug getDebug()
{
if (debugInit)
return debug;
else {
if (Policy.isSet()) {
debug = Debug.getInstance("access");
debugInit = true;
}
return debug;
}
}
示例5: getDebug
import sun.security.util.Debug; //导入方法依赖的package包/类
private static synchronized Debug getDebug()
{
if (!debugInit) {
debug = Debug.getInstance("access");
debugInit = true;
}
return debug;
}