Pierre De Rop | 689f152 | 2010-01-11 21:45:35 +0000 | [diff] [blame^] | 1 | package org.apache.felix.dm.samples.annotation; |
| 2 | |
| 3 | import org.apache.felix.dm.annotation.api.Service; |
| 4 | import org.apache.felix.dm.annotation.api.ServiceDependency; |
| 5 | import org.apache.felix.dm.annotation.api.Start; |
| 6 | import org.apache.felix.dm.annotation.api.Stop; |
| 7 | |
| 8 | @Service |
| 9 | public 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 | } |