incubator-aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From timothyjw...@apache.org
Subject svn commit: r896792 - in /incubator/aries/trunk/jpa/jpa-container/src: main/java/org/apache/aries/jpa/container/impl/ main/java/org/apache/aries/jpa/container/parsing/ main/java/org/apache/aries/jpa/container/parsing/impl/ test/java/org/apache/aries/jp...
Date Thu, 07 Jan 2010 08:20:24 GMT
Author: timothyjward
Date: Thu Jan  7 08:20:00 2010
New Revision: 896792

URL: http://svn.apache.org/viewvc?rev=896792&view=rev
Log:
ARIES-80: Deliver a persistence descriptor parser.

Added:
    incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/parsing/PersistenceDescriptor.java
Modified:
    incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/PersistenceBundleHelper.java
    incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/PersistenceBundleManager.java
    incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/PersistenceDescriptorImpl.java
    incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/parsing/PersistenceDescriptorParser.java
    incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/parsing/impl/EarlyParserReturn.java
    incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/parsing/impl/JPAHandler.java
    incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/parsing/impl/PersistenceUnitImpl.java
    incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/parsing/impl/SchemaLocatingHandler.java
    incubator/aries/trunk/jpa/jpa-container/src/test/java/org/apache/aries/jpa/container/parsing/PersistenceXMLParsingTest.java

Modified: incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/PersistenceBundleHelper.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/PersistenceBundleHelper.java?rev=896792&r1=896791&r2=896792&view=diff
==============================================================================
--- incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/PersistenceBundleHelper.java
(original)
+++ incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/PersistenceBundleHelper.java
Thu Jan  7 08:20:00 2010
@@ -30,6 +30,7 @@
 import java.util.jar.JarEntry;
 import java.util.jar.JarInputStream;
 
+import org.apache.aries.jpa.container.parsing.PersistenceDescriptor;
 import org.osgi.framework.Bundle;
 
 /**
@@ -72,7 +73,7 @@
       for(String location : locations) {
         InputStream file = locateFile(bundle, location.trim());
         if(file != null)
-          persistenceXmlFiles.add(new PersistenceDescriptor(location, file));
+          persistenceXmlFiles.add(new PersistenceDescriptorImpl(location, file));
         }
     } catch (Exception e) {
         //TODO log

Modified: incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/PersistenceBundleManager.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/PersistenceBundleManager.java?rev=896792&r1=896791&r2=896792&view=diff
==============================================================================
--- incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/PersistenceBundleManager.java
(original)
+++ incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/PersistenceBundleManager.java
Thu Jan  7 08:20:00 2010
@@ -21,6 +21,7 @@
 
 import java.util.Collection;
 
+import org.apache.aries.jpa.container.parsing.PersistenceDescriptor;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.BundleEvent;

Modified: incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/PersistenceDescriptorImpl.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/PersistenceDescriptorImpl.java?rev=896792&r1=896791&r2=896792&view=diff
==============================================================================
--- incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/PersistenceDescriptorImpl.java
(original)
+++ incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/PersistenceDescriptorImpl.java
Thu Jan  7 08:20:00 2010
@@ -20,13 +20,15 @@
 
 import java.io.InputStream;
 
+import org.apache.aries.jpa.container.parsing.PersistenceDescriptor;
+
 /**
  * Stores the location of a persistence descriptor and
  * a stream to its contents. Note that there is only one
  * copy of the InputStream, only one thread should try to
  * read from it, and it can only be closed once. 
  */
