提交 cc379f1c 编写于 作者: J Juergen Hoeller

Polishing

上级 666037ec
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -70,7 +70,9 @@ public abstract class AbstractAdvisorAutoProxyCreator extends AbstractAutoProxyC
@Override
@Nullable
protected Object[] getAdvicesAndAdvisorsForBean(Class<?> beanClass, String beanName, @Nullable TargetSource targetSource) {
protected Object[] getAdvicesAndAdvisorsForBean(
Class<?> beanClass, String beanName, @Nullable TargetSource targetSource) {
List<Advisor> advisors = findEligibleAdvisors(beanClass, beanName);
if (advisors.isEmpty()) {
return DO_NOT_PROXY;
......
......@@ -563,14 +563,11 @@ class ConfigurationClassEnhancer {
}
}
((Factory) fbProxy).setCallback(0, new MethodInterceptor() {
@Override
public Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy) throws Throwable {
if (method.getName().equals("getObject") && args.length == 0) {
return beanFactory.getBean(beanName);
}
return proxy.invoke(factoryBean, args);
((Factory) fbProxy).setCallback(0, (MethodInterceptor) (obj, method, args, proxy) -> {
if (method.getName().equals("getObject") && args.length == 0) {
return beanFactory.getBean(beanName);
}
return proxy.invoke(factoryBean, args);
});
return fbProxy;
......
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -24,18 +24,18 @@ import org.springframework.core.task.TaskExecutor;
import org.springframework.util.Assert;
/**
* Adapter that takes a Spring {@link org.springframework.core.task.TaskExecutor})
* Adapter that takes a Spring {@link org.springframework.core.task.TaskExecutor}
* and exposes a full {@code java.util.concurrent.ExecutorService} for it.
*
* <p>This is primarily for adapting to client components that communicate via the
* {@code java.util.concurrent.ExecutorService} API. It can also be used as
* common ground between a local Spring {@code TaskExecutor} backend and a
* JNDI-located {@code ManagedExecutorService} in a Java EE 6 environment.
* JNDI-located {@code ManagedExecutorService} in a Java EE 7 environment.
*
* <p><b>NOTE:</b> This ExecutorService adapter does <em>not</em> support the
* lifecycle methods in the {@code java.util.concurrent.ExecutorService} API
* ("shutdown()" etc), similar to a server-wide {@code ManagedExecutorService}
* in a Java EE 6 environment. The lifecycle is always up to the backend pool,
* in a Java EE 7 environment. The lifecycle is always up to the backend pool,
* with this adapter acting as an access-only proxy for that target pool.
*
* @author Juergen Hoeller
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册