[java-opensaml COMMIT] /trunk/opensaml-saml-api/src/main/java/org/opensaml/saml/metadata/resolver/index/MetadataIndex...

noreply at shibboleth.net noreply at shibboleth.net
Fri Oct 2 22:35:12 EDT 2015


Author: putmanb
Date: Fri Oct  2 22:35:12 2015
New Revision: 4343

URL: http://svn.shibboleth.net/view/java-opensaml?rev=4343&view=rev
Log:
OSJ-128: Add support for secondary indexes to metadata resolvers

Switch internal map to use ConcurrentHashMap.
Remove @NotThreadSafe annotation, it's not exactly accurate.
Unfortunately @ThreadSafe/@NotThreadSafe can't be applied at the method level,
that would be more accurate. Here it's really only the mutate operations that aren't
thread-safe.  The retrieval-only ops are ok.

Modified:
    trunk/opensaml-saml-api/src/main/java/org/opensaml/saml/metadata/resolver/index/MetadataIndexStore.java

Modified: trunk/opensaml-saml-api/src/main/java/org/opensaml/saml/metadata/resolver/index/MetadataIndexStore.java
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-saml-api/src/main/java/org/opensaml/saml/metadata/resolver/index/MetadataIndexStore.java?rev=4343&r1=4342&r2=4343&view=diff
==============================================================================
--- trunk/opensaml-saml-api/src/main/java/org/opensaml/saml/metadata/resolver/index/MetadataIndexStore.java	(original)
+++ trunk/opensaml-saml-api/src/main/java/org/opensaml/saml/metadata/resolver/index/MetadataIndexStore.java	Fri Oct  2 22:35:12 2015
@@ -21,14 +21,13 @@
 import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
 
 import javax.annotation.Nonnull;
-import javax.annotation.concurrent.NotThreadSafe;
 
 import net.shibboleth.utilities.java.support.annotation.constraint.NonnullElements;
 import net.shibboleth.utilities.java.support.annotation.constraint.NotLive;
 import net.shibboleth.utilities.java.support.annotation.constraint.Unmodifiable;
-import net.shibboleth.utilities.java.support.collection.LazyMap;
 import net.shibboleth.utilities.java.support.logic.Constraint;
 
 import org.opensaml.saml.saml2.metadata.EntityDescriptor;
@@ -39,7 +38,6 @@
  * Component which stores indexed instances of {@link EntityDescriptor} under one or more instances
  * of {@link MetadataIndexKey}.
  */
- at NotThreadSafe
 public class MetadataIndexStore {
     
     /** The indexed storage of entity descriptors. */
@@ -49,7 +47,7 @@
      * Constructor.
      */
     public MetadataIndexStore() {
-        index = new LazyMap<>();
+        index = new ConcurrentHashMap<>();
     }
     
     /**



More information about the commits mailing list