Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'examples/bundles/com.mycorp.examples.timeservice.consumer.ds')
-rw-r--r--examples/bundles/com.mycorp.examples.timeservice.consumer.ds/OSGI-INF/com.mycorp.examples.timeservice.consumer.ds.TimeServiceComponent.xml2
-rw-r--r--examples/bundles/com.mycorp.examples.timeservice.consumer.ds/src/com/mycorp/examples/timeservice/consumer/ds/TimeServiceComponent.java4
2 files changed, 2 insertions, 4 deletions
diff --git a/examples/bundles/com.mycorp.examples.timeservice.consumer.ds/OSGI-INF/com.mycorp.examples.timeservice.consumer.ds.TimeServiceComponent.xml b/examples/bundles/com.mycorp.examples.timeservice.consumer.ds/OSGI-INF/com.mycorp.examples.timeservice.consumer.ds.TimeServiceComponent.xml
index b138f9026..1c55cc390 100644
--- a/examples/bundles/com.mycorp.examples.timeservice.consumer.ds/OSGI-INF/com.mycorp.examples.timeservice.consumer.ds.TimeServiceComponent.xml
+++ b/examples/bundles/com.mycorp.examples.timeservice.consumer.ds/OSGI-INF/com.mycorp.examples.timeservice.consumer.ds.TimeServiceComponent.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" immediate="true" name="com.mycorp.examples.timeservice.consumer.ds.TimeServiceComponent">
- <reference bind="bindTimeService" cardinality="1..n" interface="com.mycorp.examples.timeservice.ITimeService" name="TimeService" policy="dynamic" unbind="unbindTimeService"/>
+ <reference bind="bindTimeService" interface="com.mycorp.examples.timeservice.ITimeService" name="TimeService" unbind="unbindTimeService"/>
<implementation class="com.mycorp.examples.timeservice.consumer.ds.TimeServiceComponent"/>
</scr:component> \ No newline at end of file
diff --git a/examples/bundles/com.mycorp.examples.timeservice.consumer.ds/src/com/mycorp/examples/timeservice/consumer/ds/TimeServiceComponent.java b/examples/bundles/com.mycorp.examples.timeservice.consumer.ds/src/com/mycorp/examples/timeservice/consumer/ds/TimeServiceComponent.java
index 9939bcb03..9fbcbbba7 100644
--- a/examples/bundles/com.mycorp.examples.timeservice.consumer.ds/src/com/mycorp/examples/timeservice/consumer/ds/TimeServiceComponent.java
+++ b/examples/bundles/com.mycorp.examples.timeservice.consumer.ds/src/com/mycorp/examples/timeservice/consumer/ds/TimeServiceComponent.java
@@ -10,8 +10,6 @@ package com.mycorp.examples.timeservice.consumer.ds;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;
-import org.osgi.service.component.annotations.ReferenceCardinality;
-import org.osgi.service.component.annotations.ReferencePolicy;
import com.mycorp.examples.timeservice.ITimeService;
@@ -19,7 +17,7 @@ import com.mycorp.examples.timeservice.ITimeService;
public class TimeServiceComponent {
// Called by DS upon ITimeService discovery
- @Reference(policy=ReferencePolicy.DYNAMIC, cardinality=ReferenceCardinality.AT_LEAST_ONE)
+ @Reference
void bindTimeService(ITimeService timeService) {
System.out.println("Discovered ITimeService via DS. Instance="+timeService);
// Call the service and print out result!

Back to the top