openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p..@apache.org
Subject svn commit: r496914 - in /incubator/openjpa/trunk/openjpa-kernel/src/main: java/org/apache/openjpa/meta/AbstractCFMetaDataFactory.java resources/org/apache/openjpa/meta/localizer.properties
Date Wed, 17 Jan 2007 02:00:57 GMT
Author: pcl
Date: Tue Jan 16 18:00:56 2007
New Revision: 496914

URL: http://svn.apache.org/viewvc?view=rev&rev=496914
Log:
improved trace messages

Modified:
    incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/AbstractCFMetaDataFactory.java
    incubator/openjpa/trunk/openjpa-kernel/src/main/resources/org/apache/openjpa/meta/localizer.properties

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/AbstractCFMetaDataFactory.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/AbstractCFMetaDataFactory.java?view=diff&rev=496914&r1=496913&r2=496914
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/AbstractCFMetaDataFactory.java
(original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/AbstractCFMetaDataFactory.java
Tue Jan 16 18:00:56 2007
@@ -578,7 +578,7 @@
             Set names = parsePersistentTypeNames(loader);
             if (names.isEmpty() && devpath)
                 scan(new ClasspathMetaDataIterator(null, newMetaDataFilter()),
-                    newClassArgParser(), names, false);
+                    newClassArgParser(), names, false, null);
             else // we don't cache a full dev cp scan
                 _typeNames = names;
 
@@ -607,17 +607,19 @@
                     if (log.isTraceEnabled())
                         log.trace(_loc.get("scanning-directory", file));
                     scan(new FileMetaDataIterator(dir, newMetaDataFilter()),
-                        cparser, names, true);
+                        cparser, names, true, file);
                 } else if (file.getName().endsWith(".jar")) {
                     if (log.isTraceEnabled())
                         log.trace(_loc.get("scanning-jar", file));
                     scan(new ZipFileMetaDataIterator(new ZipFile(file),
-                        newMetaDataFilter()), cparser, names, true);
+                        newMetaDataFilter()), cparser, names, true, file);
                 } else {
                     if (log.isTraceEnabled())
                         log.trace(_loc.get("scanning-file", file));
                     clss = cparser.parseTypeNames(new FileMetaDataIterator
                         (file));
+                    if (log.isTraceEnabled())
+                        log.trace(_loc.get("scan-found-names", clss, file));
                     names.addAll(Arrays.asList(clss));
                     mapPersistentTypeNames(file.getAbsoluteFile().toURL(),
                         clss);
@@ -633,17 +635,19 @@
                     if (log.isTraceEnabled())
                         log.trace(_loc.get("scanning-jar-url", url));
                     scan(new ZipFileMetaDataIterator(url,
-                        newMetaDataFilter()), cparser, names, true);
+                        newMetaDataFilter()), cparser, names, true, url);
                 } else if (url.getPath().endsWith(".jar")) {
                     if (log.isTraceEnabled())
                         log.trace(_loc.get("scanning-jar-at-url", url));
                     scan(new ZipStreamMetaDataIterator(
                         new ZipInputStream(url.openStream()),
-                        newMetaDataFilter()), cparser, names, true);
+                        newMetaDataFilter()), cparser, names, true, url);
                 } else {
                     if (log.isTraceEnabled())
                         log.trace(_loc.get("scanning-url", url));
                     clss = cparser.parseTypeNames(new URLMetaDataIterator(url));
+                    if (log.isTraceEnabled())
+                        log.trace(_loc.get("scan-found-names", clss, url));
                     names.addAll(Arrays.asList(clss));
                     mapPersistentTypeNames(url, clss);
                 }
@@ -661,7 +665,8 @@
                             log.trace(_loc.get("scanning-jar-stream-url", url));
                         scan(new ZipStreamMetaDataIterator
                             (new ZipInputStream(url.openStream()),
-                                newMetaDataFilter()), cparser, names, true);
+                                newMetaDataFilter()), cparser, names, true, 
+                                url);
                     }
                 } else {
                     if (log.isTraceEnabled())
@@ -671,6 +676,8 @@
                         url = (URL) mitr.next();
                         clss = cparser.parseTypeNames(new URLMetaDataIterator
                             (url));
+                        if (log.isTraceEnabled())
+                            log.trace(_loc.get("scan-found-names", clss, rsrc));
                         names.addAll(Arrays.asList(clss));
                         mapPersistentTypeNames(url, clss);
                     }
@@ -681,10 +688,14 @@
         if (cpath != null) {
             String[] dirs = (String[]) cpath.toArray(new String[cpath.size()]);
             scan(new ClasspathMetaDataIterator(dirs, newMetaDataFilter()),
-                cparser, names, true);
+                cparser, names, true, dirs);
         }
         if (types != null)
             names.addAll(types);
+        
+        if (log.isTraceEnabled())
+            log.trace(_loc.get("parse-found-names", names));
+        
         return names;
     }
 
@@ -692,7 +703,7 @@
      * Scan for persistent type names using the given metadata iterator.
      */
     private void scan(MetaDataIterator mitr, ClassArgParser cparser, Set names,
-        boolean mapNames)
+        boolean mapNames, Object debugContext)
         throws IOException {
         Map map;
         try {
@@ -707,7 +718,10 @@
             if (mapNames)
                 mapPersistentTypeNames(entry.getKey(), (String[])
                     entry.getValue());
-            names.addAll(Arrays.asList((String[]) entry.getValue()));
+            List newNames = Arrays.asList((String[]) entry.getValue());
+            if (log.isTraceEnabled())
+                log.trace(_loc.get("scan-found-names", newNames, debugContext));
+            names.addAll(newNames);
         }
     }
 

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/resources/org/apache/openjpa/meta/localizer.properties
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/resources/org/apache/openjpa/meta/localizer.properties?view=diff&rev=496914&r1=496913&r2=496914
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/resources/org/apache/openjpa/meta/localizer.properties
(original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/resources/org/apache/openjpa/meta/localizer.properties
Tue Jan 16 18:00:56 2007
@@ -290,3 +290,5 @@
 scanning-zip-stream-url: Scanning jar in stream from URL "{0}" for persistent \
 	types.
 scanning-resource: Scanning resource "{0}" for persistent types.
+scan-found-names: Scan of "{1}" found persistent types {0}.
+parse-found-names: parsePersistentTypeNames() found {0}.



Mime
View raw message