Merge "1. Corrected Ip Protocol match field. 2. Added mask for Ipv6 Extension header...
[controller.git] / opendaylight / netconf / netconf-impl / src / main / java / org / opendaylight / controller / netconf / impl / osgi / NetconfOperationServiceFactoryTracker.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.controller.netconf.impl.osgi;
9
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;
14
15 class NetconfOperationServiceFactoryTracker extends
16         ServiceTracker<NetconfOperationServiceFactory, NetconfOperationServiceFactory> {
17     private final NetconfOperationServiceFactoryListener factoriesListener;
18
19     NetconfOperationServiceFactoryTracker(BundleContext context,
20             final NetconfOperationServiceFactoryListener factoriesListener) {
21         super(context, NetconfOperationServiceFactory.class, null);
22         this.factoriesListener = factoriesListener;
23     }
24
25     @Override
26     public NetconfOperationServiceFactory addingService(ServiceReference<NetconfOperationServiceFactory> reference) {
27         NetconfOperationServiceFactory netconfOperationServiceFactory = super.addingService(reference);
28         factoriesListener.onAddNetconfOperationServiceFactory(netconfOperationServiceFactory);
29         return netconfOperationServiceFactory;
30     }
31
32     @Override
33     public void removedService(ServiceReference<NetconfOperationServiceFactory> reference,
34             NetconfOperationServiceFactory netconfOperationServiceFactory) {
35         factoriesListener.onRemoveNetconfOperationServiceFactory(netconfOperationServiceFactory);
36     }
37
38 }