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

Clarify destruction order effect in @DependsOn annotation javadoc

Issue: SPR-17384

(cherry picked from commit 00b7782b)
上级 9efe37e6
/*
* 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.
......@@ -28,6 +28,12 @@ import java.lang.annotation.Target;
* does not explicitly depend on another through properties or constructor arguments,
* but rather depends on the side effects of another bean's initialization.
*
* <p>A depends-on declaration can specify both an initialization-time dependency and,
* in the case of singleton beans only, a corresponding destruction-time dependency.
* Dependent beans that define a depends-on relationship with a given bean are destroyed
* first, prior to the given bean itself being destroyed. Thus, a depends-on declaration
* can also control shutdown order.
*
* <p>May be used on any class directly or indirectly annotated with
* {@link org.springframework.stereotype.Component} or on methods annotated
* with {@link Bean}.
......
......@@ -1911,11 +1911,11 @@ delimiters:
[NOTE]
====
The `depends-on` attribute in the bean definition can specify both an initialization
time dependency and, in the case of <<beans-factory-scopes-singleton,singleton>> beans
only, a corresponding destroy time dependency. Dependent beans that define a
`depends-on` relationship with a given bean are destroyed first, prior to the given bean
itself being destroyed. Thus `depends-on` can also control shutdown order.
The `depends-on` attribute in the bean definition can specify both an initialization-time
dependency and, in the case of <<beans-factory-scopes-singleton,singleton>> beans only,
a corresponding destruction-time dependency. Dependent beans that define a `depends-on`
relationship with a given bean are destroyed first, prior to the given bean itself being
destroyed. Thus `depends-on` can also control shutdown order.
====
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册