< prev index next >
src/java.base/share/classes/jdk/internal/module/ServicesCatalog.java
Print this page
@@ -169,8 +169,18 @@
if (previous != null) catalog = previous;
}
return catalog;
}
+ /**
+ * Associates the given ServicesCatalog with the given class loader.
+ */
+ public static void putServicesCatalog(ClassLoader loader, ServicesCatalog catalog) {
+ ServicesCatalog previous = CLV.putIfAbsent(loader, catalog);
+ if (previous != null) {
+ throw new InternalError();
+ }
+ }
+
// the ServicesCatalog registered to a class loader
private static final ClassLoaderValue<ServicesCatalog> CLV = new ClassLoaderValue<>();
}
< prev index next >