3 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
5 * This program and the accompanying materials are made available under the
6 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
7 * and is available at http://www.eclipse.org/legal/epl-v10.html
10 package org.opendaylight.controller.statisticsmanager.internal;
12 import org.apache.felix.dm.Component;
13 import org.opendaylight.controller.sal.core.ComponentActivatorAbstractBase;
14 import org.opendaylight.controller.sal.reader.IReadService;
15 import org.opendaylight.controller.statisticsmanager.IStatisticsManager;
16 import org.opendaylight.controller.statisticsmanager.StatisticsManager;
17 import org.slf4j.Logger;
18 import org.slf4j.LoggerFactory;
20 public class Activator extends ComponentActivatorAbstractBase {
21 protected static final Logger logger = LoggerFactory
22 .getLogger(Activator.class);
25 * Function called when the activator starts just after some
26 * initializations are done by the
27 * ComponentActivatorAbstractBase.
34 * Function called when the activator stops just before the
35 * cleanup done by ComponentActivatorAbstractBase
38 public void destroy() {
42 * Function that is used to communicate to dependency manager the
43 * list of known implementations for services inside a container
46 * @return An array containing all the CLASS objects that will be
47 * instantiated in order to get an fully working implementation
50 public Object[] getImplementations() {
51 Object[] res = { StatisticsManager.class };
56 * Function that is called when configuration of the dependencies
59 * @param c dependency manager Component object, used for
60 * configuring the dependencies exported and imported
61 * @param imp Implementation class that is being configured,
62 * needed as long as the same routine can configure multiple
64 * @param containerName The containerName being configured, this allow
65 * also optional per-container different behavior if needed, usually
66 * should not be the case though.
68 public void configureInstance(Component c, Object imp, String containerName) {
69 if (imp.equals(StatisticsManager.class)) {
71 c.setInterface(new String[] { IStatisticsManager.class.getName() },
74 c.add(createContainerServiceDependency(containerName).setService(
75 IReadService.class).setCallbacks("setReaderService",
76 "unsetReaderService").setRequired(false));