incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1490234 - in /sling/trunk/contrib/commons/fsclassloader: pom.xml src/main/java/org/apache/sling/commons/fsclassloader/impl/FSClassLoaderProvider.java
Date Thu, 06 Jun 2013 10:59:00 GMT
Author: cziegeler
Date: Thu Jun  6 10:58:59 2013
New Revision: 1490234

URL: http://svn.apache.org/r1490234
Log:
Add some debug log statements

Modified:
    sling/trunk/contrib/commons/fsclassloader/pom.xml
    sling/trunk/contrib/commons/fsclassloader/src/main/java/org/apache/sling/commons/fsclassloader/impl/FSClassLoaderProvider.java

Modified: sling/trunk/contrib/commons/fsclassloader/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/commons/fsclassloader/pom.xml?rev=1490234&r1=1490233&r2=1490234&view=diff
==============================================================================
--- sling/trunk/contrib/commons/fsclassloader/pom.xml (original)
+++ sling/trunk/contrib/commons/fsclassloader/pom.xml Thu Jun  6 10:58:59 2013
@@ -78,6 +78,14 @@
 
     <dependencies>
         <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.scr.annotations</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+        <dependency>
             <groupId>org.osgi</groupId>
             <artifactId>org.osgi.core</artifactId>
         </dependency>
@@ -91,9 +99,5 @@
             <version>1.3.0</version>
             <scope>provided</scope>
         </dependency>
-        <dependency>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>org.apache.felix.scr.annotations</artifactId>
-        </dependency>
     </dependencies>
 </project>

Modified: sling/trunk/contrib/commons/fsclassloader/src/main/java/org/apache/sling/commons/fsclassloader/impl/FSClassLoaderProvider.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/commons/fsclassloader/src/main/java/org/apache/sling/commons/fsclassloader/impl/FSClassLoaderProvider.java?rev=1490234&r1=1490233&r2=1490234&view=diff
==============================================================================
--- sling/trunk/contrib/commons/fsclassloader/src/main/java/org/apache/sling/commons/fsclassloader/impl/FSClassLoaderProvider.java
(original)
+++ sling/trunk/contrib/commons/fsclassloader/src/main/java/org/apache/sling/commons/fsclassloader/impl/FSClassLoaderProvider.java
Thu Jun  6 10:58:59 2013
@@ -40,6 +40,8 @@ import org.osgi.framework.Bundle;
 import org.osgi.framework.Constants;
 import org.osgi.framework.ServiceReference;
 import org.osgi.service.component.ComponentContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * The <code>FSClassLoaderProvider</code> is a dynamic class loader provider
@@ -61,6 +63,8 @@ public class FSClassLoaderProvider
     /** Current class loader */
     private FSDynamicClassLoader loader;
 
+    private final Logger logger = LoggerFactory.getLogger(this.getClass());
+
     @Reference(
             referenceInterface = DynamicClassLoaderManager.class,
             bind = "bindDynamicClassLoaderManager",
@@ -170,9 +174,12 @@ public class FSClassLoaderProvider
         final File file = new File(path);
         if ( file.exists() ) {
             final boolean result = file.delete();
+            logger.debug("Deleted {} : {}", name,result);
             if ( result ) {
                 this.checkClassLoader(file.getAbsolutePath());
             }
+
+            return result;
         }
         // file does not exist so we return false
         return false;
@@ -182,6 +189,7 @@ public class FSClassLoaderProvider
      * @see org.apache.sling.commons.classloader.ClassLoaderWriter#getOutputStream(java.lang.String)
      */
     public OutputStream getOutputStream(final String name) {
+        logger.debug("Get stream for {}", name);
         final String path = cleanPath(name);
         final File file = new File(path);
         final File parentDir = file.getParentFile();
@@ -202,6 +210,7 @@ public class FSClassLoaderProvider
      * @see org.apache.sling.commons.classloader.ClassLoaderWriter#rename(java.lang.String,
java.lang.String)
      */
     public boolean rename(final String oldName, final String newName) {
+        logger.debug("Rename {} to {}", oldName, newName);
         final String oldPath = cleanPath(oldName);
         final String newPath = cleanPath(newName);
         final File old = new File(oldPath);
@@ -238,6 +247,7 @@ public class FSClassLoaderProvider
      */
     public InputStream getInputStream(final String name)
     throws IOException {
+        logger.debug("Get input stream of {}", name);
         final String path = cleanPath(name);
         final File file = new File(path);
         return new FileInputStream(file);
@@ -247,6 +257,7 @@ public class FSClassLoaderProvider
      * @see org.apache.sling.commons.classloader.ClassLoaderWriter#getLastModified(java.lang.String)
      */
     public long getLastModified(final String name) {
+        logger.debug("Get last modified of {}", name);
         final String path = cleanPath(name);
         final File file = new File(path);
         if ( file.exists() ) {



Mime
View raw message