blob: f23a1b089f3c1d2ce44e518f812fa98b0d2ff893 [file] [log] [blame]
/*
* 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 Activator is an example usage of DM composite. A composite component is implemented
using a composition of multiple object instances, which are used to implement a given service.
The sample also uses a Factory approach in order to instantiate the composition of objects: A
"CompositionManager" is first injected with a Configuration that can possibly be used to create
and configure all the composites.
Dependencies are injected in all objects in the composition.
To test, run click on "compositefactory.bndrun" descriptor, and run it, then type "log warn" in gogo shell:
g! log warn
2016.02.08 22:26:05 WARNING - Bundle: org.apache.felix.dependencymanager.samples.compositefactory - ProviderParticipant2.start()
2016.02.08 22:26:05 WARNING - Bundle: org.apache.felix.dependencymanager.samples.compositefactory - ProviderParticipant1.start()
2016.02.08 22:26:05 WARNING - Bundle: org.apache.felix.dependencymanager.samples.compositefactory - ProviderImpl.start(): participants=ProviderParticipant1,ProviderParticipant2