1 package org.opendaylight.controller.sal.connector.remoterpc;
3 import org.opendaylight.controller.sal.connector.remoterpc.api.RoutingTable;
4 import org.osgi.framework.BundleContext;
5 import org.osgi.util.tracker.ServiceTracker;
7 import com.google.common.base.Optional;
9 public class RoutingTableProvider implements AutoCloseable {
11 @SuppressWarnings("rawtypes")
12 final ServiceTracker<RoutingTable,RoutingTable> tracker;
15 public RoutingTableProvider(BundleContext ctx) {
16 @SuppressWarnings("rawtypes")
17 ServiceTracker<RoutingTable, RoutingTable> rawTracker = new ServiceTracker<>(ctx, RoutingTable.class, null);
22 public Optional<RoutingTable<String, String>> getRoutingTable() {
23 @SuppressWarnings("unchecked")
24 RoutingTable<String,String> tracked = tracker.getService();
25 return Optional.fromNullable(tracked);
29 public void close() throws Exception {