Pierre De Rop | 1892994 | 2010-01-11 21:48:36 +0000 | [diff] [blame^] | 1 | package org.apache.felix.dm.test.annotation; |
| 2 | |
| 3 | import org.apache.felix.dm.annotation.api.Destroy; |
| 4 | import org.apache.felix.dm.annotation.api.Init; |
| 5 | import org.apache.felix.dm.annotation.api.Service; |
| 6 | import org.apache.felix.dm.annotation.api.ServiceDependency; |
| 7 | import org.apache.felix.dm.annotation.api.Start; |
| 8 | import org.apache.felix.dm.annotation.api.Stop; |
| 9 | |
| 10 | @Service |
| 11 | public class ServiceConsumer |
| 12 | { |
| 13 | @ServiceDependency |
| 14 | volatile Sequencer m_sequencer; |
| 15 | |
| 16 | @ServiceDependency(filter = "(foo=bar)") |
| 17 | volatile ServiceInterface m_service; |
| 18 | |
| 19 | @Start |
| 20 | void start() |
| 21 | { |
| 22 | m_sequencer.next(6); |
| 23 | m_service.doService(); |
| 24 | } |
| 25 | |
| 26 | @Stop |
| 27 | void stop() |
| 28 | { |
| 29 | m_sequencer.next(8); |
| 30 | } |
| 31 | } |