Repository: karaf
Updated Branches:
  refs/heads/master 887770ed4 -> e6260bcd5


[KARAF-4780] Migrate SCR demos to use the OSGi annotations

Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/d5b6e43a
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/d5b6e43a
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/d5b6e43a

Branch: refs/heads/master
Commit: d5b6e43aa0276e16e101875e578c2ada287b3f75
Parents: 887770e
Author: Guillaume Nodet <gno...@apache.org>
Authored: Mon Oct 17 11:46:26 2016 +0200
Committer: Guillaume Nodet <gno...@apache.org>
Committed: Mon Oct 17 15:22:41 2016 +0200

----------------------------------------------------------------------
 scr/examples/component-factory/pom.xml                  |  8 --------
 .../component/GreeterServiceFactoryManager.java         |  8 ++++----
 .../impl/GreeterServiceComponentFactoryImpl.java        |  6 +++---
 scr/examples/managed-service/pom.xml                    |  4 ----
 .../service/component/ManagedGreeterComponent.java      |  8 ++++----
 .../managed/service/impl/ManagedGreeterServiceImpl.java |  4 ++--
 scr/examples/service/pom.xml                            | 12 ++++--------
 .../examples/service/component/GreeterComponent.java    |  8 ++++----
 .../scr/examples/service/impl/GreeterServiceImpl.java   |  2 +-
 9 files changed, 22 insertions(+), 38 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/d5b6e43a/scr/examples/component-factory/pom.xml
----------------------------------------------------------------------
diff --git a/scr/examples/component-factory/pom.xml 
b/scr/examples/component-factory/pom.xml
index 080509c..6114dd6 100644
--- a/scr/examples/component-factory/pom.xml
+++ b/scr/examples/component-factory/pom.xml
@@ -36,14 +36,6 @@
 
     <dependencies>
         <dependency>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>org.apache.felix.scr</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>biz.aQute.bnd</groupId>
-            <artifactId>bndlib</artifactId>
-        </dependency>
-        <dependency>
             <groupId>org.osgi</groupId>
             <artifactId>org.osgi.core</artifactId>
         </dependency>

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5b6e43a/scr/examples/component-factory/src/main/java/org/apache/karaf/scr/examples/component/factories/component/GreeterServiceFactoryManager.java
----------------------------------------------------------------------
diff --git 
a/scr/examples/component-factory/src/main/java/org/apache/karaf/scr/examples/component/factories/component/GreeterServiceFactoryManager.java
 
b/scr/examples/component-factory/src/main/java/org/apache/karaf/scr/examples/component/factories/component/GreeterServiceFactoryManager.java
index a8e729f..9c8691b 100644
--- 
a/scr/examples/component-factory/src/main/java/org/apache/karaf/scr/examples/component/factories/component/GreeterServiceFactoryManager.java
+++ 
b/scr/examples/component-factory/src/main/java/org/apache/karaf/scr/examples/component/factories/component/GreeterServiceFactoryManager.java
@@ -16,13 +16,13 @@
  */
 package org.apache.karaf.scr.examples.component.factories.component;
 
-import aQute.bnd.annotation.component.Activate;
-import aQute.bnd.annotation.component.Component;
-import aQute.bnd.annotation.component.Deactivate;
-import aQute.bnd.annotation.component.Reference;
 import 
org.apache.karaf.scr.examples.component.factories.GreeterServiceComponentFactory;
 import org.osgi.service.component.ComponentFactory;
 import org.osgi.service.component.ComponentInstance;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Deactivate;
+import org.osgi.service.component.annotations.Reference;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5b6e43a/scr/examples/component-factory/src/main/java/org/apache/karaf/scr/examples/component/factories/impl/GreeterServiceComponentFactoryImpl.java
----------------------------------------------------------------------
diff --git 
a/scr/examples/component-factory/src/main/java/org/apache/karaf/scr/examples/component/factories/impl/GreeterServiceComponentFactoryImpl.java
 
