Merge "BUG-2182 : included data-change-counter in feature file"
[bgpcep.git] / bgp / rib-impl / src / main / java / org / opendaylight / protocol / bgp / rib / impl / BGPPeer.java
index 4004b4d53313422845ad188f6df60c44d019bf0b..a605c773eb8e7682548422b08167d68b6fc07e36 100644 (file)
@@ -184,24 +184,24 @@ public class BGPPeer implements ReusableBGPPeer, Peer, AutoCloseable, BGPPeerRun
     @Override
     public void resetStats() {
         if (this.session instanceof BGPSessionStatistics) {
-            ((BGPSessionStatistics) session).resetSessionStats();
+            ((BGPSessionStatistics) this.session).resetSessionStats();
         }
     }
 
-    public void registerRootRuntimeBean(final BGPPeerRuntimeRegistrator registrator) {
+    public synchronized void registerRootRuntimeBean(final BGPPeerRuntimeRegistrator registrator) {
         this.registrator = registrator;
     }
 
     @Override
     public BgpSessionState getBgpSessionState() {
         if (this.session instanceof BGPSessionStatistics) {
-            return ((BGPSessionStatistics) session).getBgpSesionState();
+            return ((BGPSessionStatistics) this.session).getBgpSesionState();
         }
         return new BgpSessionState();
     }
 
     @Override
-    public BgpPeerState getBgpPeerState() {
+    public synchronized BgpPeerState getBgpPeerState() {
         final BgpPeerState peerState = new BgpPeerState();
         final List<RouteTable> routes = Lists.newArrayList();
         for (final TablesKey tablesKey : this.tables) {