476b2029215f42cc1d45517cac1ca207986a5155
[controller.git] / opendaylight / config / netty-event-executor-config / src / main / java / org / opendaylight / controller / config / yang / netty / eventexecutor / GlobalEventExecutorModule.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8
9 /**
10  * Generated file
11
12  * Generated from: yang module name: netty-event-executor  yang module local name: netty-global-event-executor
13  * Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
14  * Generated at: Tue Nov 12 10:44:21 CET 2013
15  *
16  * Do not modify this file unless it is present under src/main directory
17  */
18 package org.opendaylight.controller.config.yang.netty.eventexecutor;
19
20 import io.netty.util.concurrent.EventExecutor;
21 import org.opendaylight.controller.config.api.osgi.WaitingServiceTracker;
22 import org.opendaylight.controller.config.yang.netty.eventexecutor.AutoCloseableEventExecutor.CloseableEventExecutorMixin;
23 import org.osgi.framework.BundleContext;
24
25 /**
26  * @deprecated Replaced by blueprint wiring
27  */
28 @Deprecated
29 public final class GlobalEventExecutorModule extends
30         org.opendaylight.controller.config.yang.netty.eventexecutor.AbstractGlobalEventExecutorModule {
31     private BundleContext bundleContext;
32
33     public GlobalEventExecutorModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,
34             org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
35         super(identifier, dependencyResolver);
36     }
37
38     public GlobalEventExecutorModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,
39             org.opendaylight.controller.config.api.DependencyResolver dependencyResolver,
40             GlobalEventExecutorModule oldModule, java.lang.AutoCloseable oldInstance) {
41         super(identifier, dependencyResolver, oldModule, oldInstance);
42     }
43
44     @Override
45     public void validate() {
46         super.validate();
47     }
48
49     @Override
50     public AutoCloseable createInstance() {
51         // The service is provided via blueprint so wait for and return it here for backwards compatibility.
52         final WaitingServiceTracker<EventExecutor> tracker = WaitingServiceTracker.create(
53                 EventExecutor.class, bundleContext, "(type=global-event-executor)");
54         EventExecutor eventExecutor = tracker.waitForService(WaitingServiceTracker.FIVE_MINUTES);
55         return CloseableEventExecutorMixin.forwardingEventExecutor(eventExecutor, tracker);
56     }
57
58     public void setBundleContext(final BundleContext bundleContext) {
59         this.bundleContext = bundleContext;
60     }
61 }