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.netconf.impl.osgi;
10 import org.opendaylight.controller.netconf.mapping.api.NetconfOperationServiceFactory;
11 import org.osgi.framework.BundleContext;
12 import org.osgi.framework.ServiceReference;
13 import org.osgi.util.tracker.ServiceTracker;
15 class NetconfOperationServiceFactoryTracker extends
16 ServiceTracker<NetconfOperationServiceFactory, NetconfOperationServiceFactory> {
17 private final NetconfOperationServiceFactoryListener operationRouter;
19 NetconfOperationServiceFactoryTracker(BundleContext context,
20 final NetconfOperationServiceFactoryListener operationRouter) {
21 super(context, NetconfOperationServiceFactory.class, null);
22 this.operationRouter = operationRouter;
26 public NetconfOperationServiceFactory addingService(ServiceReference<NetconfOperationServiceFactory> reference) {
27 NetconfOperationServiceFactory netconfOperationServiceFactory = super.addingService(reference);
28 operationRouter.onAddNetconfOperationServiceFactory(netconfOperationServiceFactory);
29 return netconfOperationServiceFactory;
33 public void removedService(ServiceReference<NetconfOperationServiceFactory> reference,
34 NetconfOperationServiceFactory netconfOperationServiceFactory) {
35 operationRouter.onRemoveNetconfOperationServiceFactory(netconfOperationServiceFactory);