2 * Copyright (c) 2014 Cisco Systems, 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.controller.sal.rest.impl;
10 import java.util.HashSet;
13 import javax.ws.rs.core.Application;
15 import org.opendaylight.controller.sal.restconf.impl.BrokerFacade;
16 import org.opendaylight.controller.sal.restconf.impl.ControllerContext;
17 import org.opendaylight.controller.sal.restconf.impl.RestconfImpl;
19 public class RestconfApplication extends Application {
22 public Set<Object> getSingletons() {
23 Set<Object> singletons = new HashSet<>();
24 ControllerContext controllerContext = ControllerContext.getInstance();
25 BrokerFacade brokerFacade = BrokerFacade.getInstance();
26 RestconfImpl restconfImpl = RestconfImpl.getInstance();
27 restconfImpl.setBroker(brokerFacade);
28 restconfImpl.setControllerContext(controllerContext);
29 singletons.add(controllerContext);
30 singletons.add(brokerFacade);
31 singletons.add(restconfImpl);
32 singletons.add(XmlToCompositeNodeProvider.INSTANCE);
33 singletons.add(StructuredDataToXmlProvider.INSTANCE);
34 singletons.add(JsonToCompositeNodeProvider.INSTANCE);
35 singletons.add(StructuredDataToJsonProvider.INSTANCE);