public final class StopwatchProxyFactory<T> extends DelegatingProxyFactory<T>
MonitoredInterface monitoredProxy=new StopwatchProxyFactory(monitoredImplementation).newProxy(MonitoredInterface.class);or
MonitoredInterface monitoredProxy=new StopwatchProxyFactory(monitoredImplementation, new CustomProxyStopwatchSource()).newProxy(MonitoredInterface.class);
Constructor and Description |
---|
StopwatchProxyFactory(T delegate)
Constructor.
|
StopwatchProxyFactory(T delegate,
StopwatchSource<DelegatingMethodInvocation<T>> stopwatchSource)
Constructor
|
Modifier and Type | Method and Description |
---|---|
protected Object |
invoke(DelegatingMethodInvocation<T> methodInvocation)
Invocation handler main method.
|
getDelegate, invoke, newProxy, newProxy, newProxy
public StopwatchProxyFactory(T delegate, StopwatchSource<DelegatingMethodInvocation<T>> stopwatchSource)
delegate
- Wrapped objectstopwatchSource
- Stopwatch source (to configure Stopwatch naming)public StopwatchProxyFactory(T delegate)
delegate
- Wrapped objectprotected Object invoke(DelegatingMethodInvocation<T> methodInvocation) throws Throwable
invoke
in class DelegatingProxyFactory<T>
methodInvocation
- Method invocation (arguments, method name, etc.)Throwable
- Method invocation raised exceptionCopyright © 2019. All rights reserved.