+ final DOMMountPointServiceHandler domMountPointServiceHandler = new DOMMountPointServiceHandler(
+ session.getService(DOMMountPointService.class));
+
+ RestConnectorProvider.dataBroker = session.getService(DOMDataBroker.class);
+ final DOMDataBrokerHandler brokerHandler = new DOMDataBrokerHandler(RestConnectorProvider.dataBroker);
+
+ RestConnectorProvider.transactionChainHandler = new TransactionChainHandler(RestConnectorProvider.dataBroker
+ .createTransactionChain(RestConnectorProvider.transactionListener));
+
+ final DOMRpcService rpcService = session.getService(DOMRpcService.class);
+ final RpcServiceHandler rpcServiceHandler = new RpcServiceHandler(rpcService);
+
+ wrapperServices.setHandlers(schemaCtxHandler, domMountPointServiceHandler,
+ RestConnectorProvider.transactionChainHandler, brokerHandler, rpcServiceHandler);
+ }
+
+ /**
+ * After {@link TransactionChain} failed, this updates {@link TransactionChainHandler} with new transaction chain.
+ *
+ * @param chain
+ * - old {@link TransactionChain}
+ */
+ public static void resetTransactionChainForAdapaters(final TransactionChain<?, ?> chain) {
+ LOG.trace("Resetting TransactionChain({})", chain);
+ chain.close();
+ RestConnectorProvider.transactionChainHandler.update(
+ Preconditions.checkNotNull(RestConnectorProvider.dataBroker).createTransactionChain(
+ RestConnectorProvider.transactionListener)
+ );