/** * Get a property, doing a faster permission check that skips having to execute a privileged action frame. * * @param name the property name * @param def the default value if the property is not found * @return the property value, or the default value */ public static String getPropertyPrivileged(String name, String def) { final SecurityManager sm = getSecurityManager(); if (sm == null) { return getProperty(name, def); } if (sm instanceof WildFlySecurityManager) { final Context ctx = CTX.get(); if (! ctx.checking) { return getProperty(name, def); } ctx.checking = false; try { checkPropertyReadPermission(getCallerClass(2), name); return getProperty(name, def); } finally { ctx.checking = true; } } else { checkPropertyReadPermission(getCallerClass(2), name); return doPrivileged(new ReadPropertyAction(name, def)); } }
/** * Get a property, doing a faster permission check that skips having to execute a privileged action frame. * * @param name the property name * @param def the default value if the property is not found * @return the property value, or the default value */ public static String getPropertyPrivileged(String name, String def) { final SecurityManager sm = getSecurityManager(); if (sm == null) { return getProperty(name, def); } if (sm instanceof WildFlySecurityManager) { final Context ctx = CTX.get(); if (! ctx.checking) { return getProperty(name, def); } ctx.checking = false; try { checkPropertyReadPermission(getCallerClass(2), name); return getProperty(name, def); } finally { ctx.checking = true; } } else { checkPropertyReadPermission(getCallerClass(2), name); return doPrivileged(new ReadPropertyAction(name, def)); } }
/** * Get a property, doing a faster permission check that skips having to execute a privileged action frame. * * @param name the property name * @param def the default value if the property is not found * @return the property value, or the default value */ public static String getPropertyPrivileged(String name, String def) { final SecurityManager sm = getSecurityManager(); if (sm == null) { return getProperty(name, def); } if (sm instanceof WildFlySecurityManager) { final Context ctx = CTX.get(); if (! ctx.checking) { return getProperty(name, def); } ctx.checking = false; try { checkPropertyReadPermission(getCallerClass(2), name); return getProperty(name, def); } finally { ctx.checking = true; } } else { checkPropertyReadPermission(getCallerClass(2), name); return doPrivileged(new ReadPropertyAction(name, def)); } }
/** * Get a property, doing a faster permission check that skips having to execute a privileged action frame. * * @param name the property name * @param def the default value if the property is not found * @return the property value, or the default value */ public static String getPropertyPrivileged(String name, String def) { final SecurityManager sm = getSecurityManager(); if (sm == null) { return getProperty(name, def); } if (sm instanceof WildFlySecurityManager) { final Context ctx = CTX.get(); if (! ctx.checking) { return getProperty(name, def); } ctx.checking = false; try { checkPropertyReadPermission(getCallerClass(2), name); return getProperty(name, def); } finally { ctx.checking = true; } } else { checkPropertyReadPermission(getCallerClass(2), name); return doPrivileged(new ReadPropertyAction(name, def)); } }
/** * Get a property, doing a faster permission check that skips having to execute a privileged action frame. * * @param name the property name * @param def the default value if the property is not found * @return the property value, or the default value */ public static String getPropertyPrivileged(String name, String def) { final SecurityManager sm = getSecurityManager(); if (sm == null) { return getProperty(name, def); } if (sm instanceof WildFlySecurityManager) { final Context ctx = CTX.get(); if (! ctx.checking) { return getProperty(name, def); } ctx.checking = false; try { checkPropertyReadPermission(getCallerClass(2), name); return getProperty(name, def); } finally { ctx.checking = true; } } else { checkPropertyReadPermission(getCallerClass(2), name); return doPrivileged(new ReadPropertyAction(name, def)); } }