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.slf4j.Logger;
17 import org.slf4j.LoggerFactory;
19 public class Activator extends ComponentActivatorAbstractBase {
20 protected static final Logger logger = LoggerFactory
21 .getLogger(Activator.class);
24 * Function called when the activator starts just after some
25 * initializations are done by the
26 * ComponentActivatorAbstractBase.
33 * Function called when the activator stops just before the
34 * cleanup done by ComponentActivatorAbstractBase
37 public void destroy() {
41 * Function that is used to communicate to dependency manager the
42 * list of known implementations for services inside a container
45 * @return An array containing all the CLASS objects that will be
46 * instantiated in order to get an fully working implementation
49 public Object[] getImplementations() {
50 Object[] res = { StatisticsManager.class };
55 * Function that is called when configuration of the dependencies
58 * @param c dependency manager Component object, used for
59 * configuring the dependencies exported and imported
60 * @param imp Implementation class that is being configured,
61 * needed as long as the same routine can configure multiple
63 * @param containerName The containerName being configured, this allow
64 * also optional per-container different behavior if needed, usually
65 * should not be the case though.
67 public void configureInstance(Component c, Object imp, String containerName) {
68 if (imp.equals(StatisticsManager.class)) {
70 c.setInterface(new String[] { IStatisticsManager.class.getName() },
73 c.add(createContainerServiceDependency(containerName).setService(
74 IReadService.class).setCallbacks("setReaderService",
75 "unsetReaderService").setRequired(false));