2 * Copyright (c) 2013 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
12 * Generated from: yang module name: nsos-threadpool yang module local name: netty-threadgroup-fixed
13 * Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
14 * Generated at: Fri Nov 08 08:31:45 CET 2013
16 * Do not modify this file unless it is present under src/main directory
18 package org.opendaylight.controller.config.yang.netty.threadgroup;
20 import io.netty.channel.nio.NioEventLoopGroup;
22 import org.opendaylight.controller.config.api.JmxAttributeValidationException;
24 import java.util.concurrent.TimeUnit;
29 public final class NettyThreadgroupModule extends org.opendaylight.controller.config.yang.netty.threadgroup.AbstractNettyThreadgroupModule
31 public NettyThreadgroupModule(org.opendaylight.controller.config.api.ModuleIdentifier name, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
32 super(name, dependencyResolver);
35 public NettyThreadgroupModule(org.opendaylight.controller.config.api.ModuleIdentifier name, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, NettyThreadgroupModule oldModule, java.lang.AutoCloseable oldInstance) {
36 super(name, dependencyResolver, oldModule, oldInstance);
40 public void validate(){
41 if(getThreadCount()!=null) {
42 JmxAttributeValidationException.checkCondition(getThreadCount() > 0, "value must be greater than 0",
43 threadCountJmxAttribute);
48 public java.lang.AutoCloseable createInstance() {
49 return getThreadCount()==null ? new NioEventLoopGroupCloseable() : new NioEventLoopGroupCloseable(getThreadCount());
53 private class NioEventLoopGroupCloseable extends NioEventLoopGroup implements AutoCloseable {
56 public NioEventLoopGroupCloseable(int threadCount) {
60 public NioEventLoopGroupCloseable() {
65 public void close() throws Exception {
66 shutdownGracefully(0, 1, TimeUnit.SECONDS);