我有一个
中定义的作用域beant1.pencolor(colors[length1 % 3])
t2.pencolor("pink")
while length1 < 500 or length2 < 500:
if length1 < 500:
t1.fd(length1)
t1.right(89)
length1 += 3 # length1 = length1 + 3
if length2 < 500:
t2.fd(length2)
t2.left(89)
length2 += 4 # length2 = length2 + 4
我有一个使用上述作用域豆的单例豆
@Configuration
@CustomScoped(proxyMode = ScopedProxyMode.TARGET_CLASS)
public class CustomScopedConfiguration {
@CustomScoped
@Bean
public CustomScopedClass getCustomScopedClassObject() {
constructCustomScopedClassObject();
}
}
即使我在范围配置类中定义了proxyMode,但在应用程序启动时(接收请求之前)并尝试为@Configuration
public class SingletonClassConfiguration {
@Bean
public SingletonClass getSingletonClassObject(@Named("customScopedClass") CustomScopedClass customScopedObject) {
constructSingletonClassObject(customScopedObject);
}
}
-
SingletonClass
通过proxyMode设置,我希望代理能够被注入,然后在应用程序收到请求时在运行时解析为实际的bean。
不涉及线程。