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
11 * Generated from: yang module name: config-pcep-topology-provider yang module local name: pcep-topology-stateful07
12 * Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
13 * Generated at: Mon Jan 27 11:08:05 CET 2014
15 * Do not modify this file unless it is present under src/main directory
17 package org.opendaylight.controller.config.yang.pcep.topology.provider;
19 import com.google.common.reflect.AbstractInvocationHandler;
20 import com.google.common.reflect.Reflection;
21 import java.lang.reflect.Method;
22 import org.opendaylight.bgpcep.pcep.topology.provider.TopologySessionListenerFactory;
23 import org.opendaylight.controller.config.api.osgi.WaitingServiceTracker;
24 import org.osgi.framework.BundleContext;
27 * @deprecated Replaced by blueprint wiring
29 public final class Stateful07TopologySessionListenerModule extends
30 org.opendaylight.controller.config.yang.pcep.topology.provider.AbstractStateful07TopologySessionListenerModule {
31 private BundleContext bundleContext;
33 public Stateful07TopologySessionListenerModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier,
34 final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
35 super(identifier, dependencyResolver);
38 public Stateful07TopologySessionListenerModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier,
39 final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver,
40 final Stateful07TopologySessionListenerModule oldModule, final java.lang.AutoCloseable oldInstance) {
41 super(identifier, dependencyResolver, oldModule, oldInstance);
45 protected void customValidation() {
46 // Add custom validation for module attributes here.
50 public java.lang.AutoCloseable createInstance() {
51 final WaitingServiceTracker<TopologySessionListenerFactory> tracker = WaitingServiceTracker
52 .create(TopologySessionListenerFactory.class, this.bundleContext);
53 final TopologySessionListenerFactory service = tracker.waitForService(WaitingServiceTracker.FIVE_MINUTES);
55 return Reflection.newProxy(AutoCloseableService.class, new AbstractInvocationHandler() {
57 protected Object handleInvocation(final Object proxy, final Method method, final Object[] args) throws Throwable {
58 if (method.getName().equals("close")) {
62 return method.invoke(service, args);
68 void setBundleContext(final BundleContext bundleContext) {
69 this.bundleContext = bundleContext;
72 private interface AutoCloseableService extends TopologySessionListenerFactory, AutoCloseable {