You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aries.apache.org by ma...@apache.org on 2011/07/07 21:10:50 UTC

svn commit: r1143982 - in /aries/trunk/jpa: jpa-container-eclipselink-adapter/ jpa-container-eclipselink-adapter/src/main/java/org/apache/aries/jpa/eclipselink/adapter/ jpa-container-itest/src/test/java/org/apache/aries/jpa/advanced/features/itest/

Author: mahrwald
Date: Thu Jul  7 19:10:50 2011
New Revision: 1143982

URL: http://svn.apache.org/viewvc?rev=1143982&view=rev
Log:
ARIES-691: Allow extension of RESOLVED eclipselink bundle

Modified:
    aries/trunk/jpa/jpa-container-eclipselink-adapter/pom.xml
    aries/trunk/jpa/jpa-container-eclipselink-adapter/src/main/java/org/apache/aries/jpa/eclipselink/adapter/Activator.java
    aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/advanced/features/itest/EclipseLinkWeavingAndAnnotationScanningTest.java

Modified: aries/trunk/jpa/jpa-container-eclipselink-adapter/pom.xml
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-container-eclipselink-adapter/pom.xml?rev=1143982&r1=1143981&r2=1143982&view=diff
==============================================================================
--- aries/trunk/jpa/jpa-container-eclipselink-adapter/pom.xml (original)
+++ aries/trunk/jpa/jpa-container-eclipselink-adapter/pom.xml Thu Jul  7 19:10:50 2011
@@ -36,6 +36,10 @@
   <properties>
     <aries.osgi.private.pkg>org.apache.aries.jpa.eclipselink.adapter</aries.osgi.private.pkg>
     <aries.osgi.export.pkg>org.apache.aries.jpa.eclipselink.adapter.platform</aries.osgi.export.pkg>
+    <aries.osgi.import.pkg>
+      javax.persistence*;version="[1.1,1.2)",
+      *
+    </aries.osgi.import.pkg>
     <aries.osgi.activator>org.apache.aries.jpa.eclipselink.adapter.Activator</aries.osgi.activator>
   </properties>
 

Modified: aries/trunk/jpa/jpa-container-eclipselink-adapter/src/main/java/org/apache/aries/jpa/eclipselink/adapter/Activator.java
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-container-eclipselink-adapter/src/main/java/org/apache/aries/jpa/eclipselink/adapter/Activator.java?rev=1143982&r1=1143981&r2=1143982&view=diff
==============================================================================
--- aries/trunk/jpa/jpa-container-eclipselink-adapter/src/main/java/org/apache/aries/jpa/eclipselink/adapter/Activator.java (original)
+++ aries/trunk/jpa/jpa-container-eclipselink-adapter/src/main/java/org/apache/aries/jpa/eclipselink/adapter/Activator.java Thu Jul  7 19:10:50 2011
@@ -1,5 +1,5 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one
+// * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
  * regarding copyright ownership.  The ASF licenses this file
@@ -220,7 +220,7 @@ public class Activator implements Bundle
         ctx.addBundleListener(this);
         
         for (Bundle b : ctx.getBundles()) {
-            if ((b.getState() & (Bundle.ACTIVE | Bundle.STARTING)) != 0) 
+            if ((b.getState() & (Bundle.ACTIVE | Bundle.STARTING | Bundle.RESOLVED | Bundle.STOPPING)) != 0) 
                 handlePotentialEclipseLink(b);
         }
     }
@@ -236,9 +236,9 @@ public class Activator implements Bundle
     }
 
     public void bundleChanged(BundleEvent event) {
-        if ((event.getType() & (BundleEvent.STARTED | BundleEvent.STARTING | BundleEvent.LAZY_ACTIVATION)) != 0) {
+        if ((event.getType() & (BundleEvent.RESOLVED)) != 0) {
             handlePotentialEclipseLink(event.getBundle());
-        } else if (event.getType() == BundleEvent.STOPPING) {
+        } else if (event.getType() == BundleEvent.UNRESOLVED | event.getType() == BundleEvent.UNINSTALLED) {
             ServiceRegistration reg = registeredProviders.remove(event.getBundle());
             if (reg != null) {
                 reg.unregister();
@@ -268,7 +268,7 @@ public class Activator implements Bundle
                 props.put("org.apache.aries.jpa.container.weaving.packages", getJPAPackages(b));
                 props.put("javax.persistence.provider", ECLIPSELINK_JPA_PROVIDER_CLASS_NAME);
                             
-                ServiceRegistration reg = b.getBundleContext().registerService(
+                ServiceRegistration reg = context.registerService(
                         PersistenceProvider.class.getName(), factory, props);
                 
                 ServiceRegistration old = registeredProviders.putIfAbsent(b, reg);

Modified: aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/advanced/features/itest/EclipseLinkWeavingAndAnnotationScanningTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/advanced/features/itest/EclipseLinkWeavingAndAnnotationScanningTest.java?rev=1143982&r1=1143981&r2=1143982&view=diff
==============================================================================
--- aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/advanced/features/itest/EclipseLinkWeavingAndAnnotationScanningTest.java (original)
+++ aries/trunk/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/advanced/features/itest/EclipseLinkWeavingAndAnnotationScanningTest.java Thu Jul  7 19:10:50 2011
@@ -21,10 +21,10 @@ public class EclipseLinkWeavingAndAnnota
     @Configuration
     public static Option[] eclipseLinkConfig() {
         return options(        
-                mavenBundle("org.eclipse.persistence", "org.eclipse.persistence.jpa"),
-                mavenBundle("org.eclipse.persistence", "org.eclipse.persistence.core"),
-                mavenBundle("org.eclipse.persistence", "org.eclipse.persistence.asm"),
-                mavenBundle("org.eclipse.persistence", "org.eclipse.persistence.antlr"),
+                mavenBundle("org.eclipse.persistence", "org.eclipse.persistence.jpa").noStart(),
+                mavenBundle("org.eclipse.persistence", "org.eclipse.persistence.core").noStart(),
+                mavenBundle("org.eclipse.persistence", "org.eclipse.persistence.asm").noStart(),
+                mavenBundle("org.eclipse.persistence", "org.eclipse.persistence.antlr").noStart(),
                 
                 mavenBundle("org.apache.aries.jpa", "org.apache.aries.jpa.eclipselink.adapter")
         );