2 * Copyright (c) 2015 Cisco Systems, Inc. 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.config.groupbasedpolicy;
11 import org.opendaylight.controller.config.api.osgi.WaitingServiceTracker;
12 import org.opendaylight.groupbasedpolicy.api.EpRendererAugmentation;
13 import org.opendaylight.groupbasedpolicy.api.EpRendererAugmentationRegistry;
14 import org.osgi.framework.BundleContext;
15 import org.slf4j.Logger;
16 import org.slf4j.LoggerFactory;
18 public class EpRendererAugmentationRegistryImplModule extends org.opendaylight.controller.config.yang.config.groupbasedpolicy.AbstractEpRendererAugmentationRegistryImplModule {
20 private static final Logger LOG = LoggerFactory.getLogger(EpRendererAugmentationRegistryImplModule.class);
21 private BundleContext bundleContext;
23 public EpRendererAugmentationRegistryImplModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
24 super(identifier, dependencyResolver);
27 public EpRendererAugmentationRegistryImplModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.controller.config.yang.config.groupbasedpolicy.EpRendererAugmentationRegistryImplModule oldModule, java.lang.AutoCloseable oldInstance) {
28 super(identifier, dependencyResolver, oldModule, oldInstance);
32 public void customValidation() {
33 // add custom validation form module attributes here.
37 public java.lang.AutoCloseable createInstance() {
38 final WaitingServiceTracker<EpRendererAugmentationRegistry> tracker = WaitingServiceTracker.create(
39 EpRendererAugmentationRegistry.class, bundleContext);
40 final EpRendererAugmentationRegistry service = tracker.waitForService(WaitingServiceTracker.FIVE_MINUTES);
42 final class Instance implements EpRendererAugmentationRegistry, AutoCloseable {
49 public void register(EpRendererAugmentation epRendererAugmentation) {
50 service.register(epRendererAugmentation);
54 public void unregister(EpRendererAugmentation epRendererAugmentation) {
55 service.unregister(epRendererAugmentation);
59 return new Instance();
62 void setBundleContext(BundleContext bundleContext) {
63 this.bundleContext = bundleContext;