|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.opcfoundation.ua.utils.StackUtils
public class StackUtils
Utility methods for the OPC UA Java Stack.
| Field Summary | |
|---|---|
static UnsignedInteger |
CLIENT_TOKEN_LIFETIME_REQUEST
Requested token lifetime |
static Random |
RANDOM
Constant RANDOM |
static UnsignedInteger |
SERVER_GIVEN_TOKEN_LIFETIME
Maximum lifetime server is willing to offer |
static int |
TCP_PROTOCOL_VERSION
Constant TCP_PROTOCOL_VERSION=0 |
| Constructor Summary | |
|---|---|
StackUtils()
|
|
| Method Summary | |
|---|---|
static boolean |
barrierWait(AsyncResult<?>[] requests,
long timeout)
Wait for a group to requests to go into final state |
static int |
cores()
cores. |
static Executor |
createBlockingWorkExecutor(String name,
int maxThreadPoolSize)
Get Executor for long term and potentially blocking operations. |
static int |
getBlockingWorkerThreadPoolCoreSize()
Getter for the field blockingWorkerThreadPoolCoreSize. |
static long |
getBlockingWorkerThreadPoolTimeout()
Getter for the field blockingWorkerThreadPoolTimeout. |
static Executor |
getBlockingWorkExecutor()
Get Executor for long term and potentially blocking operations. |
static IEncodeableSerializer |
getDefaultSerializer()
Get default encodeable serializer |
static Executor |
getNonBlockingWorkExecutor()
Get Executor for non-blocking operations. |
static Executor |
getRejectionExecutor()
Get Executor that handles tasks that are rejected by blocking work executor |
static AsyncSelector |
getSelector()
getSelector. |
static Thread.UncaughtExceptionHandler |
getUncaughtExceptionHandler()
The handler that is called, if any of the worker threads encounter an exception that is not handled. |
static void |
logStatus()
logStatus. |
static ThreadFactory |
newNamedThreadFactory(String name)
newNamedThreadFactory. |
static void |
setBlockingWorkerThreadPoolCoreSize(int blockingWorkerThreadPoolCoreSize)
Setter for the field blockingWorkerThreadPoolCoreSize. |
static void |
setBlockingWorkerThreadPoolTimeout(long blockingWorkerThreadPoolTimeout)
Define the timeout (in seconds) of the thread pool for BlockingWorkerExecutor. |
static void |
setUncaughtExceptionHandler(Thread.UncaughtExceptionHandler uncaughtexceptionhandler)
Define the handler that is called, if any of the worker threads encounter an exception that is not handled. |
static void |
shutdown()
Perform a "context shutdown" to clean up the Stack resources. |
static ServiceResultException |
toServiceResultException(Exception e)
toServiceResultException. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static Random RANDOM
RANDOM
public static final UnsignedInteger CLIENT_TOKEN_LIFETIME_REQUEST
public static final UnsignedInteger SERVER_GIVEN_TOKEN_LIFETIME
public static final int TCP_PROTOCOL_VERSION
TCP_PROTOCOL_VERSION=0
| Constructor Detail |
|---|
public StackUtils()
| Method Detail |
|---|
public static boolean barrierWait(AsyncResult<?>[] requests,
long timeout)
throws InterruptedException
requests - a group of requeststimeout - timeout in seconds
InterruptedException - if any.public static int cores()
cores.
public static Executor createBlockingWorkExecutor(String name,
int maxThreadPoolSize)
maxThreadPoolSize - max number of threads to create in the thread poolname - a String object.
public static int getBlockingWorkerThreadPoolCoreSize()
Getter for the field blockingWorkerThreadPoolCoreSize.
public static long getBlockingWorkerThreadPoolTimeout()
Getter for the field blockingWorkerThreadPoolTimeout.
public static Executor getBlockingWorkExecutor()
Calls getBlockingWorkExecutor(getDefaultMaxBlockingWorkerThreadPoolSize())
public static IEncodeableSerializer getDefaultSerializer()
public static Executor getNonBlockingWorkExecutor()
public static Executor getRejectionExecutor()
public static AsyncSelector getSelector()
getSelector.
AsyncSelector object.public static Thread.UncaughtExceptionHandler getUncaughtExceptionHandler()
public static void logStatus()
logStatus.
public static ThreadFactory newNamedThreadFactory(String name)
newNamedThreadFactory.
name - a String object.
ThreadFactory object.public static void setBlockingWorkerThreadPoolCoreSize(int blockingWorkerThreadPoolCoreSize)
Setter for the field blockingWorkerThreadPoolCoreSize.
blockingWorkerThreadPoolCoreSize - a int.public static void setBlockingWorkerThreadPoolTimeout(long blockingWorkerThreadPoolTimeout)
Default: 3
blockingWorkerThreadPoolTimeout - a long.public static void setUncaughtExceptionHandler(Thread.UncaughtExceptionHandler uncaughtexceptionhandler)
The default handler will just log the exception as an Error to the log4j log.
Set the handler to provide custom behavior in your application.
The handler is set when new worker threads are started and setting the value will not affect already running threads.
uncaughtexceptionhandler - the uncaughtexceptionhandler to setpublic static void shutdown()
Shuts down BLOCKING_EXECUTOR and NON_BLOCKING_EXECUTOR, closes SELECTOR
and cancels TimerUtil.getTimer().
public static ServiceResultException toServiceResultException(Exception e)
toServiceResultException.
e - a Exception object.
ServiceResultException object.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||