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
8 package org.opendaylight.controller.sal.core.api;
10 import java.util.Collection;
11 import java.util.Collections;
13 import org.opendaylight.controller.sal.core.api.Broker.ProviderSession;
14 import org.osgi.framework.BundleActivator;
15 import org.osgi.framework.BundleContext;
16 import org.osgi.framework.ServiceReference;
18 public abstract class AbstractProvider implements BundleActivator, Provider {
20 private ServiceReference<Broker> brokerRef;
21 private Broker broker;
24 public Collection<ProviderFunctionality> getProviderFunctionality() {
25 return Collections.emptySet();
29 public final void start(BundleContext context) throws Exception {
30 brokerRef = context.getServiceReference(Broker.class);
31 broker = context.getService(brokerRef);
33 this.startImpl(context);
35 broker.registerProvider(this,context);
38 protected void startImpl(BundleContext context) {
41 protected void stopImpl(BundleContext context) {
46 public final void stop(BundleContext context) throws Exception {