Added config SI for io.netty.util.Timer and config module wrapper for HashedWheelTime...
[controller.git] / opendaylight / config / netty-threadgroup-config / src / main / java / org / opendaylight / controller / config / yang / netty / threadgroup / NettyThreadgroupModule.java
1 /**
2 * Generated file
3
4 * Generated from: yang module name: nsos-threadpool  yang module local name: netty-threadgroup-fixed
5 * Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
6 * Generated at: Fri Nov 08 08:31:45 CET 2013
7 *
8 * Do not modify this file unless it is present under src/main directory
9 */
10 package org.opendaylight.controller.config.yang.netty.threadgroup;
11
12 import io.netty.channel.nio.NioEventLoopGroup;
13
14 import org.opendaylight.controller.config.api.JmxAttributeValidationException;
15
16 /**
17 *
18 */
19 public final class NettyThreadgroupModule extends org.opendaylight.controller.config.yang.netty.threadgroup.AbstractNettyThreadgroupModule
20 {
21     public NettyThreadgroupModule(org.opendaylight.controller.config.api.ModuleIdentifier name, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
22         super(name, dependencyResolver);
23     }
24
25     public NettyThreadgroupModule(org.opendaylight.controller.config.api.ModuleIdentifier name, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, NettyThreadgroupModule oldModule, java.lang.AutoCloseable oldInstance) {
26         super(name, dependencyResolver, oldModule, oldInstance);
27     }
28
29     @Override
30     public void validate(){
31         if(getThreadCount()!=null) {
32             JmxAttributeValidationException.checkCondition(getThreadCount() > 0, "value must be greater than 0",
33                     threadCountJmxAttribute);
34         }
35     }
36
37     @Override
38     public java.lang.AutoCloseable createInstance() {
39         return getThreadCount()==null ? new NioEventLoopGroupCloseable() : new NioEventLoopGroupCloseable(getThreadCount());
40     }
41
42
43     private class NioEventLoopGroupCloseable extends NioEventLoopGroup implements AutoCloseable {
44
45
46         public NioEventLoopGroupCloseable(int threadCount) {
47             super(threadCount);
48         }
49
50         public NioEventLoopGroupCloseable() {
51             super();
52         }
53
54         @Override
55         public void close() throws Exception {
56             shutdownGracefully();
57         }
58     }
59 }