b/scr/examples/component-factory/src/main/java/org/apache/karaf/scr/examples/component/factories/impl/GreeterServiceComponentFactoryImpl.java
index 2a24c5a..fa4fbfc 100644
--- 
a/scr/examples/component-factory/src/main/java/org/apache/karaf/scr/examples/component/factories/impl/GreeterServiceComponentFactoryImpl.java
+++ 
b/scr/examples/component-factory/src/main/java/org/apache/karaf/scr/examples/component/factories/impl/GreeterServiceComponentFactoryImpl.java
@@ -16,10 +16,10 @@
  */
 package org.apache.karaf.scr.examples.component.factories.impl;
 
-import aQute.bnd.annotation.component.Activate;
-import aQute.bnd.annotation.component.Component;
-import aQute.bnd.annotation.component.Deactivate;
 import 
org.apache.karaf.scr.examples.component.factories.GreeterServiceComponentFactory;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Deactivate;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5b6e43a/scr/examples/managed-service/pom.xml
----------------------------------------------------------------------
diff --git a/scr/examples/managed-service/pom.xml 
b/scr/examples/managed-service/pom.xml
index 7dc20e1..3e24b32 100644
--- a/scr/examples/managed-service/pom.xml
+++ b/scr/examples/managed-service/pom.xml
@@ -36,10 +36,6 @@
 
     <dependencies>
         <dependency>
-            <groupId>biz.aQute.bnd</groupId>
-            <artifactId>bndlib</artifactId>
-        </dependency>
-        <dependency>
             <groupId>org.osgi</groupId>
             <artifactId>org.osgi.core</artifactId>
         </dependency>

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5b6e43a/scr/examples/managed-service/src/main/java/org/apache/karaf/scr/examples/managed/service/component/ManagedGreeterComponent.java
----------------------------------------------------------------------
diff --git 
a/scr/examples/managed-service/src/main/java/org/apache/karaf/scr/examples/managed/service/component/ManagedGreeterComponent.java
 
b/scr/examples/managed-service/src/main/java/org/apache/karaf/scr/examples/managed/service/component/ManagedGreeterComponent.java
index 60c5ba3..e9fb331 100644
--- 
a/scr/examples/managed-service/src/main/java/org/apache/karaf/scr/examples/managed/service/component/ManagedGreeterComponent.java
+++ 
b/scr/examples/managed-service/src/main/java/org/apache/karaf/scr/examples/managed/service/component/ManagedGreeterComponent.java
@@ -16,11 +16,11 @@
  */
 package org.apache.karaf.scr.examples.managed.service.component;
 
-import aQute.bnd.annotation.component.Activate;
-import aQute.bnd.annotation.component.Component;
-import aQute.bnd.annotation.component.Deactivate;
-import aQute.bnd.annotation.component.Reference;
 import org.apache.karaf.scr.examples.managed.service.ManagedGreeterService;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Deactivate;
+import org.osgi.service.component.annotations.Reference;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5b6e43a/scr/examples/managed-service/src/main/java/org/apache/karaf/scr/examples/managed/service/impl/ManagedGreeterServiceImpl.java
----------------------------------------------------------------------
diff --git 
a/scr/examples/managed-service/src/main/java/org/apache/karaf/scr/examples/managed/service/impl/ManagedGreeterServiceImpl.java
 
b/scr/examples/managed-service/src/main/java/org/apache/karaf/scr/examples/managed/service/impl/ManagedGreeterServiceImpl.java
index dae7a3c..6c17d13 100644
--- 
a/scr/examples/managed-service/src/main/java/org/apache/karaf/scr/examples/managed/service/impl/ManagedGreeterServiceImpl.java
+++ 
b/scr/examples/managed-service/src/main/java/org/apache/karaf/scr/examples/managed/service/impl/ManagedGreeterServiceImpl.java
@@ -16,8 +16,8 @@
  */
 package org.apache.karaf.scr.examples.managed.service.impl;
 
-import aQute.bnd.annotation.component.*;
 import org.apache.karaf.scr.examples.managed.service.ManagedGreeterService;
