Returns an instance of {@code interfaceType} that delegates all methodcalls to the {@code target} object, enforcing the specified time limit oneach call. This time-limited delegation is also performed for calls to {@link Object#equals}, {@link Object#hashCode}, and {@link Object#toString}.
If the target method call finishes before the limit is reached, the return value or exception is propagated to the caller exactly as-is. If, on the other hand, the time limit is reached, the proxy will attempt to abort the call to the target, and will throw an {@link UncheckedTimeoutException} tothe caller.
It is important to note that the primary purpose of the proxy object is to return control to the caller when the timeout elapses; aborting the target method call is of secondary concern. The particular nature and strength of the guarantees made by the proxy is implementation-dependent. However, it is important that each of the methods on the target object behaves appropriately when its thread is interrupted.
@param target the object to proxy
@param interfaceType the interface you wish the returned proxy toimplement
@param timeoutDuration with timeoutUnit, the maximum length of time thatcallers are willing to wait on each method call to the proxy
@param timeoutUnit with timeoutDuration, the maximum length of time thatcallers are willing to wait on each method call to the proxy
@return a time-limiting proxy
@throws IllegalArgumentException if {@code interfaceType} is a regularclass, enum, or annotation type, rather than an interface