X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=openflowplugin-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fopenflowplugin%2Fimpl%2Frpc%2FRpcContextImpl.java;h=2911a89b161f2a31e9f328b8424216d5cf12000f;hb=93fa4f844b0712c35a01f16ec321693557496202;hp=19d4ef6e1ebdd2a067d40675ebfdf5ddb9391642;hpb=41fb1f54b2c2c9e582ec2752f9eabd5081db2d9e;p=openflowplugin.git diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/rpc/RpcContextImpl.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/rpc/RpcContextImpl.java index 19d4ef6e1e..2911a89b16 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/rpc/RpcContextImpl.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/rpc/RpcContextImpl.java @@ -57,7 +57,8 @@ class RpcContextImpl implements RpcContext { private final ExtensionConverterProvider extensionConverterProvider; private final ConvertorExecutor convertorExecutor; private final NotificationPublishService notificationPublishService; - private ContextChainMastershipWatcher contextChainMastershipWatcher; + + private ContextChainMastershipWatcher contextChainMastershipWatcher = null; RpcContextImpl(@NonNull final RpcProviderService rpcProviderRegistry, final int maxRequests, @@ -67,15 +68,15 @@ class RpcContextImpl implements RpcContext { @NonNull final NotificationPublishService notificationPublishService, final boolean statisticsRpcEnabled) { this.deviceContext = deviceContext; - this.deviceInfo = deviceContext.getDeviceInfo(); - this.nodeInstanceIdentifier = deviceContext.getDeviceInfo().getNodeInstanceIdentifier(); - this.messageSpy = deviceContext.getMessageSpy(); + deviceInfo = deviceContext.getDeviceInfo(); + nodeInstanceIdentifier = deviceContext.getDeviceInfo().getNodeInstanceIdentifier(); + messageSpy = deviceContext.getMessageSpy(); this.rpcProviderRegistry = rpcProviderRegistry; this.extensionConverterProvider = extensionConverterProvider; this.notificationPublishService = notificationPublishService; this.convertorExecutor = convertorExecutor; - this.isStatisticsRpcEnabled = statisticsRpcEnabled; - this.tracker = new Semaphore(maxRequests, true); + isStatisticsRpcEnabled = statisticsRpcEnabled; + tracker = new Semaphore(maxRequests, true); } @Override @@ -129,7 +130,7 @@ class RpcContextImpl implements RpcContext { nodeInstanceIdentifier.getKey().getId().getValue(), tracker.availablePermits()); } - final Long xid = deviceInfo.reserveXidForDeviceMessage(); + final Uint32 xid = deviceInfo.reserveXidForDeviceMessage(); if (xid == null) { LOG.warn("Xid cannot be reserved for new RequestContext, node:{}", nodeInstanceIdentifier.getKey().getId().getValue()); @@ -137,7 +138,7 @@ class RpcContextImpl implements RpcContext { return null; } - return new AbstractRequestContext<>(Uint32.valueOf(xid)) { + return new AbstractRequestContext<>(xid) { @Override public void close() { tracker.release(); @@ -161,17 +162,17 @@ class RpcContextImpl implements RpcContext { @VisibleForTesting boolean isEmptyRpcRegistrations() { - return this.rpcRegistrations.isEmpty(); + return rpcRegistrations.isEmpty(); } @Override public DeviceInfo getDeviceInfo() { - return this.deviceInfo; + return deviceInfo; } @Override public void registerMastershipWatcher(@NonNull final ContextChainMastershipWatcher newWatcher) { - this.contextChainMastershipWatcher = newWatcher; + contextChainMastershipWatcher = newWatcher; } @Override