Package com.palantir.common.proxy
Class DelayProxy
- java.lang.Object
-
- com.palantir.common.proxy.DelayProxy
-
- All Implemented Interfaces:
DelegatingInvocationHandler
,InvocationHandler
public class DelayProxy extends Object implements DelegatingInvocationHandler
-
-
Constructor Summary
Constructors Constructor Description DelayProxy(Object delegate, java.util.function.Supplier<Long> sleepSupplier)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
getDelegate()
Object
invoke(Object proxy, Method method, Object[] args)
static <T> T
newProxyInstance(Class<T> interfaceClass, T delegate, long sleepTimeMs)
static <T> T
newProxyInstance(Class<T> interfaceClass, T delegate, java.util.function.Supplier<Long> sleepTimeMsSupplier)
-
-
-
Method Detail
-
newProxyInstance
public static <T> T newProxyInstance(Class<T> interfaceClass, T delegate, java.util.function.Supplier<Long> sleepTimeMsSupplier)
-
newProxyInstance
public static <T> T newProxyInstance(Class<T> interfaceClass, T delegate, long sleepTimeMs)
-
invoke
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
- Specified by:
invoke
in interfaceInvocationHandler
- Throws:
Throwable
-
getDelegate
public Object getDelegate()
- Specified by:
getDelegate
in interfaceDelegatingInvocationHandler
-
-