public class ProxyUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
cached(Map<Object,org.apache.commons.lang3.tuple.Pair<Object,Throwable>> cache,
T original) |
static <T> T |
newProxy(T service,
InvocationHandler handler) |
static <T> T |
runInTransaction(T service,
Function<Supplier<?>,?> transactionalRunner) |
static <T> T |
runWithContextClassLoader(ClassLoader classLoader,
T service)
Creates a proxy that will call
service with provided classLoader. |
public static <T> T runWithContextClassLoader(ClassLoader classLoader, T service)
service with provided classLoader. After the call original
context class loader will be restored.public static <T> T runInTransaction(T service,
Function<Supplier<?>,?> transactionalRunner)
public static <T> T cached(Map<Object,org.apache.commons.lang3.tuple.Pair<Object,Throwable>> cache, T original)
public static <T> T newProxy(T service,
InvocationHandler handler)
T - the target interfaceservice - to be proxiedhandler - that intercepts method invocationsClassCastException - if the service does not have any interfaces, or
T is not an interfaceCopyright © 2023 Atlassian. All rights reserved.