openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p..@apache.org
Subject svn commit: r495028 - in /incubator/openjpa/trunk: openjpa-kernel/src/main/java/org/apache/openjpa/meta/ openjpa-kernel/src/main/resources/org/apache/openjpa/meta/ openjpa-persistence/src/main/java/org/apache/openjpa/persistence/ openjpa-persistence/sr...
Date Wed, 10 Jan 2007 23:06:43 GMT
Author: pcl
Date: Wed Jan 10 15:06:42 2007
New Revision: 495028

URL: http://svn.apache.org/viewvc?view=rev&rev=495028
Log:
OPENJPA-100: <jar-file> processing bugfix, and logging improvements

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
    incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceMetaDataFactory.java
    incubator/openjpa/trunk/openjpa-persistence/src/main/resources/org/apache/openjpa/persistence/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=495028&r1=495027&r2=495028
==============================================================================
--- 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
Wed Jan 10 15:06:42 2007
@@ -604,12 +604,18 @@
             for (Iterator itr = files.iterator(); itr.hasNext();) {
                 file = (File) itr.next();
                 if (file.isDirectory()) {
+                    if (log.isTraceEnabled())
+                        log.trace(_loc.get("scanning-directory", file));
                     scan(new FileMetaDataIterator(dir, newMetaDataFilter()),
                         cparser, names, true);
                 } 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);
                 } else {
+                    if (log.isTraceEnabled())
+                        log.trace(_loc.get("scanning-file", file));
                     clss = cparser.parseTypeNames(new FileMetaDataIterator
                         (file));
                     names.addAll(Arrays.asList(clss));
@@ -624,9 +630,19 @@
                 url = (URL) itr.next();
                 if ("jar".equals(url.getProtocol())
                     && url.getPath().endsWith("!/")) {
+                    if (log.isTraceEnabled())
+                        log.trace(_loc.get("scanning-jar-url", url));
                     scan(new ZipFileMetaDataIterator(url,
                         newMetaDataFilter()), cparser, names, true);
+                } 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);
                 } else {
+                    if (log.isTraceEnabled())
+                        log.trace(_loc.get("scanning-url", url));
                     clss = cparser.parseTypeNames(new URLMetaDataIterator
                         (url));
                     names.addAll(Arrays.asList(clss));
@@ -642,11 +658,15 @@
                 if (rsrc.endsWith(".jar")) {
                     url = loader.getResource(rsrc);
                     if (url != null) {
+                        if (log.isTraceEnabled())
+                            log.trace(_loc.get("scanning-jar-stream-url", url));
                         scan(new ZipStreamMetaDataIterator
                             (new ZipInputStream(url.openStream()),
                                 newMetaDataFilter()), cparser, names, true);
                     }
                 } else {
+                    if (log.isTraceEnabled())
+                        log.trace(_loc.get("scanning-resource", rsrc));
                     mitr = new ResourceMetaDataIterator(rsrc, loader);
                     while (mitr.hasNext()) {
                         url = (URL) mitr.next();

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=495028&r1=495027&r2=495028
==============================================================================
--- 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
Wed Jan 10 15:06:42 2007
@@ -281,3 +281,12 @@
     of the task''s nested <config> element. This can also occur if your \
     OpenJPA distribution jars are corrupt, or if your security policy is \
     overly strict.
+scanning-directory: Scanning directory "{0}" for persistent types.
+scanning-jar: Scanning jar "{0}" for persistent types.
+scanning-file: Scanning file "{0}" for persistent types.
+scanning-jar-url: Scanning jar: URL "{0}" for persistent types.
+scanning-jar-at-url: Scanning jar file from URL "{0}" for persistent types.
+scanning-url: Scanning URL "{0}" for persistent types.
+scanning-zip-stream-url: Scanning jar in stream from URL "{0}" for persistent \
+	types.
+scanning-resource: Scanning resource "{0}" for persistent types.

Modified: incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceMetaDataFactory.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceMetaDataFactory.java?view=diff&rev=495028&r1=495027&r2=495028
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceMetaDataFactory.java
(original)
+++ incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceMetaDataFactory.java
Wed Jan 10 15:06:42 2007
@@ -245,9 +245,22 @@
 
     @Override
     protected void mapPersistentTypeNames(Object rsrc, String[] names) {
-        if (!(rsrc instanceof URL) || rsrc.toString().endsWith(".class"))
+        if (!(rsrc instanceof URL)) {
+            if (log.isTraceEnabled())
+                log.trace(
+                    _loc.get("map-persistent-types-skipping-non-url", rsrc));
             return;
+        } else if (rsrc.toString().endsWith(".class")) {
+            if (log.isTraceEnabled())
+                log.trace(
+                    _loc.get("map-persistent-types-skipping-class", rsrc));
+            return;
+        }
 
+        if (log.isTraceEnabled())
+            log.trace(_loc.get(
+                "map-persistent-type-names", rsrc, Arrays.asList(names)));
+        
         if (_xml == null)
             _xml = new HashMap<URL, Set>();
         _xml.put((URL) rsrc, new HashSet(Arrays.asList(names)));

Modified: incubator/openjpa/trunk/openjpa-persistence/src/main/resources/org/apache/openjpa/persistence/localizer.properties
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence/src/main/resources/org/apache/openjpa/persistence/localizer.properties?view=diff&rev=495028&r1=495027&r2=495028
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence/src/main/resources/org/apache/openjpa/persistence/localizer.properties
(original)
+++ incubator/openjpa/trunk/openjpa-persistence/src/main/resources/org/apache/openjpa/persistence/localizer.properties
Wed Jan 10 15:06:42 2007
@@ -110,6 +110,13 @@
     "{0}" into a BrokerFactory.
 cant-convert-broker: Unable to convert EntityManager of type "{0}" into a \
     Broker.
+map-persistent-type-names: Mapping resource location "{0}" to persistent \
+	types "{1}".
+map-persistent-types-skipping-non-url: Skipping mapping for location "{0}" \
+	since it is not a URL.
+map-persistent-types-skipping-class: Skipping mapping for location "{0}" since \
+	it is a class, and will not need to be re-parsed later.
+    
 EntityManagerFactory-name: EntityManagerFactory implementation
 EntityManagerFactory-desc: Allows extension of standard \
     org.apache.openjpa.persistence.EntityManagerFactoryImpl for custom behavior.



Mime
View raw message