Merge "Do not force toString() in NetconfClientSession"
[controller.git] / opendaylight / config / netty-threadgroup-config / src / main / java / org / opendaylight / controller / config / yang / netty / threadgroup / NettyThreadgroupModule.java
index fd6b216f53fa50c9cb956710d565140383bbf515..c5b726cd3c6bdc7bbb8a22dac88ab303449106b9 100644 (file)
@@ -1,3 +1,11 @@
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
 /**
 * Generated file
 
@@ -9,8 +17,9 @@
 */
 package org.opendaylight.controller.config.yang.netty.threadgroup;
 
-import com.google.common.base.Preconditions;
 import io.netty.channel.nio.NioEventLoopGroup;
+import java.util.concurrent.TimeUnit;
+import org.opendaylight.controller.config.api.JmxAttributeValidationException;
 
 /**
 *
@@ -28,7 +37,8 @@ public final class NettyThreadgroupModule extends org.opendaylight.controller.co
     @Override
     public void validate(){
         if(getThreadCount()!=null) {
-            Preconditions.checkArgument(getThreadCount() > 0, "Thread count cannot be < 0");
+            JmxAttributeValidationException.checkCondition(getThreadCount() > 0, "value must be greater than 0",
+                    threadCountJmxAttribute);
         }
     }
 
@@ -51,7 +61,7 @@ public final class NettyThreadgroupModule extends org.opendaylight.controller.co
 
         @Override
         public void close() throws Exception {
-            shutdownGracefully();
+            shutdownGracefully(0, 1, TimeUnit.SECONDS);
         }
     }
 }