Bulk-add copyright headers to java files
[controller.git] / opendaylight / sal / networkconfiguration / implementation / src / main / java / org / opendaylight / controller / sal / networkconfig / internal / Activator.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.controller.sal.networkconfig.internal;
9
10 import org.apache.felix.dm.Component;
11 import org.opendaylight.controller.sal.core.ComponentActivatorAbstractBase;
12 import org.opendaylight.controller.sal.networkconfig.bridgedomain.IBridgeDomainConfigService;
13 import org.opendaylight.controller.sal.networkconfig.bridgedomain.IPluginInBridgeDomainConfigService;
14 import org.opendaylight.controller.sal.networkconfig.bridgedomain.internal.BridgeDomainConfigService;
15 import org.slf4j.Logger;
16 import org.slf4j.LoggerFactory;
17
18 public class Activator extends ComponentActivatorAbstractBase {
19     protected static final Logger logger = LoggerFactory
20             .getLogger(Activator.class);
21
22
23     /**
24      * Function that is used to communicate to dependency manager the list of
25      * known Global implementations
26      *
27      *
28      * @return An array containing all the CLASS objects that will be
29      *         instantiated in order to get an fully working implementation
30      *         Object
31      */
32     public Object[] getGlobalImplementations() {
33         Object[] res = { BridgeDomainConfigService.class};
34         return res;
35     }
36
37     /**
38      * Function that is called when configuration of the dependencies is required.
39      *
40      * @param c
41      *            dependency manager Component object, used for configuring the
42      *            dependencies exported and imported
43      * @param imp
44      *            Implementation class that is being configured, needed as long
45      *            as the same routine can configure multiple implementations
46      */
47     public void configureGlobalInstance(Component c, Object imp) {
48         if (imp.equals(BridgeDomainConfigService.class)) {
49             c.setInterface(
50                     new String[] { IBridgeDomainConfigService.class.getName()},
51                                    null);
52
53             c.add(createServiceDependency()
54                     .setService(IPluginInBridgeDomainConfigService.class)
55                     .setCallbacks("setPluginInService", "unsetPluginInService")
56                     .setRequired(false));
57         }
58     }
59 }