aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lin...@apache.org
Subject svn commit: r941986 - /incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/BlueprintAnnotationScannerImpl.java
Date Fri, 07 May 2010 02:47:53 GMT
Author: linsun
Date: Fri May  7 02:47:53 2010
New Revision: 941986

URL: http://svn.apache.org/viewvc?rev=941986&view=rev
Log:
[blueprint annotation] modify the code to set the interfaces for Treference, TreferenceList
and Tservice due to annotation API change

Modified:
    incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/BlueprintAnnotationScannerImpl.java

Modified: incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/BlueprintAnnotationScannerImpl.java
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/BlueprintAnnotationScannerImpl.java?rev=941986&r1=941985&r2=941986&view=diff
==============================================================================
--- incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/BlueprintAnnotationScannerImpl.java
(original)
+++ incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/annotation/impl/BlueprintAnnotationScannerImpl.java
Fri May  7 02:47:53 2010
@@ -39,6 +39,7 @@ import org.apache.aries.blueprint.annota
 import org.apache.aries.blueprint.annotation.service.BlueprintAnnotationScanner;
 import org.apache.aries.blueprint.jaxb.Tbean;
 import org.apache.aries.blueprint.jaxb.Tdescription;
+import org.apache.aries.blueprint.jaxb.Tinterfaces;
 import org.apache.aries.blueprint.jaxb.Tproperty;
 import org.apache.aries.blueprint.jaxb.Tref;
 import org.apache.aries.blueprint.jaxb.Treference;
@@ -382,7 +383,7 @@ public class BlueprintAnnotationScannerI
         String compName = ref.componentName();
         String desp = ref.description();
         String filter = ref.filter();
-        String pubInterface = ref.publishInterface();
+        Class<?> serviceInterface = ref.serviceInterface();
         ReferenceListener[] refListeners = ref.referenceListener();
         int timeout = ref.timeout();
         Treference tref = new Treference();
@@ -408,8 +409,8 @@ public class BlueprintAnnotationScannerI
         if (filter.length() > 0) {
             tref.setFilter(filter);
         }
-        if (pubInterface.length() > 0) {
-            tref.setInterface(pubInterface);
+        if (serviceInterface != Object.class) {
+            tref.setInterface(serviceInterface.getName());
         } else {
             boolean isInterface =  refClass.isInterface();
             if (isInterface) {
@@ -445,7 +446,7 @@ public class BlueprintAnnotationScannerI
         String compName = ref.componentName();
         String desp = ref.description();
         String filter = ref.filter();
-        String pubInterface = ref.publishInterface();
+        Class<?> serviceInterface = ref.serviceInterface();
         ReferenceListener[] refListeners = ref.referenceListener();
         TreferenceList tref = new TreferenceList();
         
@@ -470,8 +471,8 @@ public class BlueprintAnnotationScannerI
         if (filter.length() > 0) {
             tref.setFilter(filter);
         }
-        if (pubInterface.length() > 0) {
-            tref.setInterface(pubInterface);
+        if (serviceInterface  != Object.class) {
+            tref.setInterface(serviceInterface.getName());
         } else {
             boolean isInterface =  refClass.isInterface();
             if (isInterface) {
@@ -496,7 +497,7 @@ public class BlueprintAnnotationScannerI
     
     private Tservice generateTservice(Class clazz, String id) {
         Service service = (Service) clazz.getAnnotation(Service.class);
-        String pInterface = service.publishInterface();
+        Class<?>[] interfaces = service.interfaces();
         int ranking = service.ranking();
         String autoExport = service.autoExport();
         RegistrationListener[] regListeners = service.registerationListener();
@@ -515,9 +516,12 @@ public class BlueprintAnnotationScannerI
         if (ranking > 0) {
             tservice.setRanking(ranking);
         }
-        if (pInterface.length() > 0) {
-            // TODO add support for multiple interfaces
-            tservice.setInterface(pInterface);
+        for (Class<?> interf : interfaces) {
+            Tinterfaces tInterfaces = new Tinterfaces();
+            if (interf != null) {
+                tInterfaces.getValue().add(interf.getName());
+            }
+            tservice.setInterfaces(tInterfaces);
         }
         
         for (RegistrationListener regListener : regListeners) {



Mime
View raw message