2 * Copyright (c) 2019 Red Hat, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.restconf.nb.rfc8040;
10 import javax.inject.Inject;
11 import javax.inject.Singleton;
12 import org.apache.aries.blueprint.annotation.service.Reference;
13 import org.opendaylight.mdsal.dom.api.DOMSchemaService;
14 import org.opendaylight.restconf.nb.rfc8040.handlers.DOMDataBrokerHandler;
15 import org.opendaylight.restconf.nb.rfc8040.handlers.DOMMountPointServiceHandler;
16 import org.opendaylight.restconf.nb.rfc8040.handlers.NotificationServiceHandler;
17 import org.opendaylight.restconf.nb.rfc8040.handlers.RpcServiceHandler;
18 import org.opendaylight.restconf.nb.rfc8040.handlers.SchemaContextHandler;
19 import org.opendaylight.restconf.nb.rfc8040.handlers.TransactionChainHandler;
20 import org.opendaylight.restconf.nb.rfc8040.rests.services.impl.JSONRestconfServiceRfc8040Impl;
21 import org.opendaylight.restconf.nb.rfc8040.services.wrapper.ServicesWrapper;
22 import org.opendaylight.restconf.nb.rfc8040.web.WebInitializer;
25 * Standalone wiring for RESTCONF.
27 * <p>This wiring alone is not sufficient; there are a few other singletons which
28 * need to be bound as well, incl. {@link RestconfApplication},
29 * {@link JSONRestconfServiceRfc8040Impl} & {@link WebInitializer}; see the
30 * Rfc8040RestConfWiringTest for how to do this e.g. for Guice (this class can
31 * be used with another DI framework but needs the equivalent).
33 * @author Michael Vorburger.ch
36 public class Rfc8040RestConfWiring {
38 private final ServicesWrapper servicesWrapper;
41 public Rfc8040RestConfWiring(
42 SchemaContextHandler schemaCtxHandler,
43 DOMMountPointServiceHandler domMountPointServiceHandler, TransactionChainHandler transactionChainHandler,
44 DOMDataBrokerHandler domDataBrokerHandler, RpcServiceHandler rpcServiceHandler,
45 NotificationServiceHandler notificationServiceHandler, @Reference DOMSchemaService domSchemaService) {
46 servicesWrapper = ServicesWrapper.newInstance(schemaCtxHandler, domMountPointServiceHandler,
47 transactionChainHandler, domDataBrokerHandler, rpcServiceHandler, notificationServiceHandler,
51 public ServicesWrapper getServicesWrapper() {
52 return servicesWrapper;