jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r487144 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/LocalNamespaceMappings.java
Date Thu, 14 Dec 2006 09:06:30 GMT
Author: mreutegg
Date: Thu Dec 14 01:06:29 2006
New Revision: 487144

URL: http://svn.apache.org/viewvc?view=rev&rev=487144
Log:
JCR-670: LocalNamespaceMappings does not make use of NameCache in NamespaceRegistryImpl

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/LocalNamespaceMappings.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/LocalNamespaceMappings.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/LocalNamespaceMappings.java?view=diff&rev=487144&r1=487143&r2=487144
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/LocalNamespaceMappings.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/LocalNamespaceMappings.java
Thu Dec 14 01:06:29 2006
@@ -20,6 +20,7 @@
 import org.apache.jackrabbit.name.NamespaceListener;
 import org.apache.jackrabbit.name.NamespaceResolver;
 import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.name.NameCache;
 import org.apache.jackrabbit.util.XMLChar;
 
 import javax.jcr.NamespaceException;
@@ -43,7 +44,7 @@
  * underlying namespace registry.
  */
 class LocalNamespaceMappings extends AbstractNamespaceResolver
-        implements NamespaceListener {
+        implements NamespaceListener, NameCache {
 
     /** The underlying global and persistent namespace registry. */
     private final NamespaceRegistryImpl nsReg;
@@ -154,6 +155,46 @@
      */
     void dispose() {
         nsReg.removeListener(this);
+    }
+
+    //-------------------------------------------------------------< NameCache >
+
+    /**
+     * {@inheritDoc}
+     */
+    public QName retrieveName(String jcrName) {
+        if (prefixToURI.size() == 0) {
+            return nsReg.retrieveName(jcrName);
+        }
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String retrieveName(QName name) {
+        if (prefixToURI.size() == 0
+                || !uriToPrefix.containsKey(name.getNamespaceURI())) {
+            return nsReg.retrieveName(name);
+        }
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void cacheName(String jcrName, QName name) {
+        if (prefixToURI.size() == 0
+                || !uriToPrefix.containsKey(name.getNamespaceURI())) {
+            nsReg.cacheName(jcrName, name);
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void evictAllNames() {
+        nsReg.evictAllNames();
     }
 
     //-----------------------------------------------------< NamespaceResolver >



Mime
View raw message