Author: chetanm
Date: Thu Sep 12 11:39:22 2013
New Revision: 1522536

URL: http://svn.apache.org/r1522536
Log:
OAK-1014 - Allow customization of repository descriptors

Adding method determineDescriptors for creating descriptors. Sub classes can 
override it to customize that

Modified:
    
jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/repository/RepositoryImpl.java

Modified: 
jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/repository/RepositoryImpl.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/repository/RepositoryImpl.java?rev=1522536&r1=1522535&r2=1522536&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/repository/RepositoryImpl.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/repository/RepositoryImpl.java
 Thu Sep 12 11:39:22 2013
@@ -67,7 +67,7 @@ public class RepositoryImpl implements J
      */
     public static final String REFRESH_INTERVAL = "oak.refresh-interval";
 
-    private final Descriptors descriptors = new Descriptors(new 
SimpleValueFactory());
+    private final Descriptors descriptors;
     private final ContentRepository contentRepository;
     protected final Whiteboard whiteboard;
     private final SecurityProvider securityProvider;
@@ -80,6 +80,7 @@ public class RepositoryImpl implements J
         this.whiteboard = checkNotNull(whiteboard);
         this.securityProvider = checkNotNull(securityProvider);
         this.threadSaveCount = new ThreadLocal<Long>();
+        this.descriptors = determineDescriptors();
     }
 
     //---------------------------------------------------------< Repository 
>---
@@ -234,6 +235,15 @@ public class RepositoryImpl implements J
         return new SessionContext(this, securityProvider, whiteboard, 
attributes, delegate);
     }
 
+    /**
+     * Provides descriptors for current repository implementations. Can be 
overridden
+     * by the subclasses to add more values to the descriptor
+     * @return  repository descriptor
+     */
+    protected Descriptors determineDescriptors() {
+        return new Descriptors(new SimpleValueFactory());
+    }
+
     //------------------------------------------------------------< private 
>---
 
     private static Long getRefreshInterval(Credentials credentials) {


Reply via email to