public final class UtilityElf extends Object
Modifier and Type | Class and Description |
---|---|
static class |
UtilityElf.DefaultThreadFactory |
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 String |
getNullIfEmpty(String text) |
static int |
getTransactionIsolation(String transactionIsolationName)
Get the int value of a transaction isolation level by name.
|
static void |
quietlySleep(long millis)
Sleep and transform an InterruptedException into a RuntimeException.
|
public static String getNullIfEmpty(String text)
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 policypublic static int getTransactionIsolation(String transactionIsolationName)
transactionIsolationName
- the name of the transaction isolation levelCopyright © 2016 Zaxxer.com. All Rights Reserved.