public final class UtilityElf extends Object
| Modifier and Type | Class | Description |
|---|---|---|
static class |
UtilityElf.DefaultThreadFactory |
| Constructor | Description |
|---|---|
UtilityElf() |
| Modifier and Type | Method | 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 ThreadPoolExecutor |
createThreadPoolExecutor(BlockingQueue<Runnable> queue,
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 suppress InterruptedException (but re-signal it).
|
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 ThreadPoolExecutor createThreadPoolExecutor(BlockingQueue<Runnable> queue, String threadName, ThreadFactory threadFactory, RejectedExecutionHandler policy)
queue - the BlockingQueue to usethreadName - the thread namethreadFactory - an optional ThreadFactorypolicy - the RejectedExecutionHandler policypublic static int getTransactionIsolation(String transactionIsolationName)
transactionIsolationName - the name of the transaction isolation levelCopyright © 2017 Zaxxer.com. All Rights Reserved.