aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject svn commit: r1718780 - in /aries/trunk/jpa: itests/jpa-container-blueprint-testbundle/src/main/resources/OSGI-INF/blueprint/ itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/blueprint/aries/itest/ jpa-blueprint/src/main/java/org/apache/ari...
Date Wed, 09 Dec 2015 09:05:10 GMT
Author: cschneider
Date: Wed Dec  9 09:05:10 2015
New Revision: 1718780

URL: http://svn.apache.org/viewvc?rev=1718780&view=rev
Log:
[ARIES-1455] Also scan inlined beans for annotations

Modified:
    aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/resources/OSGI-INF/blueprint/config.xml
    aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/blueprint/aries/itest/BlueprintTest.java
    aries/trunk/jpa/jpa-blueprint/src/main/java/org/apache/aries/jpa/blueprint/impl/JpaComponentProcessor.java

Modified: aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/resources/OSGI-INF/blueprint/config.xml
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/resources/OSGI-INF/blueprint/config.xml?rev=1718780&r1=1718779&r2=1718780&view=diff
==============================================================================
--- aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/resources/OSGI-INF/blueprint/config.xml
(original)
+++ aries/trunk/jpa/itests/jpa-container-blueprint-testbundle/src/main/resources/OSGI-INF/blueprint/config.xml
Wed Dec  9 09:05:10 2015
@@ -64,6 +64,13 @@
     <bean id="carServiceEmJtaAnn"
         class="org.apache.aries.jpa.container.itest.bundle.blueprint.impl.CarServiceEmJtaAnn">
     </bean>
+    
+    <service interface="org.apache.aries.jpa.container.itest.entities.CarService">
+        <service-properties>
+            <entry key="type" value="emJtaAnnInlined" />
+        </service-properties>
+        <bean class="org.apache.aries.jpa.container.itest.bundle.blueprint.impl.CarServiceEmJtaAnn"/>
+    </service>
 
     <service ref="carServiceEmSupplier"
         interface="org.apache.aries.jpa.container.itest.entities.CarService">

Modified: aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/blueprint/aries/itest/BlueprintTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/blueprint/aries/itest/BlueprintTest.java?rev=1718780&r1=1718779&r2=1718780&view=diff
==============================================================================
--- aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/blueprint/aries/itest/BlueprintTest.java
(original)
+++ aries/trunk/jpa/itests/jpa-container-itest/src/test/java/org/apache/aries/jpa/blueprint/aries/itest/BlueprintTest.java
Wed Dec  9 09:05:10 2015
@@ -102,6 +102,11 @@ public class BlueprintTest extends Abstr
     }
     
     @Test
+    public void testInlined() throws Exception {
+        carRealTransactionalLifecycle(getCarService("emJtaAnnInlined"));
+    }
+    
+    @Test
     public void testCoordinationLifecycle() throws InterruptedException, ExecutionException
{
         CarService carService = getCarService("em");
         assertNoCars(carService);

Modified: aries/trunk/jpa/jpa-blueprint/src/main/java/org/apache/aries/jpa/blueprint/impl/JpaComponentProcessor.java
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-blueprint/src/main/java/org/apache/aries/jpa/blueprint/impl/JpaComponentProcessor.java?rev=1718780&r1=1718779&r2=1718780&view=diff
==============================================================================
--- aries/trunk/jpa/jpa-blueprint/src/main/java/org/apache/aries/jpa/blueprint/impl/JpaComponentProcessor.java
(original)
+++ aries/trunk/jpa/jpa-blueprint/src/main/java/org/apache/aries/jpa/blueprint/impl/JpaComponentProcessor.java
Wed Dec  9 09:05:10 2015
@@ -38,10 +38,12 @@ import org.apache.aries.blueprint.PassTh
 import org.apache.aries.blueprint.mutable.MutableBeanMetadata;
 import org.apache.aries.blueprint.mutable.MutableRefMetadata;
 import org.apache.aries.blueprint.mutable.MutableReferenceMetadata;
+import org.apache.aries.blueprint.mutable.MutableServiceMetadata;
 import org.osgi.framework.Bundle;
 import org.osgi.service.blueprint.container.BlueprintContainer;
 import org.osgi.service.blueprint.reflect.ComponentMetadata;
 import org.osgi.service.blueprint.reflect.ReferenceMetadata;
+import org.osgi.service.blueprint.reflect.Target;
 import org.osgi.service.coordinator.Coordinator;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -69,8 +71,17 @@ public class JpaComponentProcessor imple
         Set<String> components = new HashSet<String>(cdr.getComponentDefinitionNames());
         for (String component : components) {
             ComponentMetadata compDef = cdr.getComponentDefinition(component);
+            
             if (compDef instanceof MutableBeanMetadata && !((MutableBeanMetadata)compDef).isProcessor())
{
+                // Normal bean def
                 handleComponent((MutableBeanMetadata)compDef, bundle, cdr, container);
+            } else if(compDef instanceof MutableServiceMetadata) {
+                // Bean inlined into service def
+                MutableServiceMetadata sMeta = (MutableServiceMetadata)compDef;
+                Target target = sMeta.getServiceComponent();
+                if (target instanceof MutableBeanMetadata) {
+                    handleComponent((MutableBeanMetadata)target, bundle, cdr, container);
+                }
             }
         }
     }



Mime
View raw message