1 package com.atlassian.plugin.osgi.hostcomponents;
2
3 /**
4 * Defines an object that provides host components. Host applications that wish to register their internal components
5 * should implement this interface. Classes like the {@link com.atlassian.plugin.osgi.factory.OsgiPluginFactory} use
6 * this interface to retrieve a list of host components to register into the OSGi service registry.
7 * <p>
8 * Here is an example implementation that registers two host components:
9 * <pre>
10 * public class MyHostComponentProvider implements HostComponentProvider {
11 * public void provide(ComponentRegistrar registrar) {
12 * registrar.register(SomeInterface.class).forInstance(someInstance).withName("some-bean");
13 * registrar.register(InterfaceA.class, InterfaceB.class)
14 * .forInstance(MyBean.class)
15 * .withProperty("propertyA", "valueA")
16 * .withProperty("propertyB", "valueB");
17 * }
18 * }
19 * </pre>
20 */
21 public interface HostComponentProvider {
22
23 /**
24 * Gives the object a chance to register its host components with the registrar
25 *
26 * @param registrar The host component registrar
27 */
28 void provide(ComponentRegistrar registrar);
29 }