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.northbound.bundlescanner.internal;
11 import org.apache.felix.dm.Component;
12 import org.opendaylight.controller.northbound.bundlescanner.IBundleScanService;
13 import org.opendaylight.controller.sal.core.ComponentActivatorAbstractBase;
14 import org.osgi.framework.BundleContext;
15 import org.osgi.framework.FrameworkUtil;
18 * The activator registers the BundleScanner.
20 public class Activator extends ComponentActivatorAbstractBase {
23 protected void init() {
24 BundleContext context = FrameworkUtil.getBundle(BundleScanner.class).getBundleContext();
25 context.addBundleListener(BundleScanner.getInstance());
29 public void destroy() {
30 BundleContext context = FrameworkUtil.getBundle(BundleScanner.class).getBundleContext();
31 context.removeBundleListener(BundleScanner.getInstance());
35 protected Object[] getGlobalImplementations() {
36 return new Object[] { BundleScanServiceImpl.class };
40 protected void configureGlobalInstance(Component c, Object imp) {
41 if (!imp.equals(BundleScanServiceImpl.class)) return;
44 new String[] { IBundleScanService.class.getName() },