JBoss Remoting 3 3.2.0.CR6

org.jboss.remoting3.spi
Class SpiUtils

java.lang.Object
  extended by org.jboss.remoting3.spi.SpiUtils

public final class SpiUtils
extends Object

Utility methods for Remoting service providers.


Method Summary
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

safeHandleClose

public static <T> void safeHandleClose(CloseHandler<? super T> handler,
                                       T closed,
                                       IOException exception)
Safely handle a close notification.

Type Parameters:
T - the type of the closed resource
Parameters:
handler - the close handler
closed - the object that was closed
exception - the close exception, or null if the close succeeded

closingCloseHandler

public static CloseHandler<Object> closingCloseHandler(Closeable c)
A close handler which closes another resource.

Parameters:
c - the resource to close
Returns:
the close handler

asyncClosingCloseHandler

public static CloseHandler<Object> asyncClosingCloseHandler(HandleableCloseable<?> c)
A close handler which closes another resource asynchronously.

Parameters:
c - the resource to close
Returns:
the close handler

glueStackTraces

public static void glueStackTraces(Throwable exception,
                                   StackTraceElement[] userStackTrace,
                                   int trimCount,
                                   String msg)
Glue two stack traces together.

Parameters:
exception - the exception which occurred in another thread
userStackTrace - the stack trace of the current thread from Thread.getStackTrace()
trimCount - the number of frames to trim
msg - the message to use

getServiceOpenTask

public static Runnable getServiceOpenTask(Channel newChannel,
                                          OpenListener listener)
Get an executor task for opening a service.

Parameters:
newChannel - the new service channel
listener - the service open listener
Returns:
the runnable task

JBoss Remoting 3 3.2.0.CR6

Copyright © 2012 JBoss, a division of Red Hat, Inc.. All Rights Reserved.