| /* |
| * Licensed to the Apache Software Foundation (ASF) under one or more |
| * contributor license agreements. See the NOTICE file distributed with |
| * this work for additional information regarding copyright ownership. |
| * The ASF licenses this file to You under the Apache License, Version 2.0 |
| * (the "License"); you may not use this file except in compliance with |
| * the License. You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, software |
| * distributed under the License is distributed on an "AS IS" BASIS, |
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| * See the License for the specific language governing permissions and |
| * limitations under the License. |
| */ |
| |
| This sample is an example usage of DM composite components. A composite component is implemented |
| using a composition of multiple object instances, which are used to implement a given complex |
| service. In this example, we define a "Provider" service, which is implemented by three object instances: |
| ProviderImpl (which is the main implementation class that provides the service), ProviderParticipant1, |
| and ProviderParticipant2. |
| |
| Dependencies are injected in all objects being part of the composition. |
| |
| To test, run click on the bndtools "composite.bndrun" descriptor, and run it, then type "log warn" in gogo shell: |
| |
| g! log warn |
| |
| 2016.02.08 23:00:34 WARNING - Bundle: org.apache.felix.dependencymanager.samples.composite - ProviderParticipant2.start() |
| 2016.02.08 23:00:34 WARNING - Bundle: org.apache.felix.dependencymanager.samples.composite - ProviderParticipant1.start() |
| 2016.02.08 23:00:34 WARNING - Bundle: org.apache.felix.dependencymanager.samples.composite - ProviderImpl.start(): participants=ProviderParticipant1,ProviderParticipant2, conf={key=value, service.pid=org.apache.felix.dependencymanager.samples.composite.ProviderImpl} |
| |