-public class PersistenceDescriptor {
+public class PersistenceDescriptorImpl implements PersistenceDescriptor {
 
   /** The location of the persistence descriptor */
   private final String location;
@@ -38,22 +40,20 @@
    * @param location
    * @param inputStream
    */
-  public PersistenceDescriptor(String location, InputStream inputStream) {
+  public PersistenceDescriptorImpl(String location, InputStream inputStream) {
     this.location = location;
     this.inputStream = inputStream;
   }
 
-  /**
-   * Get the location of the persistence descriptor
-   * @return
+  /* (non-Javadoc)
+   * @see org.apache.aries.jpa.container.impl.PersistenceDescriptor#getLocation()
    */
   public String getLocation() {
     return location;
   }
 
-  /**
-   * Get hold of the wrapped InputStream
-   * @return
+  /* (non-Javadoc)
+   * @see org.apache.aries.jpa.container.impl.PersistenceDescriptor#getInputStream()
    */
   public InputStream getInputStream() {
     return inputStream;

Added: incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/parsing/PersistenceDescriptor.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/parsing/PersistenceDescriptor.java?rev=896792&view=auto
==============================================================================
--- incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/parsing/PersistenceDescriptor.java
(added)
+++ incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/parsing/PersistenceDescriptor.java
Thu Jan  7 08:20:00 2010
@@ -0,0 +1,19 @@
+package org.apache.aries.jpa.container.parsing;
+
+import java.io.InputStream;
+
+public interface PersistenceDescriptor {
+
+  /**
+   * Get the location of the persistence descriptor
+   * @return
+   */
+  public abstract String getLocation();
+
+  /**
+   * Get hold of the wrapped InputStream
+   * @return
+   */
+  public abstract InputStream getInputStream();
+
+}
\ No newline at end of file

Modified: incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/parsing/PersistenceDescriptorParser.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/parsing/PersistenceDescriptorParser.java?rev=896792&r1=896791&r2=896792&view=diff
==============================================================================
--- incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/parsing/PersistenceDescriptorParser.java
(original)
+++ incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/parsing/PersistenceDescriptorParser.java
Thu Jan  7 08:20:00 2010
@@ -30,7 +30,9 @@
 import javax.xml.parsers.SAXParserFactory;
 import javax.xml.validation.Schema;
 
-import org.apache.aries.jpa.container.impl.PersistenceDescriptor;
+import org.apache.aries.jpa.container.parsing.impl.EarlyParserReturn;
+import org.apache.aries.jpa.container.parsing.impl.JPAHandler;
+import org.apache.aries.jpa.container.parsing.impl.SchemaLocatingHandler;
 import org.osgi.framework.Bundle;
 
 public class PersistenceDescriptorParser {

Modified: incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/parsing/impl/EarlyParserReturn.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/parsing/impl/EarlyParserReturn.java?rev=896792&r1=896791&r2=896792&view=diff
==============================================================================
--- incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/parsing/impl/EarlyParserReturn.java
(original)
+++ incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/parsing/impl/EarlyParserReturn.java
Thu Jan  7 08:20:00 2010
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.aries.jpa.container.parsing;
+package org.apache.aries.jpa.container.parsing.impl;
 
 import javax.xml.validation.Schema;
 

Modified: incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/parsing/impl/JPAHandler.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/parsing/impl/JPAHandler.java?rev=896792&r1=896791&r2=896792&view=diff
==============================================================================
--- incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/parsing/impl/JPAHandler.java
(original)
+++ incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/parsing/impl/JPAHandler.java
Thu Jan  7 08:20:00 2010
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.aries.jpa.container.parsing;
+package org.apache.aries.jpa.container.parsing.impl;
 
 import java.util.Collection;
 import java.util.Stack;

Modified: incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/parsing/impl/PersistenceUnitImpl.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/parsing/impl/PersistenceUnitImpl.java?rev=896792&r1=896791&r2=896792&view=diff
==============================================================================
--- incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/parsing/impl/PersistenceUnitImpl.java
(original)
+++ incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/parsing/impl/PersistenceUnitImpl.java
Thu Jan  7 08:20:00 2010
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.aries.jpa.container.parsing;
+package org.apache.aries.jpa.container.parsing.impl;
 
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -24,6 +24,7 @@
 import java.util.Map;
 import java.util.Properties;
 
+import org.apache.aries.jpa.container.parsing.ParsedPersistenceUnit;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.ServiceReference;
 

Modified: incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/parsing/impl/SchemaLocatingHandler.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/parsing/impl/SchemaLocatingHandler.java?rev=896792&r1=896791&r2=896792&view=diff
==============================================================================
--- incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/parsing/impl/SchemaLocatingHandler.java
(original)
+++ incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/parsing/impl/SchemaLocatingHandler.java
Thu Jan  7 08:20:00 2010
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.aries.jpa.container.parsing;
+package org.apache.aries.jpa.container.parsing.impl;
 
 import java.net.URL;
 import java.util.concurrent.ConcurrentHashMap;

Modified: incubator/aries/trunk/jpa/jpa-container/src/test/java/org/apache/aries/jpa/container/parsing/PersistenceXMLParsingTest.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/jpa/jpa-container/src/test/java/org/apache/aries/jpa/container/parsing/PersistenceXMLParsingTest.java?rev=896792&r1=896791&r2=896792&view=diff
==============================================================================
--- incubator/aries/trunk/jpa/jpa-container/src/test/java/org/apache/aries/jpa/container/parsing/PersistenceXMLParsingTest.java
(original)
+++ incubator/aries/trunk/jpa/jpa-container/src/test/java/org/apache/aries/jpa/container/parsing/PersistenceXMLParsingTest.java
Thu Jan  7 08:20:00 2010
@@ -35,7 +35,7 @@
 import java.util.List;
 import java.util.Properties;
 
-import org.apache.aries.jpa.container.impl.PersistenceDescriptor;
+import org.apache.aries.jpa.container.impl.PersistenceDescriptorImpl;
 import org.apache.aries.unittest.mocks.Skeleton;
 import org.junit.Test;
 import org.osgi.framework.Bundle;
@@ -54,7 +54,7 @@
     try {
       String location = "src/test/resources/file1/META-INF/persistence.xml";
       is = new FileInputStream(location);
-      PersistenceDescriptor descriptor = new PersistenceDescriptor(location, is);
+      PersistenceDescriptor descriptor = new PersistenceDescriptorImpl(location, is);
       
       Bundle b = Skeleton.newMock(Bundle.class);
       
@@ -204,7 +204,7 @@
     try {
       String location = "src/test/resources/file2/META-INF/persistence.xml";
       is = new FileInputStream(location);
-      PersistenceDescriptor descriptor = new PersistenceDescriptor(location, is);
+      PersistenceDescriptor descriptor = new PersistenceDescriptorImpl(location, is);
 
       Bundle b = Skeleton.newMock(Bundle.class);
       
@@ -224,7 +224,7 @@
     try {
       String location = "src/test/resources/file3/META-INF/persistence.xml";
       is = new FileInputStream(location);
-      PersistenceDescriptor descriptor = new PersistenceDescriptor(location, is);
+      PersistenceDescriptor descriptor = new PersistenceDescriptorImpl(location, is);
       
       Bundle b = Skeleton.newMock(Bundle.class);
       



Mime
View raw message