incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r633089 - in /incubator/sling/trunk/jcr: api/src/main/java/org/apache/sling/jcr/api/ jackrabbit-client/src/main/java/org/apache/sling/jcr/jackrabbit/client/ jackrabbit-server/src/main/java/org/apache/sling/jcr/jackrabbit/server/
Date Mon, 03 Mar 2008 14:15:12 GMT
Author: bdelacretaz
Date: Mon Mar  3 06:15:04 2008
New Revision: 633089

URL: http://svn.apache.org/viewvc?rev=633089&view=rev
Log:
SLING-294 - temporary fix to load nodetypes once a Repository is actually available - SLING-132
will improve this

Modified:
    incubator/sling/trunk/jcr/api/src/main/java/org/apache/sling/jcr/api/AbstractSlingRepository.java
    incubator/sling/trunk/jcr/jackrabbit-client/src/main/java/org/apache/sling/jcr/jackrabbit/client/SlingClientRepository.java
    incubator/sling/trunk/jcr/jackrabbit-server/src/main/java/org/apache/sling/jcr/jackrabbit/server/SlingServerRepository.java

Modified: incubator/sling/trunk/jcr/api/src/main/java/org/apache/sling/jcr/api/AbstractSlingRepository.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/jcr/api/src/main/java/org/apache/sling/jcr/api/AbstractSlingRepository.java?rev=633089&r1=633088&r2=633089&view=diff
==============================================================================
--- incubator/sling/trunk/jcr/api/src/main/java/org/apache/sling/jcr/api/AbstractSlingRepository.java
(original)
+++ incubator/sling/trunk/jcr/api/src/main/java/org/apache/sling/jcr/api/AbstractSlingRepository.java
Mon Mar  3 06:15:04 2008
@@ -334,16 +334,6 @@
         this.loader = new Loader(this);
 
         componentContext.getBundleContext().addBundleListener(this);
-
-        // TODO: Consider running this in the background !!
-        Bundle[] bundles = componentContext.getBundleContext().getBundles();
-        for (int i = 0; i < bundles.length; i++) {
-            if ((bundles[i].getState() & (Bundle.INSTALLED | Bundle.UNINSTALLED)) ==
0) {
-                // load content for bundles which are neither INSTALLED nor
-                // UNINSTALLED
-                this.loader.registerBundle(bundles[i]);
-            }
-        }
     }
 
     /**
@@ -365,6 +355,20 @@
         }
 
         this.componentContext = null;
+    }
+    
+    /** TODO: temp fix for SLING-294: must be called by child classes to perform tasks
+     *  that must happen only once a Repository becomes available
+     */
+    protected void repositoryAvailable() {
+        Bundle[] bundles = componentContext.getBundleContext().getBundles();
+        for (int i = 0; i < bundles.length; i++) {
+            if ((bundles[i].getState() & (Bundle.INSTALLED | Bundle.UNINSTALLED)) ==
0) {
+                // load content for bundles which are neither INSTALLED nor
+                // UNINSTALLED
+                this.loader.registerBundle(bundles[i]);
+            }
+        }
     }
 
     /**

Modified: incubator/sling/trunk/jcr/jackrabbit-client/src/main/java/org/apache/sling/jcr/jackrabbit/client/SlingClientRepository.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/jcr/jackrabbit-client/src/main/java/org/apache/sling/jcr/jackrabbit/client/SlingClientRepository.java?rev=633089&r1=633088&r2=633089&view=diff
==============================================================================
--- incubator/sling/trunk/jcr/jackrabbit-client/src/main/java/org/apache/sling/jcr/jackrabbit/client/SlingClientRepository.java
(original)
+++ incubator/sling/trunk/jcr/jackrabbit-client/src/main/java/org/apache/sling/jcr/jackrabbit/client/SlingClientRepository.java
Mon Mar  3 06:15:04 2008
@@ -75,6 +75,9 @@
     protected Repository getDelegatee() throws RepositoryException {
         if (this.delegatee == null) {
             this.delegatee = this.getRepository();
+            if(this.delegatee != null) {
+                repositoryAvailable();
+            }
         }
 
         return this.delegatee;

Modified: incubator/sling/trunk/jcr/jackrabbit-server/src/main/java/org/apache/sling/jcr/jackrabbit/server/SlingServerRepository.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/jcr/jackrabbit-server/src/main/java/org/apache/sling/jcr/jackrabbit/server/SlingServerRepository.java?rev=633089&r1=633088&r2=633089&view=diff
==============================================================================
--- incubator/sling/trunk/jcr/jackrabbit-server/src/main/java/org/apache/sling/jcr/jackrabbit/server/SlingServerRepository.java
(original)
+++ incubator/sling/trunk/jcr/jackrabbit-server/src/main/java/org/apache/sling/jcr/jackrabbit/server/SlingServerRepository.java
Mon Mar  3 06:15:04 2008
@@ -110,6 +110,9 @@
         if (this.delegatee == null) {
             try {
                 this.delegatee = this.getRepository();
+                if(this.delegatee != null) {
+                    repositoryAvailable();
+                }
             } catch (IOException ioe) {
                 throw new RepositoryException(ioe.getMessage(), ioe);
             }



Mime
View raw message