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 called when the activator starts just after some initializations
26 * are done by the ComponentActivatorAbstractBase.
35 * Function called when the activator stops just before the cleanup done by
36 * ComponentActivatorAbstractBase
40 public void destroy() {
45 * Function that is used to communicate to dependency manager the list of
46 * known Global implementations
49 * @return An array containing all the CLASS objects that will be
50 * instantiated in order to get an fully working implementation
53 public Object[] getGlobalImplementations() {
54 Object[] res = { ConnectionService.class};
59 * Function that is called when configuration of the dependencies is required.
62 * dependency manager Component object, used for configuring the
63 * dependencies exported and imported
65 * Implementation class that is being configured, needed as long
66 * as the same routine can configure multiple implementations
68 public void configureGlobalInstance(Component c, Object imp) {
69 if (imp.equals(ConnectionService.class)) {
71 new String[] { IConnectionService.class.getName(),
72 IPluginOutConnectionService.class.getName() },
75 c.add(createServiceDependency()
76 .setService(IPluginInConnectionService.class)
77 .setCallbacks("setPluginService", "unsetPluginService")
79 c.add(createServiceDependency()
80 .setService(IConnectionListener.class)
81 .setCallbacks("setListener", "unsetListener")