return context.proceed();
private void doProceed(MethodInvocationContext context, ValueWrapper wrapper) { Object result = context.proceed(); if (result instanceof Optional) { Optional optional = (Optional) result; wrapper.optional = true; if (optional.isPresent()) { wrapper.value = optional.get(); } } else { wrapper.value = result; } }
@Override public Object intercept(MethodInvocationContext context) { Object target = context.getTarget(); Lock lock = refreshScope.getLock(target).readLock(); try { lock.lock(); return context.proceed(); } finally { lock.unlock(); } } }
@Override public Object intercept(MethodInvocationContext<Object, Object> context) { final AnnotationMetadata annotationMetadata = context.getAnnotationMetadata(); final boolean isSingleton = MicronautBeanFactory.isSingleton(annotationMetadata); if (isSingleton) { final ExecutableMethod<Object, Object> method = context.getExecutableMethod(); synchronized (computedSingletons) { Object o = computedSingletons.get(method); if (o == null) { o = context.proceed(); if (o == null) { throw new BeanCreationException("Bean factor method [" + method + "] returned null"); } computedSingletons.put(method, o); } return o; } } return context.proceed(); }
@Override public Object intercept(MethodInvocationContext context) { if (executableValidator == null) { return context.proceed(); } else { Method targetMethod = context.getTargetMethod(); if (targetMethod.getParameterTypes().length == 0) { return context.proceed(); } else { Set<ConstraintViolation<Object>> constraintViolations = executableValidator .validateParameters( context.getTarget(), targetMethod, context.getParameterValues() ); if (constraintViolations.isEmpty()) { return context.proceed(); } else { throw new ConstraintViolationException(constraintViolations); } } } } }
@Override public final Object intercept(MethodInvocationContext<Object, Object> context) { if (context.hasDeclaredAnnotation(Transactional.class)) { String transactionManagerName = context.getValue(Transactional.class, String.class).orElse(null); if (StringUtils.isEmpty(transactionManagerName)) { transactionManagerName = null; } PlatformTransactionManager transactionManager = resolveTransactionManager(transactionManagerName); String finalTransactionManagerName = transactionManagerName; TransactionAttribute transactionDefinition = resolveTransactionAttribute( context.getExecutableMethod(), context, finalTransactionManagerName ); TransactionTemplate template = new TransactionTemplate( transactionManager, transactionDefinition ); return template.execute(status -> context.proceed()); } else { return context.proceed(); } }
@Override public final Object intercept(MethodInvocationContext<Object, Object> context) { if (context.hasAnnotation(Transactional.class)) { String transactionManagerName = context.getValue(Transactional.class, String.class).orElse(null); if (StringUtils.isEmpty(transactionManagerName)) { transactionManagerName = null; } PlatformTransactionManager transactionManager = resolveTransactionManager(transactionManagerName); String finalTransactionManagerName = transactionManagerName; TransactionAttribute transactionDefinition = resolveTransactionAttribute( context.getExecutableMethod(), context, finalTransactionManagerName ); TransactionTemplate template = new TransactionTemplate( transactionManager, transactionDefinition ); return template.execute(status -> context.proceed()); } else { return context.proceed(); } }
private Object interceptPublisher(MethodInvocationContext<Object, Object> context, ReturnType returnTypeObject, Class returnType) { CacheOperation cacheOperation = new CacheOperation(context, returnType); AnnotationValue<Cacheable> cacheable = cacheOperation.cacheable; if (cacheable != null) { SingleSubscriberPublisher<Object> publisher = buildPublisher(context, returnTypeObject, cacheOperation, cacheable); Optional converted = ConversionService.SHARED.convert(publisher, ConversionContext.of(returnTypeObject.asArgument())); if (converted.isPresent()) { return converted.get(); } else { throw new UnsupportedOperationException("Cannot convert publisher into target type: " + returnType); } } else { return context.proceed(); } }
@Override public Object intercept( MethodInvocationContext<Object, Object> ctx ) { Object retVal; Logger log = LoggerFactory.getLogger( ctx.getDeclaringType().getClass() ); Date start = new Date(); Loggable annotation = ctx.getDeclaringType().getAnnotation( Loggable.class ); try { if ( log.isDebugEnabled() && annotation.value() ) { log.debug( printBefore( ctx ) ); } retVal = ctx.proceed(); if ( log.isDebugEnabled() && annotation.value() ) { long duration = new Date().getTime() - start.getTime(); log.debug( printAfter( ctx, retVal, duration ) ); } } catch ( Throwable throwable ) { if ( log.isErrorEnabled() && annotation.value() ) { log.error( printError( ctx, throwable ), throwable ); } throw throwable; } return retVal; }
@Override public Object intercept(MethodInvocationContext<Object, Object> context) { try { Object result = context.proceed(); if (result != null) { if (result instanceof CompletableFuture) { return fallbackForFuture(context, (CompletableFuture) result); } else if (Publishers.isConvertibleToPublisher(result.getClass())) { return fallbackForReactiveType(context, result); } } return result; } catch (RuntimeException e) { return resolveFallback(context, e); } }
@Override public Object intercept(MethodInvocationContext<Object, Object> context) { if (context.hasStereotype(CacheConfig.class)) { ReturnType returnTypeObject = context.getReturnType(); Class returnType = returnTypeObject.getType(); if (CompletableFuture.class.isAssignableFrom(returnType)) { return interceptCompletableFuture(context, returnTypeObject, returnType); } else if (Publishers.isConvertibleToPublisher(returnType)) { return interceptPublisher(context, returnTypeObject, returnType); } else { return interceptSync(context, returnTypeObject, returnType); } } else { return context.proceed(); } }
Optional<AnnotationValue<Retryable>> opt = context.findAnnotation(Retryable.class); if (!opt.isPresent()) { return context.proceed(); if (Publishers.isConvertibleToPublisher(javaReturnType)) { ConversionService<?> conversionService = ConversionService.SHARED; Object result = context.proceed(); if (result == null) { return result; while (true) { try { Object result = context.proceed(this); retryState.close(null); return result;
return context.proceed();
return context.proceed();
return context.proceed(); } else { doProceed(context, wrapper);