BUG-7958: Fix IllegalArgumentException
[bgpcep.git] / bgp / rib-impl / src / main / java / org / opendaylight / protocol / bgp / rib / impl / config / BgpDeployerImpl.java
index 8b536b0f0f78cce8d2232c26399b7c1670fc9110..6d5fe5e4098de5ffc4c7a5cf9ca2b9fbe8e08b6a 100644 (file)
@@ -329,14 +329,6 @@ public final class BgpDeployerImpl implements BgpDeployer, ClusteredDataTreeChan
         bgpPeer.setServiceRegistration(serviceRegistration);
     }
 
-    private synchronized void registerAppPeerInstance(final AppPeer appPeer, final String peerInstanceName) {
-        final Dictionary<String, String> properties = new Hashtable<>();
-        properties.put(InstanceType.PEER.getBeanName(), peerInstanceName);
-        final ServiceRegistration<?> serviceRegistration = this.bundleContext
-            .registerService(InstanceType.APP_PEER.getServices(), appPeer, properties);
-        appPeer.setServiceRegistration(serviceRegistration);
-    }
-
     private synchronized void initiatePeerInstance(final InstanceIdentifier<Bgp> rootIdentifier,
         final InstanceIdentifier<Neighbor> neighborIdentifier, final Neighbor neighbor,
         final PeerBean bgpPeer, final WriteConfiguration configurationWriter) {
@@ -346,8 +338,6 @@ public final class BgpDeployerImpl implements BgpDeployer, ClusteredDataTreeChan
             bgpPeer.start(rib, neighbor, this.mappingService, configurationWriter);
             if (bgpPeer instanceof BgpPeer) {
                 registerPeerInstance((BgpPeer) bgpPeer, peerInstanceName);
-            } else if(bgpPeer instanceof AppPeer) {
-                registerAppPeerInstance((AppPeer) bgpPeer, peerInstanceName);
             }
         }
     }