private static ClassLoader identifyClassLoader() { ClassLoader classLoader = WildFlySecurityManager.isChecking() ? AccessController.doPrivileged(GetContextClassLoaderAction.getInstance()) : GetContextClassLoaderAction.getInstance().run(); return classLoader != null ? classLoader : ClassLoader.getSystemClassLoader(); }
/** * Get the current thread's context class loader, doing a faster permission check that skips having to execute a * privileged action frame. * * @return the context class loader */ public static ClassLoader getCurrentContextClassLoaderPrivileged() { final SecurityManager sm = System.getSecurityManager(); if (sm == null) { return currentThread().getContextClassLoader(); } if (sm instanceof WildFlySecurityManager) { final Context ctx = CTX.get(); if (! ctx.checking) { return currentThread().getContextClassLoader(); } ctx.checking = false; try { checkPDPermission(getCallerClass(2), GET_CLASS_LOADER_PERMISSION); return currentThread().getContextClassLoader(); } finally { ctx.checking = true; } } else { checkPDPermission(getCallerClass(2), GET_CLASS_LOADER_PERMISSION); return doPrivileged(GetContextClassLoaderAction.getInstance()); } }
private static ClassLoader identifyClassLoader() { ClassLoader classLoader = getSecurityManager() != null ? AccessController.doPrivileged(GetContextClassLoaderAction.getInstance()) : GetContextClassLoaderAction.getInstance().run(); return classLoader != null ? classLoader : ClassLoader.getSystemClassLoader(); }
static ClassLoader getContextClassLoader() { return getSecurityManager() == null ? Thread.currentThread().getContextClassLoader() : doPrivileged(GetContextClassLoaderAction.getInstance()); }
static ClassLoader getContextClassLoader() { return getSecurityManager() == null ? Thread.currentThread().getContextClassLoader() : doPrivileged(GetContextClassLoaderAction.getInstance()); }
static ClassLoader getContextClassLoader() { return getSecurityManager() == null ? Thread.currentThread().getContextClassLoader() : doPrivileged(GetContextClassLoaderAction.getInstance()); }
static ClassLoader getContextClassLoader() { return getSecurityManager() == null ? Thread.currentThread().getContextClassLoader() : doPrivileged(GetContextClassLoaderAction.getInstance()); }
static ClassLoader getContextClassLoader() { return getSecurityManager() == null ? Thread.currentThread().getContextClassLoader() : doPrivileged(GetContextClassLoaderAction.getInstance()); }
static ClassLoader getContextClassLoader() { return getSecurityManager() == null ? Thread.currentThread().getContextClassLoader() : doPrivileged(GetContextClassLoaderAction.getInstance()); }
static ClassLoader getContextClassLoader() { return getSecurityManager() == null ? Thread.currentThread().getContextClassLoader() : doPrivileged(GetContextClassLoaderAction.getInstance()); }
static ClassLoader getContextClassLoader() { return getSecurityManager() == null ? Thread.currentThread().getContextClassLoader() : doPrivileged(GetContextClassLoaderAction.getInstance()); }
static ClassLoader getContextClassLoader() { return getSecurityManager() == null ? Thread.currentThread().getContextClassLoader() : doPrivileged(GetContextClassLoaderAction.getInstance()); }
static ClassLoader getContextClassLoader() { return getSecurityManager() == null ? Thread.currentThread().getContextClassLoader() : doPrivileged(GetContextClassLoaderAction.getInstance()); }
private static ClassLoader identifyClassLoader() { ClassLoader classLoader = WildFlySecurityManager.isChecking() ? AccessController.doPrivileged(GetContextClassLoaderAction.getInstance()) : GetContextClassLoaderAction.getInstance().run(); return classLoader != null ? classLoader : ClassLoader.getSystemClassLoader(); }
/** * Get the current thread's context class loader, doing a faster permission check that skips having to execute a * privileged action frame. * * @return the context class loader */ public static ClassLoader getCurrentContextClassLoaderPrivileged() { final SecurityManager sm = System.getSecurityManager(); if (sm == null) { return currentThread().getContextClassLoader(); } if (sm instanceof WildFlySecurityManager) { final Context ctx = CTX.get(); if (! ctx.checking) { return currentThread().getContextClassLoader(); } ctx.checking = false; try { checkPDPermission(getCallerClass(2), GET_CLASS_LOADER_PERMISSION); return currentThread().getContextClassLoader(); } finally { ctx.checking = true; } } else { checkPDPermission(getCallerClass(2), GET_CLASS_LOADER_PERMISSION); return doPrivileged(GetContextClassLoaderAction.getInstance()); } }
/** * Get the current thread's context class loader, doing a faster permission check that skips having to execute a * privileged action frame. * * @return the context class loader */ public static ClassLoader getCurrentContextClassLoaderPrivileged() { final SecurityManager sm = System.getSecurityManager(); if (sm == null) { return currentThread().getContextClassLoader(); } if (sm instanceof WildFlySecurityManager) { final Context ctx = CTX.get(); if (! ctx.checking) { return currentThread().getContextClassLoader(); } ctx.checking = false; try { checkPDPermission(getCallerClass(2), GET_CLASS_LOADER_PERMISSION); return currentThread().getContextClassLoader(); } finally { ctx.checking = true; } } else { checkPDPermission(getCallerClass(2), GET_CLASS_LOADER_PERMISSION); return doPrivileged(GetContextClassLoaderAction.getInstance()); } }
/** * Get the current thread's context class loader, doing a faster permission check that skips having to execute a * privileged action frame. * * @return the context class loader */ public static ClassLoader getCurrentContextClassLoaderPrivileged() { final SecurityManager sm = System.getSecurityManager(); if (sm == null) { return currentThread().getContextClassLoader(); } if (sm instanceof WildFlySecurityManager) { final Context ctx = CTX.get(); if (! ctx.checking) { return currentThread().getContextClassLoader(); } ctx.checking = false; try { checkPDPermission(getCallerClass(2), GET_CLASS_LOADER_PERMISSION); return currentThread().getContextClassLoader(); } finally { ctx.checking = true; } } else { checkPDPermission(getCallerClass(2), GET_CLASS_LOADER_PERMISSION); return doPrivileged(GetContextClassLoaderAction.getInstance()); } }
/** * Get the current thread's context class loader, doing a faster permission check that skips having to execute a * privileged action frame. * * @return the context class loader */ public static ClassLoader getCurrentContextClassLoaderPrivileged() { final SecurityManager sm = System.getSecurityManager(); if (sm == null) { return currentThread().getContextClassLoader(); } if (sm instanceof WildFlySecurityManager) { final Context ctx = CTX.get(); if (! ctx.checking) { return currentThread().getContextClassLoader(); } ctx.checking = false; try { checkPDPermission(getCallerClass(2), GET_CLASS_LOADER_PERMISSION); return currentThread().getContextClassLoader(); } finally { ctx.checking = true; } } else { checkPDPermission(getCallerClass(2), GET_CLASS_LOADER_PERMISSION); return doPrivileged(GetContextClassLoaderAction.getInstance()); } }