Refine search
@Override public Object execute() throws Throwable { logger.debug("Entering API call {}, arguments: {}", invocation.getMethod(), invocation.getArguments()); final Object proceed = invocation.proceed(); logger.debug("Exiting API call {}, returning: {}", invocation.getMethod(), proceed); return proceed; } };
@Override @Nullable public Object invoke(final MethodInvocation invocation) throws Throwable { Method method = invocation.getMethod(); CacheOperationInvoker aopAllianceInvoker = () -> { try { return invocation.proceed(); } catch (Throwable ex) { throw new CacheOperationInvoker.ThrowableWrapper(ex); } }; try { return execute(aopAllianceInvoker, invocation.getThis(), method, invocation.getArguments()); } catch (CacheOperationInvoker.ThrowableWrapper th) { throw th.getOriginal(); } }
@Override @Nullable public Object invoke(final MethodInvocation invocation) throws Throwable { Method method = invocation.getMethod(); CacheOperationInvoker aopAllianceInvoker = () -> { try { return invocation.proceed(); } catch (Throwable ex) { throw new CacheOperationInvoker.ThrowableWrapper(ex); } }; try { return execute(aopAllianceInvoker, invocation.getThis(), method, invocation.getArguments()); } catch (CacheOperationInvoker.ThrowableWrapper th) { throw th.getOriginal(); } }
@Override public Object invoke(MethodInvocation mi) throws Throwable { try { return mi.proceed(); } catch (RuntimeException ex) { // Let it throw raw if the type of the exception is on the throws clause of the method. if (!this.alwaysTranslate && ReflectionUtils.declaresException(mi.getMethod(), ex.getClass())) { throw ex; } else { PersistenceExceptionTranslator translator = this.persistenceExceptionTranslator; if (translator == null) { Assert.state(this.beanFactory != null, "No PersistenceExceptionTranslator set"); translator = detectPersistenceExceptionTranslators(this.beanFactory); this.persistenceExceptionTranslator = translator; } throw DataAccessUtils.translateIfNecessary(ex, translator); } } }
@Override public Object invoke(MethodInvocation invocation) throws Throwable { Method method = invocation.getMethod(); if (logger.isDebugEnabled()) { logger.debug("Incoming " + this.exporterNameClause + "remote call: " + Object retVal = invocation.proceed(); if (logger.isDebugEnabled()) { logger.debug("Finished processing of " + this.exporterNameClause + "remote call: " +
@Override public Object invoke(MethodInvocation invocation) throws Throwable { String methodName = invocation.getMethod().getName(); // step 1: check the method is not interceptor if (!INTERCEPTOR_METHOD_NAME.contains(methodName)) { return invocation.proceed(); } // step 2: interceptor the method List<Server> serverList = (List<Server>) invocation.proceed(); long s = System.currentTimeMillis(); log.info("[ START ] merage server list for " + clientConfig.getClientName()); serverList = mergeAnsServerList(serverList); log.info("[ END ] merage server list for " + clientConfig.getClientName() + ", cost time " + (System.currentTimeMillis() - s) + " ms ."); return serverList; }
@Override public Object invoke(MethodInvocation invocation) throws Exception { Class<?> declaringClass = invocation.getMethod().getDeclaringClass(); try { if (declaringClass.isAssignableFrom(adapterInterface) && genericParametersMatch(invocation, adapter)) { return invocation.getMethod().invoke(adapter, invocation.getArguments()); } return invocation.proceed(); } catch (InvocationTargetException e) { throw e.getCause() instanceof Exception ? (Exception) e.getCause() : e; } catch (Throwable e) { if (e instanceof Error) { throw (Error) e; } throw new InvocationTargetException(e); } }
@Override public Object invoke(MethodInvocation invocation) throws Throwable { String timerName = invocation.getMethod().getAnnotation(Metered.class).value(); if (timerName.isEmpty()) { timerName = MetricRegistry.name(invocation.getThis().getClass().getSuperclass(), invocation.getMethod().getName()); } Meter meter = metricsServiceProvider .get() .getMetricRegistry() .meter(timerName); meter.mark(); try { return invocation.proceed(); } finally { } }
@Override public Object invoke(MethodInvocation invocation) throws Throwable { String timerName = invocation.getMethod().getAnnotation(Timed.class).value(); if (timerName.isEmpty()) { timerName = MetricRegistry.name(invocation.getThis().getClass().getSuperclass(), invocation.getMethod().getName()); } Timer.Context timerContext = metricsServiceProvider .get() .getMetricRegistry() .timer(timerName) .time(); try { return invocation.proceed(); } finally { timerContext.stop(); } }
@Override @Nullable public Object invoke(final MethodInvocation invocation) throws Throwable { Method method = invocation.getMethod(); CacheOperationInvoker aopAllianceInvoker = () -> { try { return invocation.proceed(); } catch (Throwable ex) { throw new CacheOperationInvoker.ThrowableWrapper(ex); } }; try { return execute(aopAllianceInvoker, invocation.getThis(), method, invocation.getArguments()); } catch (CacheOperationInvoker.ThrowableWrapper th) { throw th.getOriginal(); } }
public Object invoke(final MethodInvocation invocation) throws Throwable { Class<?> targetClass = (invocation.getThis() != null ? AopUtils.getTargetClass(invocation.getThis()) : null); Method specificMethod = ClassUtils.getMostSpecificMethod(invocation.getMethod(), targetClass); final Method userDeclaredMethod = BridgeMethodResolver.findBridgedMethod(specificMethod); Object result = invocation.proceed(); if (result instanceof Future) { return ((Future<?>) result).get(); }; return doSubmit(task, executor, invocation.getMethod().getReturnType());