public class RemoteUtil
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static <T> T |
castToLocal(java.lang.Object remote,
java.lang.Class<T> clazz) |
static <T> T |
castToRemote(java.lang.Object object,
java.lang.Class<T> clazz) |
static <T> T |
castToRemoteNotNull(java.lang.Object object,
java.lang.Class<T> clazz) |
static <T> T |
executeWithClassLoader(ThrowableComputable<T,? extends java.lang.Exception> action,
java.lang.ClassLoader classLoader) |
static <T> T |
handleRemoteResult(java.lang.Object value,
java.lang.Class<? super T> clazz,
java.lang.Object requestor) |
static <T> T |
substituteClassLoader(T remote,
java.lang.ClassLoader classLoader) |
static java.lang.Throwable |
unwrap(java.lang.Throwable e)
There is a possible case that remotely called code throws exception during processing.
|
public static <T> T castToRemoteNotNull(java.lang.Object object, java.lang.Class<T> clazz)
public static <T> T castToRemote(java.lang.Object object, java.lang.Class<T> clazz)
public static <T> T castToLocal(java.lang.Object remote, java.lang.Class<T> clazz)
public static <T> T substituteClassLoader(T remote, java.lang.ClassLoader classLoader) throws java.lang.Exception
java.lang.Exception
public static <T> T handleRemoteResult(java.lang.Object value, java.lang.Class<? super T> clazz, java.lang.Object requestor) throws java.lang.Exception
java.lang.Exception
public static <T> T executeWithClassLoader(ThrowableComputable<T,? extends java.lang.Exception> action, java.lang.ClassLoader classLoader) throws java.lang.Exception
java.lang.Exception
public static java.lang.Throwable unwrap(java.lang.Throwable e)
InvocationTargetException
, UndeclaredThrowableException
etc.
This method tries to extract the 'real exception' from the given potentially wrapped one.e
- exception to process