95e11b90beffb11b9bbb102735bc0f5eaeb1984b
[controller.git] / opendaylight / config / threadpool-config-impl / src / main / java / org / opendaylight / controller / config / yang / threadpool / impl / fixed / FixedThreadPoolModule.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: threadpool-impl-fixed  yang module local name: threadpool-fixed
13 * Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
14 * Generated at: Sun Dec 01 17:13:32 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.threadpool.impl.fixed;
19
20 import org.opendaylight.controller.config.api.JmxAttributeValidationException;
21 import org.opendaylight.controller.config.threadpool.util.FixedThreadPoolWrapper;
22
23 /**
24  * To be removed in Nitrogen
25  */
26 @Deprecated
27 public final class FixedThreadPoolModule extends org.opendaylight.controller.config.yang.threadpool.impl.fixed.AbstractFixedThreadPoolModule
28 {
29
30     public FixedThreadPoolModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
31         super(identifier, dependencyResolver);
32     }
33
34     public FixedThreadPoolModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, FixedThreadPoolModule oldModule, java.lang.AutoCloseable oldInstance) {
35         super(identifier, dependencyResolver, oldModule, oldInstance);
36     }
37
38     @Override
39     public void validate(){
40         super.validate();
41
42         JmxAttributeValidationException.checkNotNull(getMaxThreadCount(), maxThreadCountJmxAttribute);
43         JmxAttributeValidationException.checkCondition(getMaxThreadCount() > 0, "must be greater than zero",
44                 maxThreadCountJmxAttribute);
45     }
46
47     @Override
48     public java.lang.AutoCloseable createInstance() {
49         return new FixedThreadPoolWrapper(getMaxThreadCount(), getThreadFactoryDependency());
50     }
51 }