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.protocol_plugin.openflow.internal;
11 import java.util.Arrays;
12 import java.util.List;
13 import java.util.ArrayList;
15 import org.apache.felix.dm.Component;
16 import org.opendaylight.controller.protocol_plugin.openflow.core.internal.EnhancedController;
17 import org.opendaylight.controller.protocol_plugin.openflow.core.internal.Controller;
18 import org.slf4j.Logger;
19 import org.slf4j.LoggerFactory;
22 * Openflow protocol plugin Activator
26 public class EnhancedActivator extends Activator {
27 protected static final Logger logger = LoggerFactory
28 .getLogger(EnhancedActivator.class);
30 // Default Constructor for the activator
31 public EnhancedActivator() {
33 logger.debug("Enhanced activator called!");
37 * Function that is used to communicate to dependency manager the list of
38 * known implementations for services that are container independent.
41 * @return An array containing all the CLASS objects that will be
42 * instantiated in order to get an fully working implementation
46 public Object[] getGlobalImplementations() {
47 Object[] res = super.getGlobalImplementations();
48 // Now remove the Controller.class and return the
50 List resList = new ArrayList(Arrays.asList(res));
51 resList.remove(Controller.class);
52 resList.add(EnhancedController.class);
53 return resList.toArray();
57 * Function that is called when configuration of the dependencies is
61 * dependency manager Component object, used for configuring the
62 * dependencies exported and imported
64 * Implementation class that is being configured, needed as long
65 * as the same routine can configure multiple implementations
68 public void configureGlobalInstance(Component c, Object imp) {
69 if (imp.equals(EnhancedController.class)) {
70 // Configure it like if was the Controller.class
71 super.configureGlobalInstance(c, Controller.class);
73 super.configureGlobalInstance(c, imp);