+import org.osgi.service.component.annotations.*;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -32,7 +32,7 @@ import java.util.concurrent.locks.ReentrantReadWriteLock;
  * the name attribute and setting the configuration policy to required. The 
default is optional and when the
  * component attempts to activate it will throw a RuntimeException.
  */
-@Component(name = ManagedGreeterServiceImpl.COMPONENT_NAME, 
configurationPolicy = ConfigurationPolicy.require)
+@Component(name = ManagedGreeterServiceImpl.COMPONENT_NAME, 
configurationPolicy = ConfigurationPolicy.REQUIRE)
 public class ManagedGreeterServiceImpl implements ManagedGreeterService {
 
     public static final String COMPONENT_NAME = "ManagedGreeterService";

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5b6e43a/scr/examples/service/pom.xml
----------------------------------------------------------------------
diff --git a/scr/examples/service/pom.xml b/scr/examples/service/pom.xml
index 8e5433d..457c59e 100644
--- a/scr/examples/service/pom.xml
+++ b/scr/examples/service/pom.xml
@@ -35,18 +35,14 @@
     <description>Building SCR Components using the BND Annotation 
Libraries</description>
 
     <dependencies>
-        <!-- contains the SCR Annotations -->
         <dependency>
-            <groupId>biz.aQute.bnd</groupId>
-            <artifactId>bndlib</artifactId>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.core</artifactId>
         </dependency>
-        <!-- contains the SCR Binaries (only required if you need the low 
level SCR APIs -->
-        <!--
         <dependency>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>org.apache.felix.scr</artifactId>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.compendium</artifactId>
         </dependency>
-        -->
         <dependency>
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-api</artifactId>

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5b6e43a/scr/examples/service/src/main/java/org/apache/karaf/scr/examples/service/component/GreeterComponent.java
----------------------------------------------------------------------
diff --git 
a/scr/examples/service/src/main/java/org/apache/karaf/scr/examples/service/component/GreeterComponent.java
 
b/scr/examples/service/src/main/java/org/apache/karaf/scr/examples/service/component/GreeterComponent.java
index 1be1248..0d65fc0 100644
--- 
a/scr/examples/service/src/main/java/org/apache/karaf/scr/examples/service/component/GreeterComponent.java
+++ 
b/scr/examples/service/src/main/java/org/apache/karaf/scr/examples/service/component/GreeterComponent.java
@@ -16,11 +16,11 @@
  */
 package org.apache.karaf.scr.examples.service.component;
 
-import aQute.bnd.annotation.component.Activate;
-import aQute.bnd.annotation.component.Component;
-import aQute.bnd.annotation.component.Deactivate;
-import aQute.bnd.annotation.component.Reference;
 import org.apache.karaf.scr.examples.service.GreeterService;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Deactivate;
+import org.osgi.service.component.annotations.Reference;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

http://git-wip-us.apache.org/repos/asf/karaf/blob/d5b6e43a/scr/examples/service/src/main/java/org/apache/karaf/scr/examples/service/impl/GreeterServiceImpl.java
----------------------------------------------------------------------
diff --git 
a/scr/examples/service/src/main/java/org/apache/karaf/scr/examples/service/impl/GreeterServiceImpl.java
 
b/scr/examples/service/src/main/java/org/apache/karaf/scr/examples/service/impl/GreeterServiceImpl.java
index 1a195b2..2953f9a 100644
--- 
a/scr/examples/service/src/main/java/org/apache/karaf/scr/examples/service/impl/GreeterServiceImpl.java
+++ 
b/scr/examples/service/src/main/java/org/apache/karaf/scr/examples/service/impl/GreeterServiceImpl.java
@@ -16,8 +16,8 @@
  */
 package org.apache.karaf.scr.examples.service.impl;
 
-import aQute.bnd.annotation.component.Component;
 import org.apache.karaf.scr.examples.service.GreeterService;
+import org.osgi.service.component.annotations.Component;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

Reply via email to