NetworkConfiguration -> BridgeDomain Configuration Service
[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      * Function called when the activator starts just after some initializations
17      * are done by the ComponentActivatorAbstractBase.
18      *
19      */
20     @Override
21     public void init() {
22
23     }
24
25     /**
26      * Function called when the activator stops just before the cleanup done by
27      * ComponentActivatorAbstractBase
28      *
29      */
30     @Override
31     public void destroy() {
32
33     }
34
35     /**
36      * Function that is used to communicate to dependency manager the list of
37      * known Global implementations
38      *
39      *
40      * @return An array containing all the CLASS objects that will be
41      *         instantiated in order to get an fully working implementation
42      *         Object
43      */
44     public Object[] getGlobalImplementations() {
45         Object[] res = { BridgeDomainConfigService.class};
46         return res;
47     }
48
49     /**
50      * Function that is called when configuration of the dependencies is required.
51      *
52      * @param c
53      *            dependency manager Component object, used for configuring the
54      *            dependencies exported and imported
55      * @param imp
56      *            Implementation class that is being configured, needed as long
57      *            as the same routine can configure multiple implementations
58      */
59     public void configureGlobalInstance(Component c, Object imp) {
60         if (imp.equals(BridgeDomainConfigService.class)) {
61             c.setInterface(
62                     new String[] { IBridgeDomainConfigService.class.getName()},
63                                    null);
64
65             c.add(createServiceDependency()
66                     .setService(IPluginInBridgeDomainConfigService.class)
67                     .setCallbacks("setPluginInService", "unsetPluginInService")
68                     .setRequired(false));
69         }
70     }
71 }