mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8254711: Add java.security.Provider.getService JFR Event
Reviewed-by: mullan, valeriep, jpai
This commit is contained in:
parent
d781ab09f7
commit
bc2af47e1e
9 changed files with 279 additions and 9 deletions
|
@ -25,6 +25,8 @@
|
|||
|
||||
package java.security;
|
||||
|
||||
import jdk.internal.event.SecurityProviderServiceEvent;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
import static java.util.Locale.ENGLISH;
|
||||
|
@ -1281,18 +1283,22 @@ public abstract class Provider extends Properties {
|
|||
}
|
||||
|
||||
Service s = serviceMap.get(key);
|
||||
if (s != null) {
|
||||
return s;
|
||||
if (s == null) {
|
||||
s = legacyMap.get(key);
|
||||
if (s != null && !s.isValid()) {
|
||||
legacyMap.remove(key, s);
|
||||
}
|
||||
}
|
||||
|
||||
s = legacyMap.get(key);
|
||||
if (s != null && !s.isValid()) {
|
||||
legacyMap.remove(key, s);
|
||||
} else {
|
||||
return s;
|
||||
if (s != null && SecurityProviderServiceEvent.isTurnedOn()) {
|
||||
var e = new SecurityProviderServiceEvent();
|
||||
e.provider = getName();
|
||||
e.type = type;
|
||||
e.algorithm = algorithm;
|
||||
e.commit();
|
||||
}
|
||||
|
||||
return null;
|
||||
return s;
|
||||
}
|
||||
|
||||
// ServiceKey from previous getService() call
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue