@SuppressWarnings("unchecked") public static <T> T newProxyInstance(Class<T> interfaceClass, T delegate, Supplier<Long> sleepTimeMsSupplier) { return (T)Proxy.newProxyInstance(interfaceClass.getClassLoader(), new Class<?>[] {interfaceClass}, new DelayProxy(delegate, sleepTimeMsSupplier)); }
public static <T> T newProxyInstance(Class<T> interfaceClass, T delegate, long sleepTimeMs) { return newProxyInstance(interfaceClass, delegate, Suppliers.ofInstance(sleepTimeMs)); }
public static <T> T newProxyInstance(Class<T> interfaceClass, T delegate, long sleep) { return SerializingProxy.newProxyInstance(interfaceClass, InterruptibleProxy.newProxyInstance(interfaceClass, DelayProxy.newProxyInstance(interfaceClass, delegate, sleep), CancelDelegate.CANCEL)); }
@SuppressWarnings("unchecked") public static <T> T newProxyInstance(Class<T> interfaceClass, T delegate, Supplier<Long> sleepTimeMsSupplier) { return (T)Proxy.newProxyInstance(interfaceClass.getClassLoader(), new Class<?>[] {interfaceClass}, new DelayProxy(delegate, sleepTimeMsSupplier)); }
public static <T> T newProxyInstance(Class<T> interfaceClass, T delegate, long sleepTimeMs) { return newProxyInstance(interfaceClass, delegate, Suppliers.ofInstance(sleepTimeMs)); }
public static <T> T newProxyInstance(Class<T> interfaceClass, T delegate, long sleep) { return SerializingProxy.newProxyInstance(interfaceClass, InterruptibleProxy.newProxyInstance(interfaceClass, DelayProxy.newProxyInstance(interfaceClass, delegate, sleep), CancelDelegate.CANCEL)); }