This is an automated email from the ASF dual-hosted git repository.

andy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/jena.git

commit a05fd8b0d51c86746a7f096a4bdb5922f3d82f5f
Author: Andy Seaborne <a...@apache.org>
AuthorDate: Fri Jun 13 08:38:24 2025 +0100

    Javadoc for Registry
---
 .../src/main/java/org/apache/jena/atlas/lib/Registry.java   | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/jena-base/src/main/java/org/apache/jena/atlas/lib/Registry.java 
b/jena-base/src/main/java/org/apache/jena/atlas/lib/Registry.java
index f5bd2ab8e8..6d45104368 100644
--- a/jena-base/src/main/java/org/apache/jena/atlas/lib/Registry.java
+++ b/jena-base/src/main/java/org/apache/jena/atlas/lib/Registry.java
@@ -23,8 +23,17 @@ import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.function.BiConsumer;
 
-public class Registry<K,T>
-{
+/**
+ * A registry is mapping from a key to an item, typically as the long term 
state and configuration of the system.
+ * They are "read-mostly" - it is expect that most operations are read 
operations.
+ *
+ * Individual operations on a Registry are thread-safe (the code won't crash) 
but
+ * iteration ({@code forEach}) is not a snapshot of the registry so it can be
+ * inconsistent (e.g. yield two entries that never existed in the registry at 
the
+ * same time).
+ */
+
+public class Registry<K,T> {
     protected Map<K, T> registry = new ConcurrentHashMap<>();
 
     public Registry() {}

Reply via email to