public final class SpiUtils extends Object
Modifier and Type | Method and Description |
---|---|
static CloseHandler<Object> |
asyncClosingCloseHandler(HandleableCloseable<?> c)
A close handler which closes another resource asynchronously.
|
static CloseHandler<Object> |
closingCloseHandler(Closeable c)
A close handler which closes another resource.
|
static Runnable |
getServiceOpenTask(Channel newChannel,
OpenListener listener)
Get an executor task for opening a service.
|
static void |
glueStackTraces(Throwable exception,
StackTraceElement[] userStackTrace,
int trimCount,
String msg)
Glue two stack traces together.
|
static <T> void |
safeHandleClose(CloseHandler<? super T> handler,
T closed,
IOException exception)
Safely handle a close notification.
|
public static <T> void safeHandleClose(CloseHandler<? super T> handler, T closed, IOException exception)
T
- the type of the closed resourcehandler
- the close handlerclosed
- the object that was closedexception
- the close exception, or null
if the close succeededpublic static CloseHandler<Object> closingCloseHandler(Closeable c)
c
- the resource to closepublic static CloseHandler<Object> asyncClosingCloseHandler(HandleableCloseable<?> c)
c
- the resource to closepublic static void glueStackTraces(Throwable exception, StackTraceElement[] userStackTrace, int trimCount, String msg)
exception
- the exception which occurred in another threaduserStackTrace
- the stack trace of the current thread from Thread.getStackTrace()
trimCount
- the number of frames to trimmsg
- the message to usepublic static Runnable getServiceOpenTask(Channel newChannel, OpenListener listener)
newChannel
- the new service channellistener
- the service open listenerCopyright © 2012 JBoss by Red Hat. All Rights Reserved.