String.format("Null values are not allowed to be passed to client methods (%s). Add @javax.validation.Nullable if that is the desired behavior", context.getExecutableMethod().toString()) );
@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(); }
} catch (Throwable e) { if (LOG.isErrorEnabled()) { LOG.error("Error occurred executing @Async method [" + context.getExecutableMethod() + "]: " + e.getMessage(), e); return null; } else { throw new TaskExecutionException("Method [" + context.getExecutableMethod() + "] must return either void, or an instance of Publisher or CompletionStage");
@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(); } }
@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(); } }
.map(Duration::toMillis).orElse(Duration.ofSeconds(DEFAULT_CIRCUIT_BREAKER_TIMEOUT_IN_MILLIS).toMillis()); retryState = circuitContexts.computeIfAbsent( context.getExecutableMethod(), method -> new CircuitBreakerRetry(timeout, retryStateBuilder, context, eventPublisher) );
String.format("Null values are not allowed to be passed to client methods (%s). Add @javax.validation.Nullable if that is the desired behavior", context.getExecutableMethod().toString()) );
String.format("Null values are not allowed to be passed to client methods (%s). Add @javax.validation.Nullable if that is the desired behavior", context.getExecutableMethod().toString()) );