X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=restconf%2Frestconf-nb-rfc8040%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Frestconf%2Fnb%2Frfc8040%2FRestConnectorProvider.java;h=6b21b7c9adfe081922d705fd77a38252f6ccddd2;hb=c4aa5392a3c307e87fb334520cd5692406a89ee2;hp=e13a2f691ed2a04769715eacf8144168cf451431;hpb=b121b01510163f7182432c2de8341702ec960b8b;p=netconf.git diff --git a/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/RestConnectorProvider.java b/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/RestConnectorProvider.java index e13a2f691e..6b21b7c9ad 100644 --- a/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/RestConnectorProvider.java +++ b/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/RestConnectorProvider.java @@ -9,9 +9,7 @@ package org.opendaylight.restconf.nb.rfc8040; import com.google.common.base.Preconditions; -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker; -import org.opendaylight.controller.md.sal.dom.api.DOMMountPointService; import org.opendaylight.controller.md.sal.dom.api.DOMNotificationService; import org.opendaylight.controller.md.sal.dom.api.DOMRpcService; import org.opendaylight.mdsal.dom.api.DOMSchemaService; @@ -33,35 +31,31 @@ public class RestConnectorProvider implements Restconf private static final Logger LOG = LoggerFactory.getLogger(RestConnectorProvider.class); - @SuppressFBWarnings("ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD") - private static volatile DOMMountPointServiceHandler mountPointServiceHandler; - private final DOMRpcService rpcService; private final DOMNotificationService notificationService; - private final DOMMountPointService mountPointService; private final DOMSchemaService domSchemaService; private final TransactionChainHandler transactionChainHandler; private final DOMDataBroker dataBroker; private final SchemaContextHandler schemaCtxHandler; + private final DOMMountPointServiceHandler mountPointServiceHandler; private final T wrapperServices; public RestConnectorProvider(final DOMDataBroker domDataBroker, final DOMSchemaService domSchemaService, final DOMRpcService rpcService, final DOMNotificationService notificationService, - final DOMMountPointService mountPointService, final TransactionChainHandler transactionChainHandler, - final SchemaContextHandler schemaCtxHandler, final T wrapperServices) { + final TransactionChainHandler transactionChainHandler, + final SchemaContextHandler schemaCtxHandler, final DOMMountPointServiceHandler mountPointServiceHandler, + final T wrapperServices) { this.wrapperServices = wrapperServices; this.domSchemaService = Preconditions.checkNotNull(domSchemaService); this.rpcService = Preconditions.checkNotNull(rpcService); this.notificationService = Preconditions.checkNotNull(notificationService); - this.mountPointService = Preconditions.checkNotNull(mountPointService); this.transactionChainHandler = Preconditions.checkNotNull(transactionChainHandler); this.dataBroker = Preconditions.checkNotNull(domDataBroker); this.schemaCtxHandler = Preconditions.checkNotNull(schemaCtxHandler); + this.mountPointServiceHandler = Preconditions.checkNotNull(mountPointServiceHandler); } public synchronized void start() { - mountPointServiceHandler = new DOMMountPointServiceHandler(mountPointService); - final DOMDataBrokerHandler brokerHandler = new DOMDataBrokerHandler(dataBroker); final RpcServiceHandler rpcServiceHandler = new RpcServiceHandler(rpcService); @@ -70,26 +64,13 @@ public class RestConnectorProvider implements Restconf new NotificationServiceHandler(notificationService); if (wrapperServices != null) { - wrapperServices.setHandlers(this.schemaCtxHandler, RestConnectorProvider.mountPointServiceHandler, + wrapperServices.setHandlers(this.schemaCtxHandler, mountPointServiceHandler, transactionChainHandler, brokerHandler, rpcServiceHandler, notificationServiceHandler, domSchemaService); } } - public DOMMountPointServiceHandler getMountPointServiceHandler() { - return mountPointServiceHandler; - } - - /** - * Get current {@link DOMMountPointService} from {@link DOMMountPointServiceHandler}. - * @return {@link DOMMountPointService} - */ - public static DOMMountPointService getMountPointService() { - return mountPointServiceHandler.get(); - } - @Override public void close() { - mountPointServiceHandler = null; } }