public final class UtilityElf extends Object
| Constructor and Description |
|---|
UtilityElf() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
createInstance(String className,
Class<T> clazz,
Object... args)
Create and instance of the specified class using the constructor matching the specified
arguments.
|
static ThreadPoolExecutor |
createThreadPoolExecutor(int queueSize,
String threadName,
ThreadFactory threadFactory,
RejectedExecutionHandler policy)
Create a ThreadPoolExecutor.
|
static void |
quietlySleep(long millis)
Sleep and transform an InterruptedException into a RuntimeException.
|
public static void quietlySleep(long millis)
millis - the number of milliseconds to sleeppublic static <T> T createInstance(String className, Class<T> clazz, Object... args)
T - the class typeclassName - the name of the class to instantiateclazz - a class to cast the result asargs - arguments to a constructorpublic static ThreadPoolExecutor createThreadPoolExecutor(int queueSize, String threadName, ThreadFactory threadFactory, RejectedExecutionHandler policy)
queueSize - the queue sizethreadName - the thread namethreadFactory - an optional ThreadFactorypolicy - the RejectedExecutionHandler policyCopyright © 2016 Zaxxer.com. All rights reserved.