checkArgument(interfaceType.isInterface(), "interfaceType must be an interface type"); final Set<Method> interruptibleMethods = findInterruptibleMethods(interfaceType);
checkArgument(interfaceType.isInterface(), "interfaceType must be an interface type"); final Set<Method> interruptibleMethods = findInterruptibleMethods(interfaceType);
checkArgument(interfaceType.isInterface(), "interfaceType must be an interface type"); final Set<Method> interruptibleMethods = findInterruptibleMethods(interfaceType);
public <T> T newProxy(final T target, Class<T> interfaceType, final long timeoutDuration, final TimeUnit timeoutUnit) { checkNotNull(target); checkNotNull(interfaceType); checkNotNull(timeoutUnit); checkArgument(timeoutDuration > 0, "bad timeout: " + timeoutDuration); checkArgument(interfaceType.isInterface(), "interfaceType must be an interface type"); final Set<Method> interruptibleMethods = findInterruptibleMethods(interfaceType); InvocationHandler handler = new InvocationHandler() { public Object invoke(Object obj, final Method method, final Object[] args) throws Throwable { Callable<Object> callable = new Callable<Object>() { public Object call() throws Exception { try { return method.invoke(target, args); } catch (InvocationTargetException e) { Throwables.throwCause(e, false); throw new AssertionError("can't get here"); } } }; return callWithTimeout(callable, timeoutDuration, timeoutUnit, interruptibleMethods.contains(method)); } }; return newProxy(interfaceType, handler); }
= findInterruptibleMethods(interfaceType);
"interfaceType must be an interface type"); final Set<Method> interruptibleMethods = findInterruptibleMethods(interfaceType);
= findInterruptibleMethods(interfaceType);
= findInterruptibleMethods(interfaceType);
= findInterruptibleMethods(interfaceType);
= findInterruptibleMethods(interfaceType);
checkArgument(interfaceType.isInterface(), "interfaceType must be an interface type"); final Set<Method> interruptibleMethods = findInterruptibleMethods(interfaceType);
checkArgument(interfaceType.isInterface(), "interfaceType must be an interface type"); final Set<Method> interruptibleMethods = findInterruptibleMethods(interfaceType);