jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r494578 - in /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core: CachingNamespaceResolver.java NamespaceRegistryImpl.java
Date Tue, 09 Jan 2007 21:08:21 GMT
Author: jukka
Date: Tue Jan  9 13:08:20 2007
New Revision: 494578

URL: http://svn.apache.org/viewvc?view=rev&rev=494578
Log:
JCR-688: Replaced CachingNamespaceResolver with CachingNameResolver

Removed:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/CachingNamespaceResolver.java
Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NamespaceRegistryImpl.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NamespaceRegistryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NamespaceRegistryImpl.java?view=diff&rev=494578&r1=494577&r2=494578
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NamespaceRegistryImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NamespaceRegistryImpl.java
Tue Jan  9 13:08:20 2007
@@ -21,7 +21,11 @@
 import org.apache.jackrabbit.core.fs.FileSystem;
 import org.apache.jackrabbit.core.fs.FileSystemResource;
 import org.apache.jackrabbit.name.AbstractNamespaceResolver;
+import org.apache.jackrabbit.name.CachingNameResolver;
 import org.apache.jackrabbit.name.NameCache;
+import org.apache.jackrabbit.name.NameException;
+import org.apache.jackrabbit.name.NameResolver;
+import org.apache.jackrabbit.name.ParsingNameResolver;
 import org.apache.jackrabbit.name.QName;
 import org.apache.jackrabbit.util.XMLChar;
 import org.slf4j.Logger;
@@ -83,7 +87,7 @@
 
     private int lastIndex = 0;
 
-    private final CachingNamespaceResolver resolver;
+    private NameResolver resolver;
 
     private final FileSystem nsRegStore;
 
@@ -102,7 +106,7 @@
             throws RepositoryException {
         super(true); // enable listener support
         this.nsRegStore = nsRegStore;
-        resolver = new CachingNamespaceResolver(this, 1000);
+        resolver = new ParsingNameResolver(this);
         load();
     }
 
@@ -383,7 +387,7 @@
         }
         return uri;
     }
-    
+
     //----------------------------------------------------< NamespaceRegistry >
     /**
      * {@inheritDoc}
@@ -524,23 +528,27 @@
      * {@inheritDoc}
      */
     public QName retrieveName(String jcrName) {
-        // just delegate to internal cache
-        return resolver.retrieveName(jcrName);
+        try {
+            return resolver.getQName(jcrName);
+        } catch (NameException e) {
+            return null;
+        } catch (NamespaceException e) {
+            return null;
+        }
     }
 
     public String retrieveName(QName name) {
-        // just delegate to internal cache
-        return resolver.retrieveName(name);
+        try {
+            return resolver.getJCRName(name);
+        } catch (NamespaceException e) {
+            return null;
+        }
     }
 
     public void cacheName(String jcrName, QName name) {
-        // just delegate to internal cache
-        resolver.cacheName(jcrName, name);
     }
 
     public void evictAllNames() {
-        // just delegate to internal cache
-        resolver.evictAllNames();
     }
 
     //-----------------------------------------------< NamespaceEventListener >



Mime
View raw message