public static RequestBatchingTimestampService create(TimestampService untimedDelegate) { TimestampService delegate = TimingProxy.newProxyInstance(TimestampService.class, untimedDelegate, timer); DisruptorAutobatcher<Integer, TimestampRange> autobatcher = DisruptorAutobatcher.create(consumer(delegate)); return new RequestBatchingTimestampService(delegate, autobatcher); }
@SuppressWarnings("unchecked") public static <T> T newProxyInstance(Class<T> interfaceClass, T delegate, OperationTimer timer) { return (T)Proxy.newProxyInstance(interfaceClass.getClassLoader(), new Class<?>[] {interfaceClass}, new TimingProxy(delegate, timer)); }
subject = ThreadConfinedProxy.newProxyInstance(List.class, subject, ThreadConfinedProxy.Strictness.VALIDATE); subject = TimingProxy.newProxyInstance(List.class, subject, LoggingOperationTimer.create(log)); subject = ThreadConfinedProxy.newProxyInstance(List.class, subject, ThreadConfinedProxy.Strictness.VALIDATE); subject = new DelegatingArrayListString(subject); subject = TimingProxy.newProxyInstance(List.class, subject, LoggingOperationTimer.create(log));
@SuppressWarnings("unchecked") public static <T> T newProxyInstance(Class<T> interfaceClass, T delegate, OperationTimer timer) { return (T)Proxy.newProxyInstance(interfaceClass.getClassLoader(), new Class<?>[] {interfaceClass}, new TimingProxy(delegate, timer)); }
public static RequestBatchingTimestampService create(TimestampService untimedDelegate) { TimestampService delegate = TimingProxy.newProxyInstance(TimestampService.class, untimedDelegate, timer); DisruptorAutobatcher<Integer, TimestampRange> autobatcher = DisruptorAutobatcher.create(consumer(delegate)); return new RequestBatchingTimestampService(delegate, autobatcher); }