2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
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
9 package org.opendaylight.controller.sal.connection.implementation.internal;
11 import org.apache.felix.dm.Component;
12 import org.opendaylight.controller.sal.connection.IConnectionListener;
13 import org.opendaylight.controller.sal.connection.IConnectionService;
14 import org.opendaylight.controller.sal.connection.IPluginInConnectionService;
15 import org.opendaylight.controller.sal.connection.IPluginOutConnectionService;
16 import org.opendaylight.controller.sal.core.ComponentActivatorAbstractBase;
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 that is used to communicate to dependency manager the list of
26 * known Global implementations
29 * @return An array containing all the CLASS objects that will be
30 * instantiated in order to get an fully working implementation
33 public Object[] getGlobalImplementations() {
34 Object[] res = { ConnectionService.class};
39 * Function that is called when configuration of the dependencies is required.
42 * dependency manager Component object, used for configuring the
43 * dependencies exported and imported
45 * Implementation class that is being configured, needed as long
46 * as the same routine can configure multiple implementations
48 public void configureGlobalInstance(Component c, Object imp) {
49 if (imp.equals(ConnectionService.class)) {
51 new String[] { IConnectionService.class.getName(),
52 IPluginOutConnectionService.class.getName() },
55 c.add(createServiceDependency()
56 .setService(IPluginInConnectionService.class)
57 .setCallbacks("setPluginService", "unsetPluginService")
59 c.add(createServiceDependency()
60 .setService(IConnectionListener.class)
61 .setCallbacks("setListener", "unsetListener")