/** * 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 System property by its name. * * @param name the name of the wanted System property. * @return the System property value - null if it is not defined. */ private String getProperty(String name) { return System.getSecurityManager() == null ? System.getProperty(name) : doPrivileged(new ReadPropertyAction(name)); }
/** * Get a System property by its name. * * @param name the name of the wanted System property. * @return the System property value - null if it is not defined. */ private String getProperty(String name) { return System.getSecurityManager() == null ? System.getProperty(name) : doPrivileged(new ReadPropertyAction(name)); }
static String getSystemProperty(final String key, final String defaultValue) { return getSecurityManager() == null ? getProperty(key, defaultValue) : doPrivileged(new ReadPropertyAction(key, defaultValue)); }
static String getSystemProperty(final String key, final String defVal) { return getSecurityManager() == null ? getProperty(key, defVal) : doPrivileged(new ReadPropertyAction(key, defVal)); }
static String getSystemProperty(final String key, final String defaultValue) { return getSecurityManager() == null ? getProperty(key, defaultValue) : doPrivileged(new ReadPropertyAction(key, defaultValue)); }
static String getSystemProperty(final String key, final String defaultValue) { return getSecurityManager() == null ? getProperty(key, defaultValue) : doPrivileged(new ReadPropertyAction(key, defaultValue)); }
static String getSystemProperty(final String key, final String defVal) { return getSecurityManager() == null ? getProperty(key, defVal) : doPrivileged(new ReadPropertyAction(key, defVal)); }
static String getSystemProperty(final String key, final String defaultValue) { return getSecurityManager() == null ? getProperty(key, defaultValue) : doPrivileged(new ReadPropertyAction(key, defaultValue)); }
static String getSystemProperty(final String key, final String defaultValue) { return getSecurityManager() == null ? getProperty(key, defaultValue) : doPrivileged(new ReadPropertyAction(key, defaultValue)); }
static String getSystemProperty(final String key) { return getSecurityManager() == null ? getProperty(key) : doPrivileged(new ReadPropertyAction(key)); }
static String getSystemProperty(final String key, final String defaultValue) { return getSecurityManager() == null ? getProperty(key, defaultValue) : doPrivileged(new ReadPropertyAction(key, defaultValue)); }
static String getSystemProperty(final String key, final String defaultValue) { return getSecurityManager() == null ? getProperty(key, defaultValue) : doPrivileged(new ReadPropertyAction(key, defaultValue)); }
static String getSystemProperty(final String key, final String defaultValue) { return getSecurityManager() == null ? getProperty(key, defaultValue) : doPrivileged(new ReadPropertyAction(key, defaultValue)); }
static String getSystemProperty(final String key, final String defaultValue) { return getSecurityManager() == null ? getProperty(key, defaultValue) : doPrivileged(new ReadPropertyAction(key, defaultValue)); }
static String getSystemProperty(final String key) { return getSecurityManager() == null ? getProperty(key) : doPrivileged(new ReadPropertyAction(key)); }
static String getSystemProperty(final String key) { return getSecurityManager() == null ? getProperty(key) : doPrivileged(new ReadPropertyAction(key)); }
static String getSystemProperty(final String key) { return getSecurityManager() == null ? getProperty(key) : doPrivileged(new ReadPropertyAction(key)); }
private static String getProperty(final String name) { return doPrivileged(new ReadPropertyAction(name, null)); }
private File getJBossHome() { if (distribution != null) { return distribution; } String resolved = getSecurityManager() == null ? getenv(HOME) : doPrivileged(new ReadEnvironmentPropertyAction(HOME)); if (resolved == null) { resolved = getSecurityManager() == null ? getProperty(HOME_DIR) : doPrivileged(new ReadPropertyAction(HOME_DIR)); } if (resolved == null) { throw PatchLogger.ROOT_LOGGER.cliFailedToResolveDistribution(); } return new File(resolved); }