2 * Copyright (c) 2015 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
9 package org.opendaylight.controller.config.yang.md.sal.rest.connector;
11 import org.opendaylight.controller.config.api.osgi.WaitingServiceTracker;
12 import org.opendaylight.netconf.sal.rest.api.RestConnector;
13 import org.osgi.framework.BundleContext;
16 public class RestConnectorModule
17 extends org.opendaylight.controller.config.yang.md.sal.rest.connector.AbstractRestConnectorModule {
19 private BundleContext bundleContext;
21 public RestConnectorModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier,
22 final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
23 super(identifier, dependencyResolver);
26 public RestConnectorModule(
27 final org.opendaylight.controller.config.api.ModuleIdentifier identifier,
28 final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver,
29 final org.opendaylight.controller.config.yang.md.sal.rest.connector.RestConnectorModule oldModule,
30 final java.lang.AutoCloseable oldInstance) {
31 super(identifier, dependencyResolver, oldModule, oldInstance);
35 public void customValidation() {
36 // add custom validation form module attributes here.
40 public java.lang.AutoCloseable createInstance() {
41 final WaitingServiceTracker<RestConnector> tracker =
42 WaitingServiceTracker.create(RestConnector.class, bundleContext);
43 tracker.waitForService(WaitingServiceTracker.FIVE_MINUTES);
45 final class AutoCloseableRestConnector implements RestConnector, AutoCloseable {
52 return new AutoCloseableRestConnector();
55 public void setBundleContext(final BundleContext bundleContext) {
56 this.bundleContext = bundleContext;