@Override @Nullable public Object invoke(@Nullable Object proxy, @Nullable Method method, Object @Nullable [] args) throws Throwable { if (method != null) { try { getManager().enqueue(new Invocation(this, method, args)); } catch (DuplicateExecutionException e) { handleDuplicate(method, e); } } return null; }
@Override @Nullable public Object invoke(@Nullable Object proxy, @Nullable Method method, Object @Nullable [] args) throws Throwable { if (method != null) { Invocation invocation = new Invocation(this, method, args); Invocation activeInvocation = getManager().getActiveInvocation(); if (activeInvocation != null) { if (logger.isDebugEnabled()) { logger.debug(MSG_CONTEXT, toString(method), getTarget()); } try { activeInvocation.getInvocationStack().push(invocation); return invokeDirect(invocation); } finally { activeInvocation.getInvocationStack().poll(); } } try { Future<Object> future = getManager().getScheduler().submit(invocation); return future.get(getTimeout(), TimeUnit.MILLISECONDS); } catch (TimeoutException e) { handleTimeout(method, invocation); } catch (ExecutionException e) { handleExecutionException(method, e); } } return null; }
@Nullable Object invokeDirect(Invocation invocation) throws IllegalAccessException, IllegalArgumentException { try { manager.recordCallStart(invocation); } catch (DuplicateExecutionException e) { return null; } try { return invocation.getMethod().invoke(target, invocation.getArgs()); } catch (InvocationTargetException e) { handleException(invocation.getMethod(), e); return null; } finally { manager.recordCallEnd(invocation); } }
@Nullable Object invokeDirect(Invocation invocation) throws IllegalAccessException, IllegalArgumentException { try { manager.recordCallStart(invocation); } catch (DuplicateExecutionException e) { return null; } try { return invocation.getMethod().invoke(target, invocation.getArgs()); } catch (InvocationTargetException e) { handleException(invocation.getMethod(), e); return null; } finally { manager.recordCallEnd(invocation); } }
@Override @Nullable public Object invoke(@Nullable Object proxy, @Nullable Method method, Object @Nullable [] args) throws Throwable { if (method != null) { Invocation invocation = new Invocation(this, method, args); Invocation activeInvocation = getManager().getActiveInvocation(); if (activeInvocation != null) { if (logger.isDebugEnabled()) { logger.debug(MSG_CONTEXT, toString(method), getTarget()); } try { activeInvocation.getInvocationStack().push(invocation); return invokeDirect(invocation); } finally { activeInvocation.getInvocationStack().poll(); } } try { Future<Object> future = getManager().getScheduler().submit(invocation); return future.get(getTimeout(), TimeUnit.MILLISECONDS); } catch (TimeoutException e) { handleTimeout(method, invocation); } catch (ExecutionException e) { handleExecutionException(method, e); } } return null; }
@Override @Nullable public Object invoke(@Nullable Object proxy, @Nullable Method method, Object @Nullable [] args) throws Throwable { if (method != null) { try { getManager().enqueue(new Invocation(this, method, args)); } catch (DuplicateExecutionException e) { handleDuplicate(method, e); } } return null; }