You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by lu...@apache.org on 2004/11/08 10:35:19 UTC

cvs commit: jakarta-slide/src/share/org/apache/slide/store BindingStore.java

luetzkendorf    2004/11/08 01:35:19

  Modified:    src/share/org/apache/slide/store BindingStore.java
  Log:
  caching of resolved uris completed
  
  Revision  Changes    Path
  1.5       +10 -10    jakarta-slide/src/share/org/apache/slide/store/BindingStore.java
  
  Index: BindingStore.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/store/BindingStore.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- BindingStore.java	22 Sep 2004 15:20:22 -0000	1.4
  +++ BindingStore.java	8 Nov 2004 09:35:19 -0000	1.5
  @@ -642,6 +642,7 @@
        * Worker method that actually resolves the uri.
        */
       private ObjectNode doResolve(Uri uri) throws ObjectNotFoundException, ServiceAccessException {
  +        
           // check resolve cache first
           ResourceId resourceId = checkResolveCache(uri);
           
  @@ -655,16 +656,16 @@
               String currentUriStr = rootUriStr;
               Uri currentUri = new Uri(uri.getToken(), uri.getNamespace(), currentUriStr);
               ResourceId currentResourceId = ResourceId.create(currentUri, currentUriStr);
  -            int start = new UriPath(rootUriStr).tokens().length;
               
  -            for (int i = start; i < segments.length; i++) {
  -                // cacheResolve(currentUri, currentResourceId);
  -                // TODO: make it work with caching here :-(
  +            for (int i = UriPath.segmentCount(rootUriStr); i < segments.length; i++) {
  +                // cache the resolved (parent) mapping
  +                cacheResolve(currentUri, currentResourceId);
                   
                   ObjectNode objectNode = currentResourceId.getStore().retrieveObject(currentResourceId);
                   objectNode.setUri(currentUriStr);
  -                currentUriStr = uriPath.subUriPath(0, i + 1).toString();
  +                currentUriStr = uriPath.subUriPathString(0, i + 1);
                   currentUri = new Uri(uri.getToken(), uri.getNamespace(), currentUriStr);
  +                
                   String currentUuri = objectNode.getBindingUuri(segments[i]);
                   if (currentUuri == null) {
                       throw new ObjectNotFoundException(currentUriStr);
  @@ -675,7 +676,6 @@
               
               // cache resolve result
               cacheResolve(uri, resourceId);
  -            // TODO: make it work with caching here :-(
           }
           return resourceId.getStore().retrieveObject(resourceId);
       }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org