incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r794178 - in /sling/trunk/bundles/jcr/classloader: ./ src/main/java/org/apache/sling/jcr/classloader/ src/main/java/org/apache/sling/jcr/classloader/internal/
Date Wed, 15 Jul 2009 08:30:20 GMT
Author: cziegeler
Date: Wed Jul 15 08:30:19 2009
New Revision: 794178

URL: http://svn.apache.org/viewvc?rev=794178&view=rev
Log:
SLING-1048 : Implement the dynamic class loader provider interface and deprecate the repository
class loader interface.

Modified:
    sling/trunk/bundles/jcr/classloader/pom.xml
    sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/RepositoryClassLoaderProvider.java
    sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/BundleProxyClassLoader.java
    sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/RepositoryClassLoaderFacade.java
    sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/RepositoryClassLoaderProviderImpl.java

Modified: sling/trunk/bundles/jcr/classloader/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/classloader/pom.xml?rev=794178&r1=794177&r2=794178&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/classloader/pom.xml (original)
+++ sling/trunk/bundles/jcr/classloader/pom.xml Wed Jul 15 08:30:19 2009
@@ -94,6 +94,11 @@
             <version>2.0.2-incubator</version>
         </dependency>
         <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.commons.classloader</artifactId>
+            <version>0.9.0-SNAPSHOT</version>
+        </dependency>
+        <dependency>
             <groupId>org.apache.jackrabbit</groupId>
             <artifactId>jackrabbit-classloader</artifactId>
             <version>1.4.1</version>

Modified: sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/RepositoryClassLoaderProvider.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/RepositoryClassLoaderProvider.java?rev=794178&r1=794177&r2=794178&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/RepositoryClassLoaderProvider.java
(original)
+++ sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/RepositoryClassLoaderProvider.java
Wed Jul 15 08:30:19 2009
@@ -21,8 +21,12 @@
 import javax.jcr.RepositoryException;
 
 /**
- * The <code>RepositoryClassLoaderProvider</code> TODO
+ * The <code>RepositoryClassLoaderProvider</code>
+ *
+ * @deprecated Use the {@link org.apache.sling.commons.classloader.DynamicClassLoaderManager}
+ * instead.
  */
+@Deprecated
 public interface RepositoryClassLoaderProvider {
 
     ClassLoader getClassLoader(String owner) throws RepositoryException;

Modified: sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/BundleProxyClassLoader.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/BundleProxyClassLoader.java?rev=794178&r1=794177&r2=794178&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/BundleProxyClassLoader.java
(original)
+++ sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/BundleProxyClassLoader.java
Wed Jul 15 08:30:19 2009
@@ -49,7 +49,8 @@
     // at least Java 5 you can prevent the occurence of duplicate boot classloader
     // resources by overriding ClassLoader.getResources(...) instead of
     // ClassLoader.findResources(...).
-    public Enumeration findResources(String name) throws IOException {
+    @SuppressWarnings("unchecked")
+    public Enumeration<URL> findResources(String name) throws IOException {
         return this.bundle.getResources(name);
     }
 
@@ -57,7 +58,7 @@
         return this.bundle.getResource(name);
     }
 
-    public Class findClass(String name) throws ClassNotFoundException {
+    public Class<?> findClass(String name) throws ClassNotFoundException {
         return this.bundle.loadClass(name);
     }
 
@@ -65,11 +66,11 @@
         return (this.parent == null) ? this.findResource(name) : super.getResource(name);
     }
 
-    protected Class loadClass(String name, boolean resolve) throws ClassNotFoundException
{
-        Class clazz = (this.parent == null) ? this.findClass(name) : super.loadClass(name,
false);
-        if (resolve)
+    protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException
{
+        Class<?> clazz = (this.parent == null) ? this.findClass(name) : super.loadClass(name,
false);
+        if (resolve) {
             super.resolveClass(clazz);
-
+        }
         return clazz;
     }
 }

Modified: sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/RepositoryClassLoaderFacade.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/RepositoryClassLoaderFacade.java?rev=794178&r1=794177&r2=794178&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/RepositoryClassLoaderFacade.java
(original)
+++ sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/RepositoryClassLoaderFacade.java
Wed Jul 15 08:30:19 2009
@@ -100,7 +100,7 @@
         }
     }
 
-    protected synchronized Class loadClass(String name, boolean resolve) throws ClassNotFoundException
{
+    protected synchronized Class<?> loadClass(String name, boolean resolve) throws
ClassNotFoundException {
         try {
             return this.getDelegateClassLoader().loadClass(name);
         } catch (RepositoryException re) {
@@ -118,7 +118,7 @@
         }
     }
 
-    public Enumeration findResources(String name) throws IOException {
+    public Enumeration<URL> findResources(String name) throws IOException {
         try {
             return this.getDelegateClassLoader().getResources(name);
         } catch (RepositoryException re) {

Modified: sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/RepositoryClassLoaderProviderImpl.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/RepositoryClassLoaderProviderImpl.java?rev=794178&r1=794177&r2=794178&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/RepositoryClassLoaderProviderImpl.java
(original)
+++ sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/RepositoryClassLoaderProviderImpl.java
Wed Jul 15 08:30:19 2009
@@ -27,6 +27,7 @@
 
 import org.apache.commons.collections.BidiMap;
 import org.apache.commons.collections.bidimap.DualHashBidiMap;
+import org.apache.sling.commons.classloader.DynamicClassLoaderProvider;
 import org.apache.sling.jcr.api.SlingRepository;
 import org.apache.sling.jcr.classloader.RepositoryClassLoaderProvider;
 import org.osgi.framework.Bundle;
@@ -43,7 +44,7 @@
  * @scr.service servicefactory="true"
  */
 public class RepositoryClassLoaderProviderImpl
-        implements RepositoryClassLoaderProvider {
+        implements RepositoryClassLoaderProvider, DynamicClassLoaderProvider {
 
     /**
      * @scr.property values0="/var/classes"
@@ -115,6 +116,13 @@
         }
     }
 
+    /**
+     * @see org.apache.sling.commons.classloader.DynamicClassLoaderProvider#getClassLoader()
+     */
+    public ClassLoader getClassLoader() {
+        return this.getClassLoader(null);
+    }
+
     //---------- SCR Integration ----------------------------------------------
 
     protected void activate(ComponentContext componentContext) {



Mime
View raw message