mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8292177: InitialSecurityProperty JFR event
Reviewed-by: mullan
This commit is contained in:
parent
e7a964b4db
commit
8c40b7dc8c
12 changed files with 393 additions and 145 deletions
|
@ -30,6 +30,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||
import java.io.*;
|
||||
import java.net.URL;
|
||||
|
||||
import jdk.internal.access.JavaSecurityPropertiesAccess;
|
||||
import jdk.internal.event.EventHelper;
|
||||
import jdk.internal.event.SecurityPropertyModificationEvent;
|
||||
import jdk.internal.access.SharedSecrets;
|
||||
|
@ -63,6 +64,9 @@ public final class Security {
|
|||
/* The java.security properties */
|
||||
private static Properties props;
|
||||
|
||||
/* cache a copy for recording purposes */
|
||||
private static Properties initialSecurityProperties;
|
||||
|
||||
// An element in the cache
|
||||
private static class ProviderProperty {
|
||||
String className;
|
||||
|
@ -79,6 +83,13 @@ public final class Security {
|
|||
initialize();
|
||||
return null;
|
||||
});
|
||||
// Set up JavaSecurityPropertiesAccess in SharedSecrets
|
||||
SharedSecrets.setJavaSecurityPropertiesAccess(new JavaSecurityPropertiesAccess() {
|
||||
@Override
|
||||
public Properties getInitialProperties() {
|
||||
return initialSecurityProperties;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private static void initialize() {
|
||||
|
@ -104,6 +115,14 @@ public final class Security {
|
|||
}
|
||||
loadProps(null, extraPropFile, overrideAll);
|
||||
}
|
||||
initialSecurityProperties = (Properties) props.clone();
|
||||
if (sdebug != null) {
|
||||
for (String key : props.stringPropertyNames()) {
|
||||
sdebug.println("Initial security property: " + key + "=" +
|
||||
props.getProperty(key));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static boolean loadProps(File masterFile, String extraPropFile, boolean overrideAll) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue