Prevent ConfigPusher from killing its thread
[controller.git] / opendaylight / sal / networkconfiguration / implementation / src / main / java / org / opendaylight / controller / sal / networkconfig / internal / Activator.java
1 package org.opendaylight.controller.sal.networkconfig.internal;
2
3 import org.apache.felix.dm.Component;
4 import org.opendaylight.controller.sal.core.ComponentActivatorAbstractBase;
5 import org.opendaylight.controller.sal.networkconfig.bridgedomain.IBridgeDomainConfigService;
6 import org.opendaylight.controller.sal.networkconfig.bridgedomain.IPluginInBridgeDomainConfigService;
7 import org.opendaylight.controller.sal.networkconfig.bridgedomain.internal.BridgeDomainConfigService;
8 import org.slf4j.Logger;
9 import org.slf4j.LoggerFactory;
10
11 public class Activator extends ComponentActivatorAbstractBase {
12     protected static final Logger logger = LoggerFactory
13             .getLogger(Activator.class);
14
15
16     /**
17      * Function that is used to communicate to dependency manager the list of
18      * known Global implementations
19      *
20      *
21      * @return An array containing all the CLASS objects that will be
22      *         instantiated in order to get an fully working implementation
23      *         Object
24      */
25     public Object[] getGlobalImplementations() {
26         Object[] res = { BridgeDomainConfigService.class};
27         return res;
28     }
29
30     /**
31      * Function that is called when configuration of the dependencies is required.
32      *
33      * @param c
34      *            dependency manager Component object, used for configuring the
35      *            dependencies exported and imported
36      * @param imp
37      *            Implementation class that is being configured, needed as long
38      *            as the same routine can configure multiple implementations
39      */
40     public void configureGlobalInstance(Component c, Object imp) {
41         if (imp.equals(BridgeDomainConfigService.class)) {
42             c.setInterface(
43                     new String[] { IBridgeDomainConfigService.class.getName()},
44                                    null);
45
46             c.add(createServiceDependency()
47                     .setService(IPluginInBridgeDomainConfigService.class)
48                     .setCallbacks("setPluginInService", "unsetPluginInService")
49                     .setRequired(false));
50         }
51     }
52 }