blob: 108bc6a83782769b48f25be14a25de4b95735d91 [file] [log] [blame]
Pierre De Rop689f1522010-01-11 21:45:35 +00001package org.apache.felix.dm.samples.annotation;
2
3import org.apache.felix.dm.annotation.api.Service;
4import org.apache.felix.dm.annotation.api.ServiceDependency;
5import org.apache.felix.dm.annotation.api.Start;
6import org.apache.felix.dm.annotation.api.Stop;
7
8@Service
9public class ServiceConsumer
10{
11 @ServiceDependency
12 private volatile ServiceInterface m_service;
13
14 @ServiceDependency
15 protected void bind(ServiceInterface si)
16 {
17 }
18
19 @Start
20 protected void start()
21 {
22 System.out.println("ServiceConsumer.start");
23 m_service.doService();
24 }
25
26 @Stop
27 protected void stop()
28 {
29 System.out.println("ServiceConsumer.stop");
30 }
31}