Consistent line breaks in reference documentation

This commit is contained in:
Juergen Hoeller 2025-07-10 19:33:34 +02:00
parent 983fdebdbb
commit a0c083619f
365 changed files with 399 additions and 1867 deletions

View File

@ -6,7 +6,7 @@ nav:
ext: ext:
collector: collector:
run: run:
command: gradlew -q -PbuildSrc.skipTests=true "-Dorg.gradle.jvmargs=-Xmx3g -XX:+HeapDumpOnOutOfMemoryError" :framework-docs:generateAntoraResources command: gradlew -q -PbuildSrc.skipTests=true "-Dorg.gradle.jvmargs=-Xmx3g" :framework-docs:generateAntoraResources
local: true local: true
scan: scan:
dir: ./build/generated-antora-resources dir: ./build/generated-antora-resources

View File

@ -17,14 +17,3 @@ is also provided.
AOT processing can be used to optimize your application ahead-of-time. It is typically AOT processing can be used to optimize your application ahead-of-time. It is typically
used for native image deployment using GraalVM. used for native image deployment using GraalVM.

View File

@ -6,7 +6,3 @@ The previous chapter described the Spring's support for AOP with @AspectJ and sc
aspect definitions. In this chapter, we discuss the lower-level Spring AOP APIs. For common aspect definitions. In this chapter, we discuss the lower-level Spring AOP APIs. For common
applications, we recommend the use of Spring AOP with AspectJ pointcuts as described in the applications, we recommend the use of Spring AOP with AspectJ pointcuts as described in the
previous chapter. previous chapter.

View File

@ -4,7 +4,6 @@
Now we can examine how Spring AOP handles advice. Now we can examine how Spring AOP handles advice.
[[aop-api-advice-lifecycle]] [[aop-api-advice-lifecycle]]
== Advice Lifecycles == Advice Lifecycles
@ -22,14 +21,12 @@ the advice adds state to the proxied object.
You can use a mix of shared and per-instance advice in the same AOP proxy. You can use a mix of shared and per-instance advice in the same AOP proxy.
[[aop-api-advice-types]] [[aop-api-advice-types]]
== Advice Types in Spring == Advice Types in Spring
Spring provides several advice types and is extensible to support Spring provides several advice types and is extensible to support
arbitrary advice types. This section describes the basic concepts and standard advice types. arbitrary advice types. This section describes the basic concepts and standard advice types.
[[aop-api-advice-around]] [[aop-api-advice-around]]
=== Interception Around Advice === Interception Around Advice
@ -101,7 +98,6 @@ you are likely to want to run the aspect in another AOP framework. Note that poi
are not currently interoperable between frameworks, and the AOP Alliance does not are not currently interoperable between frameworks, and the AOP Alliance does not
currently define pointcut interfaces. currently define pointcut interfaces.
[[aop-api-advice-before]] [[aop-api-advice-before]]
=== Before Advice === Before Advice
@ -168,7 +164,6 @@ Kotlin::
TIP: Before advice can be used with any pointcut. TIP: Before advice can be used with any pointcut.
[[aop-api-advice-throws]] [[aop-api-advice-throws]]
=== Throws Advice === Throws Advice
@ -297,7 +292,6 @@ exception that is incompatible with the target method's signature!_
TIP: Throws advice can be used with any pointcut. TIP: Throws advice can be used with any pointcut.
[[aop-api-advice-after-returning]] [[aop-api-advice-after-returning]]
=== After Returning Advice === After Returning Advice
@ -361,7 +355,6 @@ thrown up the interceptor chain instead of the return value.
TIP: After returning advice can be used with any pointcut. TIP: After returning advice can be used with any pointcut.
[[aop-api-advice-introduction]] [[aop-api-advice-introduction]]
=== Introduction Advice === Introduction Advice
@ -501,7 +494,6 @@ Java::
} }
return super.invoke(invocation); return super.invoke(invocation);
} }
} }
---- ----
@ -531,7 +523,6 @@ Kotlin::
} }
return super.invoke(invocation) return super.invoke(invocation)
} }
} }
---- ----
====== ======
@ -582,8 +573,3 @@ We can apply this advisor programmatically by using the `Advised.addAdvisor()` m
(the recommended way) in XML configuration, as any other advisor. All proxy creation (the recommended way) in XML configuration, as any other advisor. All proxy creation
choices discussed below, including "`auto proxy creators,`" correctly handle introductions choices discussed below, including "`auto proxy creators,`" correctly handle introductions
and stateful mixins. and stateful mixins.

View File

@ -142,7 +142,3 @@ case, the `Advised` `isFrozen()` method returns `true`, and any attempts to modi
advice through addition or removal results in an `AopConfigException`. The ability advice through addition or removal results in an `AopConfigException`. The ability
to freeze the state of an advised object is useful in some cases (for example, to to freeze the state of an advised object is useful in some cases (for example, to
prevent calling code removing a security interceptor). prevent calling code removing a security interceptor).

View File

@ -14,7 +14,3 @@ It is possible to mix advisor and advice types in Spring in the same AOP proxy.
example, you could use an interception around advice, throws advice, and before advice in example, you could use an interception around advice, throws advice, and before advice in
one proxy configuration. Spring automatically creates the necessary interceptor one proxy configuration. Spring automatically creates the necessary interceptor
chain. chain.

View File

@ -19,14 +19,12 @@ There are two ways to do this:
auto-proxy creation driven by source-level metadata attributes. auto-proxy creation driven by source-level metadata attributes.
[[aop-autoproxy-choices]] [[aop-autoproxy-choices]]
== Auto-proxy Bean Definitions == Auto-proxy Bean Definitions
This section covers the auto-proxy creators provided by the This section covers the auto-proxy creators provided by the
`org.springframework.aop.framework.autoproxy` package. `org.springframework.aop.framework.autoproxy` package.
[[aop-api-autoproxy]] [[aop-api-autoproxy]]
=== `BeanNameAutoProxyCreator` === `BeanNameAutoProxyCreator`
@ -61,7 +59,6 @@ automatically created by the `BeanNameAutoProxyCreator`. The same advice is appl
to all matching beans. Note that, if advisors are used (rather than the interceptor in to all matching beans. Note that, if advisors are used (rather than the interceptor in
the preceding example), the pointcuts may apply differently to different beans. the preceding example), the pointcuts may apply differently to different beans.
[[aop-api-autoproxy-default]] [[aop-api-autoproxy-default]]
=== `DefaultAdvisorAutoProxyCreator` === `DefaultAdvisorAutoProxyCreator`
@ -125,7 +122,3 @@ differently configured, AdvisorAutoProxyCreators in the same factory) and orderi
Advisors can implement the `org.springframework.core.Ordered` interface to ensure Advisors can implement the `org.springframework.core.Ordered` interface to ensure
correct ordering if this is an issue. The `TransactionAttributeSourceAdvisor` used in the correct ordering if this is an issue. The `TransactionAttributeSourceAdvisor` used in the
preceding example has a configurable order value. The default setting is unordered. preceding example has a configurable order value. The default setting is unordered.

View File

@ -65,7 +65,3 @@ that, if you have a (parent) bean definition that you intend to use only as a te
and this definition specifies a class, you must make sure to set the `abstract` and this definition specifies a class, you must make sure to set the `abstract`
attribute to `true`. Otherwise, the application context actually tries to attribute to `true`. Otherwise, the application context actually tries to
pre-instantiate it. pre-instantiate it.

View File

@ -14,7 +14,6 @@ the pointcuts, any advice that applies, and their ordering. However, there are s
options that are preferable if you do not need such control. options that are preferable if you do not need such control.
[[aop-pfb-1]] [[aop-pfb-1]]
== Basics == Basics
@ -32,7 +31,6 @@ application objects (besides the target, which should be available in any AOP
framework), benefiting from all the pluggability provided by Dependency Injection. framework), benefiting from all the pluggability provided by Dependency Injection.
[[aop-pfb-2]] [[aop-pfb-2]]
== JavaBean Properties == JavaBean Properties
@ -87,7 +85,6 @@ to be applied. You can find an example of using this feature in xref:core/aop-ap
`false`. `false`.
[[aop-pfb-proxy-types]] [[aop-pfb-proxy-types]]
== JDK- and CGLIB-based proxies == JDK- and CGLIB-based proxies
@ -137,7 +134,6 @@ interface that the target class implements to the `proxyInterfaces` property. Ho
it is significantly less work and less prone to typographical errors. it is significantly less work and less prone to typographical errors.
[[aop-api-proxying-intf]] [[aop-api-proxying-intf]]
== Proxying Interfaces == Proxying Interfaces
@ -263,7 +259,6 @@ However, there are times when being able to obtain the un-advised target from th
factory might actually be an advantage (for example, in certain test scenarios). factory might actually be an advantage (for example, in certain test scenarios).
[[aop-api-proxying-class]] [[aop-api-proxying-class]]
== Proxying Classes == Proxying Classes
@ -302,7 +297,6 @@ There is little performance difference between CGLIB proxies and dynamic proxies
Performance should not be a decisive consideration in this case. Performance should not be a decisive consideration in this case.
[[aop-global-advisors]] [[aop-global-advisors]]
== Using "`Global`" Advisors == Using "`Global`" Advisors
@ -325,7 +319,3 @@ two global advisors:
<bean id="global_debug" class="org.springframework.aop.interceptor.DebugInterceptor"/> <bean id="global_debug" class="org.springframework.aop.interceptor.DebugInterceptor"/>
<bean id="global_performance" class="org.springframework.aop.interceptor.PerformanceMonitorInterceptor"/> <bean id="global_performance" class="org.springframework.aop.interceptor.PerformanceMonitorInterceptor"/>
---- ----

View File

@ -4,7 +4,6 @@
This section describes how Spring handles the crucial pointcut concept. This section describes how Spring handles the crucial pointcut concept.
[[aop-api-concepts]] [[aop-api-concepts]]
== Concepts == Concepts
@ -69,7 +68,6 @@ TIP: If possible, try to make pointcuts static, allowing the AOP framework to ca
results of pointcut evaluation when an AOP proxy is created. results of pointcut evaluation when an AOP proxy is created.
[[aop-api-pointcut-ops]] [[aop-api-pointcut-ops]]
== Operations on Pointcuts == Operations on Pointcuts
@ -84,7 +82,6 @@ You can compose pointcuts by using the static methods in the
expressions is usually a simpler approach. expressions is usually a simpler approach.
[[aop-api-pointcuts-aspectj]] [[aop-api-pointcuts-aspectj]]
== AspectJ Expression Pointcuts == AspectJ Expression Pointcuts
@ -95,14 +92,12 @@ uses an AspectJ-supplied library to parse an AspectJ pointcut expression string.
See the xref:core/aop.adoc[previous chapter] for a discussion of supported AspectJ pointcut primitives. See the xref:core/aop.adoc[previous chapter] for a discussion of supported AspectJ pointcut primitives.
[[aop-api-pointcuts-impls]] [[aop-api-pointcuts-impls]]
== Convenience Pointcut Implementations == Convenience Pointcut Implementations
Spring provides several convenient pointcut implementations. You can use some of them Spring provides several convenient pointcut implementations. You can use some of them
directly; others are intended to be subclassed in application-specific pointcuts. directly; others are intended to be subclassed in application-specific pointcuts.
[[aop-api-pointcuts-static]] [[aop-api-pointcuts-static]]
=== Static Pointcuts === Static Pointcuts
@ -146,7 +141,6 @@ You can use `RegexpMethodPointcutAdvisor` with any `Advice` type.
An important type of static pointcut is a metadata-driven pointcut. This uses the An important type of static pointcut is a metadata-driven pointcut. This uses the
values of metadata attributes (typically, source-level metadata). values of metadata attributes (typically, source-level metadata).
[[aop-api-pointcuts-dynamic]] [[aop-api-pointcuts-dynamic]]
=== Dynamic pointcuts === Dynamic pointcuts
@ -172,7 +166,6 @@ other dynamic pointcuts. In Java 1.4, the cost is about five times that of other
pointcuts. pointcuts.
[[aop-api-pointcuts-superclasses]] [[aop-api-pointcuts-superclasses]]
== Pointcut Superclasses == Pointcut Superclasses
@ -214,7 +207,6 @@ There are also superclasses for dynamic pointcuts.
You can use custom pointcuts with any advice type. You can use custom pointcuts with any advice type.
[[aop-api-pointcuts-custom]] [[aop-api-pointcuts-custom]]
== Custom Pointcuts == Custom Pointcuts
@ -225,7 +217,3 @@ expression language, if you can.
NOTE: Later versions of Spring may offer support for "`semantic pointcuts`" as offered by JAC -- NOTE: Later versions of Spring may offer support for "`semantic pointcuts`" as offered by JAC --
for example, "`all methods that change instance variables in the target object.`" for example, "`all methods that change instance variables in the target object.`"

View File

@ -22,7 +22,6 @@ rather than a singleton bean definition. This allows Spring to create a new targ
instance when required. instance when required.
[[aop-ts-swap]] [[aop-ts-swap]]
== Hot-swappable Target Sources == Hot-swappable Target Sources
@ -77,7 +76,6 @@ use a `TargetSource`), any `TargetSource` can be used in conjunction with
arbitrary advice. arbitrary advice.
[[aop-ts-pool]] [[aop-ts-pool]]
== Pooling Target Sources == Pooling Target Sources
@ -175,7 +173,6 @@ Simpler pooling is available by using auto-proxying. You can set the `TargetSour
used by any auto-proxy creator. used by any auto-proxy creator.
[[aop-ts-prototype]] [[aop-ts-prototype]]
== Prototype Target Sources == Prototype Target Sources
@ -200,7 +197,6 @@ The only property is the name of the target bean. Inheritance is used in the
source, the target bean must be a prototype bean definition. source, the target bean must be a prototype bean definition.
[[aop-ts-threadlocal]] [[aop-ts-threadlocal]]
== `ThreadLocal` Target Sources == `ThreadLocal` Target Sources
@ -226,7 +222,3 @@ always remember to correctly set and unset (where the latter involves a call to
any case, since not unsetting it might result in problematic behavior. Spring's any case, since not unsetting it might result in problematic behavior. Spring's
`ThreadLocal` support does this for you and should always be considered in favor of using `ThreadLocal` support does this for you and should always be considered in favor of using
`ThreadLocal` instances without other proper handling code. `ThreadLocal` instances without other proper handling code.

View File

@ -32,7 +32,3 @@ AOP is used in the Spring Framework to:
NOTE: If you are interested only in generic declarative services or other pre-packaged NOTE: If you are interested only in generic declarative services or other pre-packaged
declarative middleware services such as pooling, you do not need to work directly with declarative middleware services such as pooling, you do not need to work directly with
Spring AOP, and can skip most of this chapter. Spring AOP, and can skip most of this chapter.

View File

@ -53,7 +53,3 @@ Kotlin::
====== ======
See the {spring-framework-api}/aop/aspectj/annotation/AspectJProxyFactory.html[javadoc] for more information. See the {spring-framework-api}/aop/aspectj/annotation/AspectJProxyFactory.html[javadoc] for more information.

View File

@ -11,6 +11,3 @@ there is no dependency on the AspectJ compiler or weaver.
NOTE: Using the AspectJ compiler and weaver enables use of the full AspectJ language and NOTE: Using the AspectJ compiler and weaver enables use of the full AspectJ language and
is discussed in xref:core/aop/using-aspectj.adoc[Using AspectJ with Spring Applications]. is discussed in xref:core/aop/using-aspectj.adoc[Using AspectJ with Spring Applications].

View File

@ -937,5 +937,3 @@ reflection for javac-compiled classes). Consider collapsing such advice methods
advice method per join point in each `@Aspect` class or refactor the pieces of advice into advice method per join point in each `@Aspect` class or refactor the pieces of advice into
separate `@Aspect` classes that you can order at the aspect level via `Ordered` or `@Order`. separate `@Aspect` classes that you can order at the aspect level via `Ordered` or `@Order`.
==== ====

View File

@ -32,6 +32,3 @@ stereotype annotation that qualifies, as per the rules of Spring's component sca
NOTE: In Spring AOP, aspects themselves cannot be the targets of advice from other NOTE: In Spring AOP, aspects themselves cannot be the targets of advice from other
aspects. The `@Aspect` annotation on a class marks it as an aspect and, hence, excludes aspects. The `@Aspect` annotation on a class marks it as an aspect and, hence, excludes
it from auto-proxying. it from auto-proxying.

View File

@ -18,7 +18,8 @@ call `proceed` multiple times. The following listing shows the basic aspect impl
include-code::./ConcurrentOperationExecutor[tag=snippet,indent=0] include-code::./ConcurrentOperationExecutor[tag=snippet,indent=0]
`@Around("com.xyz.CommonPointcuts.businessService()")` references the `businessService` named pointcut defined in xref:core/aop/ataspectj/pointcuts.adoc#aop-common-pointcuts[Sharing Named Pointcut Definitions]. `@Around("com.xyz.CommonPointcuts.businessService()")` references the `businessService` named pointcut defined in
xref:core/aop/ataspectj/pointcuts.adoc#aop-common-pointcuts[Sharing Named Pointcut Definitions].
Note that the aspect implements the `Ordered` interface so that we can set the precedence of Note that the aspect implements the `Ordered` interface so that we can set the precedence of
the aspect higher than the transaction advice (we want a fresh transaction each time we the aspect higher than the transaction advice (we want a fresh transaction each time we

View File

@ -60,6 +60,3 @@ Programming Guide for more information on `per` clauses.
The `pertarget` instantiation model works in exactly the same way as `perthis`, but it The `pertarget` instantiation model works in exactly the same way as `perthis`, but it
creates one aspect instance for each unique target object at matched join points. creates one aspect instance for each unique target object at matched join points.

View File

@ -75,5 +75,3 @@ Kotlin::
val usageTracked = context.getBean<UsageTracked>("myService") val usageTracked = context.getBean<UsageTracked>("myService")
---- ----
====== ======

View File

@ -581,6 +581,3 @@ performance (time and memory used), due to extra processing and analysis. Scopin
designators are very fast to match, and using them means AspectJ can very quickly designators are very fast to match, and using them means AspectJ can very quickly
dismiss groups of join points that should not be further processed. A good dismiss groups of join points that should not be further processed. A good
pointcut should always include one if possible. pointcut should always include one if possible.

View File

@ -8,7 +8,6 @@ decisions are influenced by a number of factors including application requiremen
development tools, and team familiarity with AOP. development tools, and team familiarity with AOP.
[[aop-spring-or-aspectj]] [[aop-spring-or-aspectj]]
== Spring AOP or Full AspectJ? == Spring AOP or Full AspectJ?
@ -31,7 +30,6 @@ the @AspectJ style, sticking with regular Java compilation in your IDE, and addi
an aspect weaving phase to your build script. an aspect weaving phase to your build script.
[[aop-ataspectj-or-xml]] [[aop-ataspectj-or-xml]]
== @AspectJ or XML for Spring AOP? == @AspectJ or XML for Spring AOP?
@ -107,7 +105,3 @@ Spring AOP and by AspectJ. So, if you later decide you need the capabilities of
to implement additional requirements, you can easily migrate to a classic AspectJ setup. to implement additional requirements, you can easily migrate to a classic AspectJ setup.
In general, the Spring team prefers the @AspectJ style for custom aspects beyond simple In general, the Spring team prefers the @AspectJ style for custom aspects beyond simple
configuration of enterprise services. configuration of enterprise services.

View File

@ -73,7 +73,3 @@ it from older technologies offering only interception. Pointcuts enable advice t
targeted independently of the object-oriented hierarchy. For example, you can apply an targeted independently of the object-oriented hierarchy. For example, you can apply an
around advice providing declarative transaction management to a set of methods that span around advice providing declarative transaction management to a set of methods that span
multiple objects (such as all business operations in the service layer). multiple objects (such as all business operations in the service layer).

View File

@ -14,9 +14,5 @@ need to advise a method that is not declared on an interface or where you need t
pass a proxied object to a method as a concrete type. pass a proxied object to a method as a concrete type.
It is important to grasp the fact that Spring AOP is proxy-based. See It is important to grasp the fact that Spring AOP is proxy-based. See
xref:core/aop/proxying.adoc#aop-understanding-aop-proxies[Understanding AOP Proxies] for a thorough examination of exactly what this xref:core/aop/proxying.adoc#aop-understanding-aop-proxies[Understanding AOP Proxies]
implementation detail actually means. for a thorough examination of exactly what this implementation detail actually means.

View File

@ -52,10 +52,6 @@ configuration-style approach. The fact that this chapter chooses to introduce th
@AspectJ-style approach first should not be taken as an indication that the Spring team @AspectJ-style approach first should not be taken as an indication that the Spring team
favors the @AspectJ annotation-style approach over the Spring XML configuration-style. favors the @AspectJ annotation-style approach over the Spring XML configuration-style.
See xref:core/aop/choosing.adoc[Choosing which AOP Declaration Style to Use] for a more complete discussion of the advantages and disadvantages of See xref:core/aop/choosing.adoc[Choosing which AOP Declaration Style to Use] for a more
each style. complete discussion of the advantages and disadvantages of each style.
==== ====

View File

@ -6,7 +6,3 @@ It is perfectly possible to mix @AspectJ style aspects by using the auto-proxyin
schema-defined `<aop:aspect>` aspects, `<aop:advisor>` declared advisors, and even proxies schema-defined `<aop:aspect>` aspects, `<aop:advisor>` declared advisors, and even proxies
and interceptors in other styles in the same configuration. All of these are implemented and interceptors in other styles in the same configuration. All of these are implemented
by using the same underlying support mechanism and can co-exist without any difficulty. by using the same underlying support mechanism and can co-exist without any difficulty.

View File

@ -61,7 +61,6 @@ proxies _for all three of them_.
==== ====
[[aop-understanding-aop-proxies]] [[aop-understanding-aop-proxies]]
== Understanding AOP Proxies == Understanding AOP Proxies
@ -291,4 +290,3 @@ Kotlin::
NOTE: AspectJ compile-time weaving and load-time weaving do not have this self-invocation NOTE: AspectJ compile-time weaving and load-time weaving do not have this self-invocation
issue because they apply advice within the bytecode instead of via a proxy. issue because they apply advice within the bytecode instead of via a proxy.

View File

@ -26,7 +26,6 @@ use either only the `<aop:config>` style or only the `AutoProxyCreator` style an
never mix them. never mix them.
[[aop-schema-declaring-an-aspect]] [[aop-schema-declaring-an-aspect]]
== Declaring an Aspect == Declaring an Aspect
@ -54,7 +53,6 @@ The bean that backs the aspect (`aBean` in this case) can of course be configure
dependency injected just like any other Spring bean. dependency injected just like any other Spring bean.
[[aop-schema-pointcuts]] [[aop-schema-pointcuts]]
== Declaring a Pointcut == Declaring a Pointcut
@ -177,9 +175,7 @@ follows:
Note that pointcuts defined in this way are referred to by their XML `id` and cannot be Note that pointcuts defined in this way are referred to by their XML `id` and cannot be
used as named pointcuts to form composite pointcuts. The named pointcut support in the used as named pointcuts to form composite pointcuts. The named pointcut support in the
schema-based definition style is thus more limited than that offered by the @AspectJ schema-based definition style is thus more limited than that offered by the @AspectJ style.
style.
[[aop-schema-advice]] [[aop-schema-advice]]
@ -188,7 +184,6 @@ style.
The schema-based AOP support uses the same five kinds of advice as the @AspectJ style, and they have The schema-based AOP support uses the same five kinds of advice as the @AspectJ style, and they have
exactly the same semantics. exactly the same semantics.
[[aop-schema-advice-before]] [[aop-schema-advice-before]]
=== Before Advice === Before Advice
@ -237,7 +232,6 @@ that contains the advice. Before a data access operation is performed (a method
join point matched by the pointcut expression), the `doAccessCheck` method on the aspect join point matched by the pointcut expression), the `doAccessCheck` method on the aspect
bean is invoked. bean is invoked.
[[aop-schema-advice-after-returning]] [[aop-schema-advice-after-returning]]
=== After Returning Advice === After Returning Advice
@ -295,7 +289,6 @@ Kotlin::
---- ----
====== ======
[[aop-schema-advice-after-throwing]] [[aop-schema-advice-after-throwing]]
=== After Throwing Advice === After Throwing Advice
@ -353,7 +346,6 @@ Kotlin::
---- ----
====== ======
[[aop-schema-advice-after-finally]] [[aop-schema-advice-after-finally]]
=== After (Finally) Advice === After (Finally) Advice
@ -372,7 +364,6 @@ You can declare it by using the `after` element, as the following example shows:
</aop:aspect> </aop:aspect>
---- ----
[[aop-schema-advice-around]] [[aop-schema-advice-around]]
=== Around Advice === Around Advice
@ -444,17 +435,18 @@ Kotlin::
---- ----
====== ======
[[aop-schema-params]] [[aop-schema-params]]
=== Advice Parameters === Advice Parameters
The schema-based declaration style supports fully typed advice in the same way as The schema-based declaration style supports fully typed advice in the same way as
described for the @AspectJ support -- by matching pointcut parameters by name against described for the @AspectJ support -- by matching pointcut parameters by name against
advice method parameters. See xref:core/aop/ataspectj/advice.adoc#aop-ataspectj-advice-params[Advice Parameters] for details. If you wish advice method parameters. See
to explicitly specify argument names for the advice methods (not relying on the xref:core/aop/ataspectj/advice.adoc#aop-ataspectj-advice-params[Advice Parameters] for details.
If you wish to explicitly specify argument names for the advice methods (not relying on the
detection strategies previously described), you can do so by using the `arg-names` detection strategies previously described), you can do so by using the `arg-names`
attribute of the advice element, which is treated in the same manner as the `argNames` attribute of the advice element, which is treated in the same manner as the `argNames`
attribute in an advice annotation (as described in xref:core/aop/ataspectj/advice.adoc#aop-ataspectj-advice-params-names[Determining Argument Names]). attribute in an advice annotation (as described in
xref:core/aop/ataspectj/advice.adoc#aop-ataspectj-advice-params-names[Determining Argument Names]).
The following example shows how to specify an argument name in XML: The following example shows how to specify an argument name in XML:
[source,xml,indent=0,subs="verbatim"] [source,xml,indent=0,subs="verbatim"]
@ -464,7 +456,8 @@ The following example shows how to specify an argument name in XML:
method="audit" method="audit"
arg-names="auditable" /> arg-names="auditable" />
---- ----
<1> References the `publicMethod` named pointcut defined in xref:core/aop/ataspectj/pointcuts.adoc#aop-pointcuts-combining[Combining Pointcut Expressions]. <1> References the `publicMethod` named pointcut defined in
xref:core/aop/ataspectj/pointcuts.adoc#aop-pointcuts-combining[Combining Pointcut Expressions].
The `arg-names` attribute accepts a comma-delimited list of parameter names. The `arg-names` attribute accepts a comma-delimited list of parameter names.
@ -645,15 +638,15 @@ ms % Task name
00000 ? execution(getFoo) 00000 ? execution(getFoo)
---- ----
[[aop-ordering]] [[aop-ordering]]
=== Advice Ordering === Advice Ordering
When multiple pieces of advice need to run at the same join point (executing method) When multiple pieces of advice need to run at the same join point (executing method)
the ordering rules are as described in xref:core/aop/ataspectj/advice.adoc#aop-ataspectj-advice-ordering[Advice Ordering]. The precedence the ordering rules are as described in
between aspects is determined via the `order` attribute in the `<aop:aspect>` element or xref:core/aop/ataspectj/advice.adoc#aop-ataspectj-advice-ordering[Advice Ordering]. The
by either adding the `@Order` annotation to the bean that backs the aspect or by having precedence between aspects is determined via the `order` attribute in the `<aop:aspect>`
the bean implement the `Ordered` interface. element or by either adding the `@Order` annotation to the bean that backs the aspect
or by having the bean implement the `Ordered` interface.
[NOTE] [NOTE]
==== ====
@ -676,7 +669,6 @@ at the aspect level.
==== ====
[[aop-schema-introductions]] [[aop-schema-introductions]]
== Introductions == Introductions
@ -756,7 +748,6 @@ Kotlin::
====== ======
[[aop-schema-instantiation-models]] [[aop-schema-instantiation-models]]
== Aspect Instantiation Models == Aspect Instantiation Models
@ -764,7 +755,6 @@ The only supported instantiation model for schema-defined aspects is the singlet
model. Other instantiation models may be supported in future releases. model. Other instantiation models may be supported in future releases.
[[aop-schema-advisors]] [[aop-schema-advisors]]
== Advisors == Advisors
@ -772,7 +762,8 @@ The concept of "advisors" comes from the AOP support defined in Spring
and does not have a direct equivalent in AspectJ. An advisor is like a small and does not have a direct equivalent in AspectJ. An advisor is like a small
self-contained aspect that has a single piece of advice. The advice itself is self-contained aspect that has a single piece of advice. The advice itself is
represented by a bean and must implement one of the advice interfaces described in represented by a bean and must implement one of the advice interfaces described in
xref:core/aop-api/advice.adoc#aop-api-advice-types[Advice Types in Spring]. Advisors can take advantage of AspectJ pointcut expressions. xref:core/aop-api/advice.adoc#aop-api-advice-types[Advice Types in Spring].
Advisors can take advantage of AspectJ pointcut expressions.
Spring supports the advisor concept with the `<aop:advisor>` element. You most Spring supports the advisor concept with the `<aop:advisor>` element. You most
commonly see it used in conjunction with transactional advice, which also has its own commonly see it used in conjunction with transactional advice, which also has its own
@ -805,7 +796,6 @@ To define the precedence of an advisor so that the advice can participate in ord
use the `order` attribute to define the `Ordered` value of the advisor. use the `order` attribute to define the `Ordered` value of the advisor.
[[aop-schema-example]] [[aop-schema-example]]
== An AOP Schema Example == An AOP Schema Example
@ -981,7 +971,3 @@ pointcut expression so that only `@Idempotent` operations match, as follows:
expression="execution(* com.xyz.service.*.*(..)) and expression="execution(* com.xyz.service.*.*(..)) and
@annotation(com.xyz.service.Idempotent)"/> @annotation(com.xyz.service.Idempotent)"/>
---- ----

View File

@ -8,12 +8,14 @@ alone.
Spring ships with a small AspectJ aspect library, which is available stand-alone in your Spring ships with a small AspectJ aspect library, which is available stand-alone in your
distribution as `spring-aspects.jar`. You need to add this to your classpath in order distribution as `spring-aspects.jar`. You need to add this to your classpath in order
to use the aspects in it. xref:core/aop/using-aspectj.adoc#aop-atconfigurable[Using AspectJ to Dependency Inject Domain Objects with Spring] and xref:core/aop/using-aspectj.adoc#aop-ajlib-other[Other Spring aspects for AspectJ] discuss the to use the aspects in it.
content of this library and how you can use it. xref:core/aop/using-aspectj.adoc#aop-aj-configure[Configuring AspectJ Aspects by Using Spring IoC] discusses how to xref:core/aop/using-aspectj.adoc#aop-atconfigurable[Using AspectJ to Dependency Inject Domain Objects with Spring]
dependency inject AspectJ aspects that are woven using the AspectJ compiler. Finally, and xref:core/aop/using-aspectj.adoc#aop-ajlib-other[Other Spring aspects for AspectJ]
xref:core/aop/using-aspectj.adoc#aop-aj-ltw[Load-time Weaving with AspectJ in the Spring Framework] provides an introduction to load-time weaving for Spring applications discuss the content of this library and how you can use it.
that use AspectJ. xref:core/aop/using-aspectj.adoc#aop-aj-configure[Configuring AspectJ Aspects by Using Spring IoC]
discusses how to dependency inject AspectJ aspects that are woven using the AspectJ compiler. Finally,
xref:core/aop/using-aspectj.adoc#aop-aj-ltw[Load-time Weaving with AspectJ in the Spring Framework]
provides an introduction to load-time weaving for Spring applications that use AspectJ.
[[aop-atconfigurable]] [[aop-atconfigurable]]
@ -206,7 +208,6 @@ not use `@Configurable` on bean classes that are registered as regular Spring be
with the container. Doing so results in double initialization, once through the with the container. Doing so results in double initialization, once through the
container and once through the aspect. container and once through the aspect.
[[aop-configurable-testing]] [[aop-configurable-testing]]
=== Unit Testing `@Configurable` Objects === Unit Testing `@Configurable` Objects
@ -219,7 +220,6 @@ you can still unit test outside of the container as normal, but you see a warnin
message each time that you construct a `@Configurable` object indicating that it has message each time that you construct a `@Configurable` object indicating that it has
not been configured by Spring. not been configured by Spring.
[[aop-configurable-container]] [[aop-configurable-container]]
=== Working with Multiple Application Contexts === Working with Multiple Application Contexts
@ -249,7 +249,6 @@ is added only to the container-wide classpath (and hence loaded by the shared pa
not what you want). not what you want).
[[aop-ajlib-other]] [[aop-ajlib-other]]
== Other Spring aspects for AspectJ == Other Spring aspects for AspectJ
@ -302,7 +301,6 @@ fully qualified class names:
---- ----
[[aop-aj-configure]] [[aop-aj-configure]]
== Configuring AspectJ Aspects by Using Spring IoC == Configuring AspectJ Aspects by Using Spring IoC
@ -357,7 +355,6 @@ results in the creation of Spring AOP proxies. The @AspectJ style of aspect
declaration is being used here, but the AspectJ runtime is not involved. declaration is being used here, but the AspectJ runtime is not involved.
[[aop-aj-ltw]] [[aop-aj-ltw]]
== Load-time Weaving with AspectJ in the Spring Framework == Load-time Weaving with AspectJ in the Spring Framework
@ -391,7 +388,6 @@ LTW that uses Spring, followed by detailed specifics about elements introduced i
example. For a complete example, see the example. For a complete example, see the
{petclinic-github-org}/spring-framework-petclinic[Petclinic sample application based on Spring Framework]. {petclinic-github-org}/spring-framework-petclinic[Petclinic sample application based on Spring Framework].
[[aop-aj-ltw-first-example]] [[aop-aj-ltw-first-example]]
=== A First Example === A First Example
@ -677,7 +673,6 @@ nice example of a development-time aspect that developers can use during develop
and then easily exclude from builds of the application being deployed and then easily exclude from builds of the application being deployed
into UAT or production. into UAT or production.
[[aop-aj-ltw-the-aspects]] [[aop-aj-ltw-the-aspects]]
=== Aspects === Aspects
@ -686,7 +681,6 @@ either the AspectJ language itself, or you can write your aspects in the @Aspect
Your aspects are then both valid AspectJ and Spring AOP aspects. Your aspects are then both valid AspectJ and Spring AOP aspects.
Furthermore, the compiled aspect classes need to be available on the classpath. Furthermore, the compiled aspect classes need to be available on the classpath.
[[aop-aj-ltw-aop_dot_xml]] [[aop-aj-ltw-aop_dot_xml]]
=== `META-INF/aop.xml` === `META-INF/aop.xml`
@ -716,7 +710,6 @@ The structure and contents of this file is detailed in the LTW part of the
{aspectj-docs-devguide}/ltw-configuration.html[AspectJ reference {aspectj-docs-devguide}/ltw-configuration.html[AspectJ reference
documentation]. Because the `aop.xml` file is 100% AspectJ, we do not describe it further here. documentation]. Because the `aop.xml` file is 100% AspectJ, we do not describe it further here.
[[aop-aj-ltw-libraries]] [[aop-aj-ltw-libraries]]
=== Required libraries (JARS) === Required libraries (JARS)
@ -731,7 +724,6 @@ If you use the xref:core/aop/using-aspectj.adoc#aop-aj-ltw-environments-generic[
* `spring-instrument.jar` * `spring-instrument.jar`
[[aop-aj-ltw-spring]] [[aop-aj-ltw-spring]]
=== Spring Configuration === Spring Configuration
@ -831,7 +823,6 @@ possible values:
then AspectJ weaving is on. Otherwise, it is off. This is the default value. then AspectJ weaving is on. Otherwise, it is off. This is the default value.
|=== |===
[[aop-aj-ltw-environments]] [[aop-aj-ltw-environments]]
=== Environment-specific Configuration === Environment-specific Configuration
@ -880,7 +871,3 @@ Note that this requires modification of the JVM launch script, which may prevent
from using this in application server environments (depending on your server and your from using this in application server environments (depending on your server and your
operation policies). That said, for one-app-per-JVM deployments such as standalone operation policies). That said, for one-app-per-JVM deployments such as standalone
Spring Boot applications, you typically control the entire JVM setup in any case. Spring Boot applications, you typically control the entire JVM setup in any case.

View File

@ -5,6 +5,7 @@ This chapter covers Spring's Ahead of Time (AOT) optimizations.
For AOT support specific to integration tests, see xref:testing/testcontext-framework/aot.adoc[Ahead of Time Support for Tests]. For AOT support specific to integration tests, see xref:testing/testcontext-framework/aot.adoc[Ahead of Time Support for Tests].
[[aot.introduction]] [[aot.introduction]]
== Introduction to Ahead of Time Optimizations == Introduction to Ahead of Time Optimizations
@ -35,6 +36,7 @@ A Spring AOT processed application typically generates:
NOTE: At the moment, AOT is focused on allowing Spring applications to be deployed as native images using GraalVM. NOTE: At the moment, AOT is focused on allowing Spring applications to be deployed as native images using GraalVM.
We intend to support more JVM-based use cases in future generations. We intend to support more JVM-based use cases in future generations.
[[aot.basics]] [[aot.basics]]
== AOT Engine Overview == AOT Engine Overview
@ -51,6 +53,7 @@ The `RuntimeHints` instance can also be used to generate the relevant GraalVM na
Those steps are covered in greater detail in the sections below. Those steps are covered in greater detail in the sections below.
[[aot.refresh]] [[aot.refresh]]
== Refresh for AOT Processing == Refresh for AOT Processing
@ -88,6 +91,7 @@ This makes sure to create any proxy that will be required at runtime.
Once this part completes, the `BeanFactory` contains the bean definitions that are necessary for the application to run. It does not trigger bean instantiation but allows the AOT engine to inspect the beans that will be created at runtime. Once this part completes, the `BeanFactory` contains the bean definitions that are necessary for the application to run. It does not trigger bean instantiation but allows the AOT engine to inspect the beans that will be created at runtime.
[[aot.bean-factory-initialization-contributions]] [[aot.bean-factory-initialization-contributions]]
== Bean Factory Initialization AOT Contributions == Bean Factory Initialization AOT Contributions
@ -110,7 +114,6 @@ We generally recommend that this interface is only implemented by infrastructure
If such a bean is registered using an `@Bean` factory method, ensure the method is `static` so that its enclosing `@Configuration` class does not have to be initialized. If such a bean is registered using an `@Bean` factory method, ensure the method is `static` so that its enclosing `@Configuration` class does not have to be initialized.
==== ====
[[aot.bean-registration-contributions]] [[aot.bean-registration-contributions]]
=== Bean Registration AOT Contributions === Bean Registration AOT Contributions
@ -224,6 +227,7 @@ There is a bean definition for `dataSourceConfiguration` and one for `dataSource
When a `datasource` instance is required, a `BeanInstanceSupplier` is called. When a `datasource` instance is required, a `BeanInstanceSupplier` is called.
This supplier invokes the `dataSource()` method on the `dataSourceConfiguration` bean. This supplier invokes the `dataSource()` method on the `dataSourceConfiguration` bean.
[[aot.running]] [[aot.running]]
== Running with AOT Optimizations == Running with AOT Optimizations
@ -235,6 +239,7 @@ NOTE: When AOT optimizations are included, some decisions that have been made at
are hard coded in the application setup. For instance, profiles that have been enabled at are hard coded in the application setup. For instance, profiles that have been enabled at
build time are automatically enabled at runtime as well. build time are automatically enabled at runtime as well.
[[aot.bestpractices]] [[aot.bestpractices]]
== Best Practices == Best Practices
@ -564,6 +569,7 @@ Kotlin::
---- ----
====== ======
[[aot.hints]] [[aot.hints]]
== Runtime Hints == Runtime Hints
@ -598,7 +604,6 @@ For instance, the return type of a `@Controller` method is inspected, and releva
For cases that the core container cannot infer, you can register such hints programmatically. For cases that the core container cannot infer, you can register such hints programmatically.
A number of convenient annotations are also provided for common use cases. A number of convenient annotations are also provided for common use cases.
[[aot.hints.import-runtime-hints]] [[aot.hints.import-runtime-hints]]
=== `@ImportRuntimeHints` === `@ImportRuntimeHints`
@ -616,7 +621,6 @@ This way, if the component is not contributed to the `BeanFactory`, the hints wi
It is also possible to register an implementation statically by adding an entry in `META-INF/spring/aot.factories` with a key equal to the fully-qualified name of the `RuntimeHintsRegistrar` interface. It is also possible to register an implementation statically by adding an entry in `META-INF/spring/aot.factories` with a key equal to the fully-qualified name of the `RuntimeHintsRegistrar` interface.
[[aot.hints.reflective]] [[aot.hints.reflective]]
=== `@Reflective` === `@Reflective`
@ -639,7 +643,6 @@ This can be tuned by specifying a custom `ReflectiveProcessor` implementation vi
Library authors can reuse this annotation for their own purposes. Library authors can reuse this annotation for their own purposes.
An example of such customization is covered in the next section. An example of such customization is covered in the next section.
[[aot.hints.register-reflection]] [[aot.hints.register-reflection]]
=== `@RegisterReflection` === `@RegisterReflection`

View File

@ -1,7 +1,3 @@
[[appendix]] [[appendix]]
= Appendix = Appendix
:page-section-summary-toc: 1 :page-section-summary-toc: 1

View File

@ -12,7 +12,6 @@ Spring's extensible XML configuration mechanism is based on XML Schema. If you a
familiar with Spring's current XML configuration extensions that come with the standard familiar with Spring's current XML configuration extensions that come with the standard
Spring distribution, you should first read the previous section on xref:core/appendix/xsd-schemas.adoc[XML Schemas]. Spring distribution, you should first read the previous section on xref:core/appendix/xsd-schemas.adoc[XML Schemas].
To create new XML configuration extensions: To create new XML configuration extensions:
. xref:core/appendix/xml-custom.adoc#core.appendix.xsd-custom-schema[Author] an XML schema to describe your custom element(s). . xref:core/appendix/xml-custom.adoc#core.appendix.xsd-custom-schema[Author] an XML schema to describe your custom element(s).
@ -38,7 +37,6 @@ examples follow later in this appendix. The intent of this first simple example
through the basic steps of making a custom extension.) through the basic steps of making a custom extension.)
[[xsd-custom-schema]] [[xsd-custom-schema]]
== Authoring the Schema == Authoring the Schema
@ -110,7 +108,6 @@ can use autocompletion to let a user choose between several configuration option
defined in the enumeration. defined in the enumeration.
[[xsd-custom-namespacehandler]] [[xsd-custom-namespacehandler]]
== Coding a `NamespaceHandler` == Coding a `NamespaceHandler`
@ -187,7 +184,6 @@ means that each `BeanDefinitionParser` contains only the logic for parsing a sin
custom element, as we can see in the next step. custom element, as we can see in the next step.
[[xsd-custom-parser]] [[xsd-custom-parser]]
== Using `BeanDefinitionParser` == Using `BeanDefinitionParser`
@ -276,13 +272,11 @@ the basic grunt work of creating a single `BeanDefinition`.
single `BeanDefinition` represents. single `BeanDefinition` represents.
====== ======
In this simple case, this is all that we need to do. The creation of our single In this simple case, this is all that we need to do. The creation of our single
`BeanDefinition` is handled by the `AbstractSingleBeanDefinitionParser` superclass, as `BeanDefinition` is handled by the `AbstractSingleBeanDefinitionParser` superclass, as
is the extraction and setting of the bean definition's unique identifier. is the extraction and setting of the bean definition's unique identifier.
[[xsd-custom-registration]] [[xsd-custom-registration]]
== Registering the Handler and the Schema == Registering the Handler and the Schema
@ -294,7 +288,6 @@ can, for example, be distributed alongside your binary classes in a JAR file. Th
XML parsing infrastructure automatically picks up your new extension by consuming XML parsing infrastructure automatically picks up your new extension by consuming
these special properties files, the formats of which are detailed in the next two sections. these special properties files, the formats of which are detailed in the next two sections.
[[xsd-custom-registration-spring-handlers]] [[xsd-custom-registration-spring-handlers]]
=== Writing `META-INF/spring.handlers` === Writing `META-INF/spring.handlers`
@ -313,7 +306,6 @@ The first part (the key) of the key-value pair is the URI associated with your c
namespace extension and needs to exactly match exactly the value of the `targetNamespace` namespace extension and needs to exactly match exactly the value of the `targetNamespace`
attribute, as specified in your custom XSD schema. attribute, as specified in your custom XSD schema.
[[xsd-custom-registration-spring-schemas]] [[xsd-custom-registration-spring-schemas]]
=== Writing 'META-INF/spring.schemas' === Writing 'META-INF/spring.schemas'
@ -337,7 +329,6 @@ You are encouraged to deploy your XSD file (or files) right alongside
the `NamespaceHandler` and `BeanDefinitionParser` classes on the classpath. the `NamespaceHandler` and `BeanDefinitionParser` classes on the classpath.
[[xsd-custom-using]] [[xsd-custom-using]]
== Using a Custom Extension in Your Spring XML Configuration == Using a Custom Extension in Your Spring XML Configuration
@ -371,13 +362,11 @@ in a Spring XML configuration file:
<1> Our custom bean. <1> Our custom bean.
[[xsd-custom-meat]] [[xsd-custom-meat]]
== More Detailed Examples == More Detailed Examples
This section presents some more detailed examples of custom XML extensions. This section presents some more detailed examples of custom XML extensions.
[[xsd-custom-custom-nested]] [[xsd-custom-custom-nested]]
=== Nesting Custom Elements within Custom Elements === Nesting Custom Elements within Custom Elements
@ -753,7 +742,6 @@ http\://www.foo.example/schema/component=com.foo.ComponentNamespaceHandler
http\://www.foo.example/schema/component/component.xsd=com/foo/component.xsd http\://www.foo.example/schema/component/component.xsd=com/foo/component.xsd
---- ----
[[xsd-custom-custom-just-attributes]] [[xsd-custom-custom-just-attributes]]
=== Custom Attributes on "`Normal`" Elements === Custom Attributes on "`Normal`" Elements
@ -1007,5 +995,3 @@ http\://www.foo.example/schema/jcache=com.foo.JCacheNamespaceHandler
# in 'META-INF/spring.schemas' # in 'META-INF/spring.schemas'
http\://www.foo.example/schema/jcache/jcache.xsd=com/foo/jcache.xsd http\://www.foo.example/schema/jcache/jcache.xsd=com/foo/jcache.xsd
---- ----

View File

@ -4,7 +4,6 @@
This part of the appendix lists XML schemas related to the core container. This part of the appendix lists XML schemas related to the core container.
[[xsd-schemas-util]] [[xsd-schemas-util]]
== The `util` Schema == The `util` Schema
@ -29,7 +28,6 @@ correct schema so that the tags in the `util` namespace are available to you):
</beans> </beans>
---- ----
[[xsd-schemas-util-constant]] [[xsd-schemas-util-constant]]
=== Using `<util:constant/>` === Using `<util:constant/>`
@ -186,7 +184,6 @@ Kotlin::
</bean> </bean>
---- ----
[[xsd-schemas-util-property-path]] [[xsd-schemas-util-property-path]]
=== Using `<util:property-path/>` === Using `<util:property-path/>`
@ -308,7 +305,6 @@ You can specifically set the result type in the actual definition. This is not n
for most use cases, but it can sometimes be useful. See the javadoc for more info on for most use cases, but it can sometimes be useful. See the javadoc for more info on
this feature. this feature.
[[xsd-schemas-util-properties]] [[xsd-schemas-util-properties]]
=== Using `<util:properties/>` === Using `<util:properties/>`
@ -334,7 +330,6 @@ The following example uses a `util:properties` element to make a more concise re
<util:properties id="jdbcConfiguration" location="classpath:com/foo/jdbc-production.properties"/> <util:properties id="jdbcConfiguration" location="classpath:com/foo/jdbc-production.properties"/>
---- ----
[[xsd-schemas-util-list]] [[xsd-schemas-util-list]]
=== Using `<util:list/>` === Using `<util:list/>`
@ -389,7 +384,6 @@ following configuration:
If no `list-class` attribute is supplied, the container chooses a `List` implementation. If no `list-class` attribute is supplied, the container chooses a `List` implementation.
[[xsd-schemas-util-map]] [[xsd-schemas-util-map]]
=== Using `<util:map/>` === Using `<util:map/>`
@ -444,7 +438,6 @@ following configuration:
If no `'map-class'` attribute is supplied, the container chooses a `Map` implementation. If no `'map-class'` attribute is supplied, the container chooses a `Map` implementation.
[[xsd-schemas-util-set]] [[xsd-schemas-util-set]]
=== Using `<util:set/>` === Using `<util:set/>`
@ -500,7 +493,6 @@ following configuration:
If no `set-class` attribute is supplied, the container chooses a `Set` implementation. If no `set-class` attribute is supplied, the container chooses a `Set` implementation.
[[xsd-schemas-aop]] [[xsd-schemas-aop]]
== The `aop` Schema == The `aop` Schema
@ -530,7 +522,6 @@ are available to you):
---- ----
[[xsd-schemas-context]] [[xsd-schemas-context]]
== The `context` Schema == The `context` Schema
@ -555,7 +546,6 @@ available to you:
</beans> </beans>
---- ----
[[xsd-schemas-context-pphc]] [[xsd-schemas-context-pphc]]
=== Using `<property-placeholder/>` === Using `<property-placeholder/>`
@ -599,34 +589,25 @@ element for that purpose. Similarly, Spring's
xref:integration/cache/annotations.adoc[caching annotations] need to be explicitly xref:integration/cache/annotations.adoc[caching annotations] need to be explicitly
xref:integration/cache/annotations.adoc#cache-annotation-enable[enabled] as well. xref:integration/cache/annotations.adoc#cache-annotation-enable[enabled] as well.
[[xsd-schemas-context-component-scan]] [[xsd-schemas-context-component-scan]]
=== Using `<component-scan/>` === Using `<component-scan/>`
This element is detailed in the section on xref:core/beans/annotation-config.adoc[annotation-based container configuration] This element is detailed in the section on xref:core/beans/annotation-config.adoc[annotation-based container configuration].
.
[[xsd-schemas-context-ltw]] [[xsd-schemas-context-ltw]]
=== Using `<load-time-weaver/>` === Using `<load-time-weaver/>`
This element is detailed in the section on xref:core/aop/using-aspectj.adoc#aop-aj-ltw[load-time weaving with AspectJ in the Spring Framework] This element is detailed in the section on xref:core/aop/using-aspectj.adoc#aop-aj-ltw[load-time weaving with AspectJ in the Spring Framework].
.
[[xsd-schemas-context-sc]] [[xsd-schemas-context-sc]]
=== Using `<spring-configured/>` === Using `<spring-configured/>`
This element is detailed in the section on xref:core/aop/using-aspectj.adoc#aop-atconfigurable[using AspectJ to dependency inject domain objects with Spring] This element is detailed in the section on xref:core/aop/using-aspectj.adoc#aop-atconfigurable[using AspectJ to dependency inject domain objects with Spring].
.
[[xsd-schemas-context-mbe]] [[xsd-schemas-context-mbe]]
=== Using `<mbean-export/>` === Using `<mbean-export/>`
This element is detailed in the section on xref:integration/jmx/naming.adoc#jmx-context-mbeanexport[configuring annotation-based MBean export] This element is detailed in the section on xref:integration/jmx/naming.adoc#jmx-context-mbeanexport[configuring annotation-based MBean export].
.
[[xsd-schemas-beans]] [[xsd-schemas-beans]]
@ -666,7 +647,3 @@ as it stands).
In the case of the preceding example, you could assume that there is some logic that consumes In the case of the preceding example, you could assume that there is some logic that consumes
the bean definition and sets up some caching infrastructure that uses the supplied metadata. the bean definition and sets up some caching infrastructure that uses the supplied metadata.

View File

@ -3,7 +3,3 @@
:page-section-summary-toc: 1 :page-section-summary-toc: 1
This chapter covers Spring's Inversion of Control (IoC) container. This chapter covers Spring's Inversion of Control (IoC) container.

View File

@ -62,6 +62,3 @@ application context in which it is defined. This means that, if you put
it only checks for `@Autowired` beans in your controllers, and not your services. See it only checks for `@Autowired` beans in your controllers, and not your services. See
xref:web/webmvc/mvc-servlet.adoc[The DispatcherServlet] for more information. xref:web/webmvc/mvc-servlet.adoc[The DispatcherServlet] for more information.
==== ====

View File

@ -152,6 +152,3 @@ The corresponding bean definitions follow:
</beans> </beans>
---- ----

View File

@ -568,6 +568,3 @@ the following example:
</beans> </beans>
---- ----
-- --

View File

@ -530,6 +530,3 @@ The `@Autowired`, `@Inject`, `@Value`, and `@Resource` annotations are handled b
within your own `BeanPostProcessor` or `BeanFactoryPostProcessor` types (if any). within your own `BeanPostProcessor` or `BeanFactoryPostProcessor` types (if any).
These types must be 'wired up' explicitly by using XML or a Spring `@Bean` method. These types must be 'wired up' explicitly by using XML or a Spring `@Bean` method.
==== ====

View File

@ -28,6 +28,3 @@ with the `CustomAutowireConfigurer`
When multiple beans qualify as autowire candidates, the determination of a "`primary`" is When multiple beans qualify as autowire candidates, the determination of a "`primary`" is
as follows: If exactly one bean definition among the candidates has a `primary` as follows: If exactly one bean definition among the candidates has a `primary`
attribute set to `true`, it is selected. attribute set to `true`, it is selected.

View File

@ -96,6 +96,3 @@ Kotlin::
private lateinit var s: List<Store<Integer>> private lateinit var s: List<Store<Integer>>
---- ----
====== ======

View File

@ -64,7 +64,3 @@ JDK 11. As of Jakarta EE 9, the package lives in `jakarta.annotation` now. If ne
the `jakarta.annotation-api` artifact needs to be obtained via Maven Central now, the `jakarta.annotation-api` artifact needs to be obtained via Maven Central now,
simply to be added to the application's classpath like any other library. simply to be added to the application's classpath like any other library.
==== ====

View File

@ -142,4 +142,3 @@ Kotlin::
`ApplicationContext`. `ApplicationContext`.
====== ======
-- --

View File

@ -241,5 +241,3 @@ Kotlin::
@Value("#{{'Thriller': 100, 'Comedy': 300}}") private val countOfMoviesPerCatalog: Map<String, Int>) @Value("#{{'Thriller': 100, 'Comedy': 300}}") private val countOfMoviesPerCatalog: Map<String, Int>)
---- ----
====== ======

View File

@ -29,7 +29,6 @@ created and initialized, you have a fully configured and executable system or ap
image::container-magic.png[] image::container-magic.png[]
[[beans-factory-metadata]] [[beans-factory-metadata]]
== Configuration Metadata == Configuration Metadata
@ -63,8 +62,6 @@ Typically, one does not configure fine-grained domain objects in the container,
it is usually the responsibility of repositories and business logic to create and load it is usually the responsibility of repositories and business logic to create and load
domain objects. domain objects.
[[beans-factory-xml]] [[beans-factory-xml]]
=== XML as an External Configuration DSL === XML as an External Configuration DSL
@ -188,7 +185,6 @@ definition. This linkage between `id` and `ref` elements expresses the dependenc
collaborating objects. For details of configuring an object's dependencies, see collaborating objects. For details of configuring an object's dependencies, see
xref:core/beans/dependencies.adoc[Dependencies]. xref:core/beans/dependencies.adoc[Dependencies].
[[beans-factory-xml-import]] [[beans-factory-xml-import]]
=== Composing XML-based Configuration Metadata === Composing XML-based Configuration Metadata
@ -244,7 +240,6 @@ The namespace itself provides the import directive feature. Further
configuration features beyond plain bean definitions are available in a selection configuration features beyond plain bean definitions are available in a selection
of XML namespaces provided by Spring -- for example, the `context` and `util` namespaces. of XML namespaces provided by Spring -- for example, the `context` and `util` namespaces.
[[beans-factory-groovy]] [[beans-factory-groovy]]
=== The Groovy Bean Definition DSL === The Groovy Bean Definition DSL
@ -279,7 +274,6 @@ supports Spring's XML configuration namespaces. It also allows for importing XML
bean definition files through an `importBeans` directive. bean definition files through an `importBeans` directive.
[[beans-factory-client]] [[beans-factory-client]]
== Using the Container == Using the Container
@ -403,6 +397,3 @@ code should never use them. Indeed, your application code should have no calls t
Spring's integration with web frameworks provides dependency injection for various web Spring's integration with web frameworks provides dependency injection for various web
framework components such as controllers and JSF-managed beans, letting you declare framework components such as controllers and JSF-managed beans, letting you declare
a dependency on a specific bean through metadata (such as an autowiring annotation). a dependency on a specific bean through metadata (such as an autowiring annotation).

View File

@ -21,7 +21,6 @@ operate on shared `BeanDefinition` objects as a core metadata representation.
This is the essence of what makes Spring's container so flexible and extensible. This is the essence of what makes Spring's container so flexible and extensible.
[[context-introduction-ctx-vs-beanfactory]] [[context-introduction-ctx-vs-beanfactory]]
== `BeanFactory` or `ApplicationContext`? == `BeanFactory` or `ApplicationContext`?

View File

@ -78,7 +78,3 @@ important (at least for singleton beans) that if you have a (parent) bean defini
which you intend to use only as a template, and this definition specifies a class, you which you intend to use only as a template, and this definition specifies a class, you
must make sure to set the __abstract__ attribute to __true__, otherwise the application must make sure to set the __abstract__ attribute to __true__, otherwise the application
context will actually (attempt to) pre-instantiate the `abstract` bean. context will actually (attempt to) pre-instantiate the `abstract` bean.

View File

@ -22,7 +22,6 @@ use these features.
==== ====
[[beans-stereotype-annotations]] [[beans-stereotype-annotations]]
== `@Component` and Further Stereotype Annotations == `@Component` and Further Stereotype Annotations
@ -46,7 +45,6 @@ clearly the better choice. Similarly, as stated earlier, `@Repository` is alread
supported as a marker for automatic exception translation in your persistence layer. supported as a marker for automatic exception translation in your persistence layer.
[[beans-meta-annotations]] [[beans-meta-annotations]]
== Using Meta-annotations and Composed Annotations == Using Meta-annotations and Composed Annotations
@ -195,7 +193,6 @@ For further details, see the
wiki page. wiki page.
[[beans-scanning-autodetection]] [[beans-scanning-autodetection]]
== Automatically Detecting Classes and Registering Bean Definitions == Automatically Detecting Classes and Registering Bean Definitions
@ -334,7 +331,6 @@ NOTE: You can disable the registration of `AutowiredAnnotationBeanPostProcessor`
with a value of `false`. with a value of `false`.
[[beans-scanning-filters]] [[beans-scanning-filters]]
== Using Filters to Customize Scanning == Using Filters to Customize Scanning
@ -426,7 +422,6 @@ annotated or meta-annotated with `@Component`, `@Repository`, `@Service`, `@Cont
`@RestController`, or `@Configuration`. `@RestController`, or `@Configuration`.
[[beans-factorybeans-annotations]] [[beans-factorybeans-annotations]]
== Defining Bean Metadata within Components == Defining Bean Metadata within Components
@ -663,7 +658,6 @@ analogous to how the container selects between multiple `@Autowired` constructor
==== ====
[[beans-scanning-name-generator]] [[beans-scanning-name-generator]]
== Naming Autodetected Components == Naming Autodetected Components
@ -797,7 +791,6 @@ components may be making explicit references to it. On the other hand, the
auto-generated names are adequate whenever the container is responsible for wiring. auto-generated names are adequate whenever the container is responsible for wiring.
[[beans-scanning-scope-resolver]] [[beans-scanning-scope-resolver]]
== Providing a Scope for Autodetected Components == Providing a Scope for Autodetected Components
@ -920,7 +913,6 @@ Kotlin::
---- ----
[[beans-scanning-qualifiers]] [[beans-scanning-qualifiers]]
== Providing Qualifier Metadata with Annotations == Providing Qualifier Metadata with Annotations
@ -1012,7 +1004,3 @@ NOTE: As with most annotation-based alternatives, keep in mind that the annotati
bound to the class definition itself, while the use of XML allows for multiple beans bound to the class definition itself, while the use of XML allows for multiple beans
of the same type to provide variations in their qualifier metadata, because that of the same type to provide variations in their qualifier metadata, because that
metadata is provided per-instance rather than per-class. metadata is provided per-instance rather than per-class.

View File

@ -24,7 +24,6 @@ package also provides the following functionality:
`HierarchicalBeanFactory` interface. `HierarchicalBeanFactory` interface.
[[context-functionality-messagesource]] [[context-functionality-messagesource]]
== Internationalization using `MessageSource` == Internationalization using `MessageSource`
@ -273,7 +272,6 @@ See the {spring-framework-api}/context/support/ReloadableResourceBundleMessageSo
javadoc for details. javadoc for details.
[[context-functionality-events]] [[context-functionality-events]]
== Standard and Custom Events == Standard and Custom Events
@ -534,7 +532,6 @@ complete support for building lightweight,
https://www.enterpriseintegrationpatterns.com[pattern-oriented], event-driven https://www.enterpriseintegrationpatterns.com[pattern-oriented], event-driven
architectures that build upon the well-known Spring programming model. architectures that build upon the well-known Spring programming model.
[[context-functionality-events-annotation]] [[context-functionality-events-annotation]]
=== Annotation-based Event Listeners === Annotation-based Event Listeners
@ -707,7 +704,6 @@ The `handleBlockedListEvent()` method publishes a new `ListUpdateEvent` for ever
`BlockedListEvent` that it handles. If you need to publish several events, you can return `BlockedListEvent` that it handles. If you need to publish several events, you can return
a `Collection` or an array of events instead. a `Collection` or an array of events instead.
[[context-functionality-events-async]] [[context-functionality-events-async]]
=== Asynchronous Listeners === Asynchronous Listeners
@ -754,7 +750,6 @@ Be aware of the following limitations when using asynchronous events:
See xref:integration/observability.adoc#observability.application-events[the `@EventListener` Observability section] See xref:integration/observability.adoc#observability.application-events[the `@EventListener` Observability section]
for more information on Observability concerns. for more information on Observability concerns.
[[context-functionality-events-order]] [[context-functionality-events-order]]
=== Ordering Listeners === Ordering Listeners
@ -786,7 +781,6 @@ Kotlin::
---- ----
====== ======
[[context-functionality-events-generics]] [[context-functionality-events-generics]]
=== Generic Events === Generic Events
@ -880,7 +874,6 @@ for example, for processing all events asynchronously and/or for handling listen
---- ----
[[context-functionality-resources]] [[context-functionality-resources]]
== Convenient Access to Low-level Resources == Convenient Access to Low-level Resources
@ -913,7 +906,6 @@ with special prefixes to force loading of definitions from the classpath or a UR
regardless of the actual context type. regardless of the actual context type.
[[context-functionality-startup]] [[context-functionality-startup]]
== Application Startup Tracking == Application Startup Tracking
@ -990,6 +982,7 @@ or ask for the `ApplicationStartup` type on any injection point.
NOTE: Developers should not use the `"spring.*"` namespace when creating custom startup steps. NOTE: Developers should not use the `"spring.*"` namespace when creating custom startup steps.
This namespace is reserved for internal Spring usage and is subject to change. This namespace is reserved for internal Spring usage and is subject to change.
[[context-create]] [[context-create]]
== Convenient ApplicationContext Instantiation for Web Applications == Convenient ApplicationContext Instantiation for Web Applications
@ -1022,7 +1015,6 @@ Examples are `/WEB-INF/{asterisk}Context.xml` (for all files with names that end
(for all such files in any subdirectory of `WEB-INF`). (for all such files in any subdirectory of `WEB-INF`).
[[context-deploy-rar]] [[context-deploy-rar]]
== Deploying a Spring `ApplicationContext` as a Jakarta EE RAR File == Deploying a Spring `ApplicationContext` as a Jakarta EE RAR File
@ -1053,7 +1045,8 @@ all application classes into a RAR file (which is a standard JAR file with a dif
file extension). file extension).
. Add all required library JARs into the root of the RAR archive. . Add all required library JARs into the root of the RAR archive.
. Add a . Add a
`META-INF/ra.xml` deployment descriptor (as shown in the {spring-framework-api}/jca/context/SpringContextResourceAdapter.html[javadoc for `SpringContextResourceAdapter`]) `META-INF/ra.xml` deployment descriptor (as shown in the
{spring-framework-api}/jca/context/SpringContextResourceAdapter.html[javadoc for `SpringContextResourceAdapter`])
and the corresponding Spring XML bean definition file(s) (typically and the corresponding Spring XML bean definition file(s) (typically
`META-INF/applicationContext.xml`). `META-INF/applicationContext.xml`).
. Drop the resulting RAR file into your . Drop the resulting RAR file into your
@ -1066,7 +1059,3 @@ other modules. A RAR-based `ApplicationContext` may also, for example, schedule
or react to new files in the file system (or the like). If it needs to allow synchronous or react to new files in the file system (or the like). If it needs to allow synchronous
access from the outside, it could (for example) export RMI endpoints, which may be used access from the outside, it could (for example) export RMI endpoints, which may be used
by other application modules on the same machine. by other application modules on the same machine.

View File

@ -45,8 +45,5 @@ xref:data-access/orm/jpa.adoc[Spring's JPA support] where load-time weaving may
necessary for JPA class transformation. necessary for JPA class transformation.
Consult the Consult the
{spring-framework-api}/orm/jpa/LocalContainerEntityManagerFactoryBean.html[`LocalContainerEntityManagerFactoryBean`] {spring-framework-api}/orm/jpa/LocalContainerEntityManagerFactoryBean.html[`LocalContainerEntityManagerFactoryBean`]
javadoc for more detail. For more on AspectJ load-time weaving, see xref:core/aop/using-aspectj.adoc#aop-aj-ltw[Load-time Weaving with AspectJ in the Spring Framework]. javadoc for more detail. For more on AspectJ load-time weaving, see
xref:core/aop/using-aspectj.adoc#aop-aj-ltw[Load-time Weaving with AspectJ in the Spring Framework].

View File

@ -74,7 +74,6 @@ lead to concurrent access exceptions, inconsistent state in the bean container,
==== ====
[[beans-definition-overriding]] [[beans-definition-overriding]]
== Overriding Beans == Overriding Beans
@ -104,7 +103,6 @@ explicit support for this as of Spring Framework 6.2. Please refer to
xref:testing/testcontext-framework/bean-overriding.adoc[this section] for more details. xref:testing/testcontext-framework/bean-overriding.adoc[this section] for more details.
[[beans-beanname]] [[beans-beanname]]
== Naming Beans == Naming Beans
@ -147,7 +145,6 @@ case when there is more than one character and both the first and second charact
are upper case, the original casing gets preserved. These are the same rules as are upper case, the original casing gets preserved. These are the same rules as
defined by `java.beans.Introspector.decapitalize` (which Spring uses here). defined by `java.beans.Introspector.decapitalize` (which Spring uses here).
[[beans-beanname-alias]] [[beans-beanname-alias]]
=== Aliasing a Bean outside the Bean Definition === Aliasing a Bean outside the Bean Definition
@ -197,7 +194,6 @@ See xref:core/beans/java/bean-annotation.adoc[Using the `@Bean` Annotation] for
**** ****
[[beans-factory-class]] [[beans-factory-class]]
== Instantiating Beans == Instantiating Beans
@ -209,7 +205,8 @@ If you use XML-based configuration metadata, you specify the type (or class) of
that is to be instantiated in the `class` attribute of the `<bean/>` element. This that is to be instantiated in the `class` attribute of the `<bean/>` element. This
`class` attribute (which, internally, is a `Class` property on a `BeanDefinition` `class` attribute (which, internally, is a `Class` property on a `BeanDefinition`
instance) is usually mandatory. (For exceptions, see instance) is usually mandatory. (For exceptions, see
xref:core/beans/definition.adoc#beans-factory-class-instance-factory-method[Instantiation by Using an Instance Factory Method] and xref:core/beans/child-bean-definitions.adoc[Bean Definition Inheritance].) xref:core/beans/definition.adoc#beans-factory-class-instance-factory-method[Instantiation by Using an Instance Factory Method]
and xref:core/beans/child-bean-definitions.adoc[Bean Definition Inheritance].)
You can use the `Class` property in one of two ways: You can use the `Class` property in one of two ways:
* Typically, to specify the bean class to be constructed in the case where the container * Typically, to specify the bean class to be constructed in the case where the container
@ -233,7 +230,6 @@ a bean definition would be `com.example.SomeThing$OtherThing` or
`com.example.SomeThing.OtherThing`. `com.example.SomeThing.OtherThing`.
**** ****
[[beans-factory-class-ctor]] [[beans-factory-class-ctor]]
=== Instantiation with a Constructor === Instantiation with a Constructor
@ -268,7 +264,6 @@ NOTE: In the case of constructor arguments, the container can select a correspon
constructor among several overloaded constructors. That said, to avoid ambiguities, constructor among several overloaded constructors. That said, to avoid ambiguities,
it is recommended to keep your constructor signatures as straightforward as possible. it is recommended to keep your constructor signatures as straightforward as possible.
[[beans-factory-class-static-factory-method]] [[beans-factory-class-static-factory-method]]
=== Instantiation with a Static Factory Method === Instantiation with a Static Factory Method
@ -346,7 +341,6 @@ overloads of the `mock` method. Choose the most specific variant of `mock` possi
---- ----
==== ====
[[beans-factory-class-instance-factory-method]] [[beans-factory-class-instance-factory-method]]
=== Instantiation by Using an Instance Factory Method === Instantiation by Using an Instance Factory Method
@ -478,7 +472,6 @@ xref:core/beans/definition.adoc#beans-factory-class-static-factory-method[static
`FactoryBean` (notice the capitalization) refers to a Spring-specific `FactoryBean` (notice the capitalization) refers to a Spring-specific
xref:core/beans/factory-extension.adoc#beans-factory-extension-factorybean[`FactoryBean`] implementation class. xref:core/beans/factory-extension.adoc#beans-factory-extension-factorybean[`FactoryBean`] implementation class.
[[beans-factory-type-determination]] [[beans-factory-type-determination]]
=== Determining a Bean's Runtime Type === Determining a Bean's Runtime Type
@ -494,5 +487,3 @@ The recommended way to find out about the actual runtime type of a particular be
a `BeanFactory.getType` call for the specified bean name. This takes all of the above a `BeanFactory.getType` call for the specified bean name. This takes all of the above
cases into account and returns the type of object that a `BeanFactory.getBean` call is cases into account and returns the type of object that a `BeanFactory.getBean` call is
going to return for the same bean name. going to return for the same bean name.

View File

@ -7,6 +7,3 @@ Spring parlance). Even the simplest application has a few objects that work toge
present what the end-user sees as a coherent application. This next section explains how present what the end-user sees as a coherent application. This next section explains how
you go from defining a number of bean definitions that stand alone to a fully realized you go from defining a number of bean definitions that stand alone to a fully realized
application where objects collaborate to achieve a goal. application where objects collaborate to achieve a goal.

View File

@ -16,7 +16,8 @@ advantages:
during development, without negating the option of switching to explicit wiring when during development, without negating the option of switching to explicit wiring when
the code base becomes more stable. the code base becomes more stable.
When using XML-based configuration metadata (see xref:core/beans/dependencies/factory-collaborators.adoc[Dependency Injection]), you When using XML-based configuration metadata (see
xref:core/beans/dependencies/factory-collaborators.adoc[Dependency Injection]), you
can specify the autowire mode for a bean definition with the `autowire` attribute of the can specify the autowire mode for a bean definition with the `autowire` attribute of the
`<bean/>` element. The autowiring functionality has four modes. You specify autowiring `<bean/>` element. The autowiring functionality has four modes. You specify autowiring
per bean and can thus choose which ones to autowire. The following table describes the per bean and can thus choose which ones to autowire. The following table describes the
@ -60,7 +61,6 @@ instance's values consist of all bean instances that match the expected type, an
`Map` instance's keys contain the corresponding bean names. `Map` instance's keys contain the corresponding bean names.
[[beans-autowired-exceptions]] [[beans-autowired-exceptions]]
== Limitations and Disadvantages of Autowiring == Limitations and Disadvantages of Autowiring
@ -90,14 +90,14 @@ In the latter scenario, you have several options:
* Abandon autowiring in favor of explicit wiring. * Abandon autowiring in favor of explicit wiring.
* Avoid autowiring for a bean definition by setting its `autowire-candidate` attributes * Avoid autowiring for a bean definition by setting its `autowire-candidate` attributes
to `false`, as described in the xref:core/beans/dependencies/factory-autowire.adoc#beans-factory-autowire-candidate[next section]. to `false`, as described in the
xref:core/beans/dependencies/factory-autowire.adoc#beans-factory-autowire-candidate[next section].
* Designate a single bean definition as the primary candidate by setting the * Designate a single bean definition as the primary candidate by setting the
`primary` attribute of its `<bean/>` element to `true`. `primary` attribute of its `<bean/>` element to `true`.
* Implement the more fine-grained control available with annotation-based configuration, * Implement the more fine-grained control available with annotation-based configuration,
as described in xref:core/beans/annotation-config.adoc[Annotation-based Container Configuration]. as described in xref:core/beans/annotation-config.adoc[Annotation-based Container Configuration].
[[beans-factory-autowire-candidate]] [[beans-factory-autowire-candidate]]
== Excluding a Bean from Autowiring == Excluding a Bean from Autowiring
@ -139,6 +139,3 @@ get injected by plain declared type only, rather by type plus specific qualifier
In contrast, `autowireCandidate=false` behaves exactly like the `autowire-candidate` In contrast, `autowireCandidate=false` behaves exactly like the `autowire-candidate`
attribute as explained above: Such a bean will never get injected by type at all. attribute as explained above: Such a bean will never get injected by type at all.
==== ====

View File

@ -16,8 +16,9 @@ not know the location or class of the dependencies. As a result, your classes be
to test, particularly when the dependencies are on interfaces or abstract base classes, to test, particularly when the dependencies are on interfaces or abstract base classes,
which allow for stub or mock implementations to be used in unit tests. which allow for stub or mock implementations to be used in unit tests.
DI exists in two major variants: xref:core/beans/dependencies/factory-collaborators.adoc#beans-constructor-injection[Constructor-based dependency injection] DI exists in two major variants:
and xref:core/beans/dependencies/factory-collaborators.adoc#beans-setter-injection[Setter-based dependency injection]. xref:core/beans/dependencies/factory-collaborators.adoc#beans-constructor-injection[Constructor-based dependency injection]
and xref:core/beans/dependencies/factory-collaborators.adoc#beans-setter-injection[Setter-based dependency injection].
[[beans-constructor-injection]] [[beans-constructor-injection]]
@ -606,6 +607,3 @@ contains the `static` factory method (although, in this example, it is). An inst
(non-static) factory method can be used in an essentially identical fashion (aside (non-static) factory method can be used in an essentially identical fashion (aside
from the use of the `factory-bean` attribute instead of the `class` attribute), so we from the use of the `factory-bean` attribute instead of the `class` attribute), so we
do not discuss those details here. do not discuss those details here.

View File

@ -37,6 +37,3 @@ in the case of xref:core/beans/factory-scopes.adoc#beans-factory-scopes-singleto
beans only, a corresponding destruction-time dependency. Dependent beans that define a 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 `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. itself being destroyed. Thus, `depends-on` can also control shutdown order.

View File

@ -29,6 +29,3 @@ annotated class or in XML using the `default-lazy-init` attribute on the `<beans
shows: shows:
include-code::./LazyConfiguration[tag=snippet,indent=0] include-code::./LazyConfiguration[tag=snippet,indent=0]

View File

@ -2,16 +2,17 @@
= Method Injection = Method Injection
In most application scenarios, most beans in the container are In most application scenarios, most beans in the container are
xref:core/beans/factory-scopes.adoc#beans-factory-scopes-singleton[singletons]. When a singleton bean needs to xref:core/beans/factory-scopes.adoc#beans-factory-scopes-singleton[singletons]. When a
collaborate with another singleton bean or a non-singleton bean needs to collaborate singleton bean needs to collaborate with another singleton bean or a non-singleton bean
with another non-singleton bean, you typically handle the dependency by defining one needs to collaborate with another non-singleton bean, you typically handle the dependency
bean as a property of the other. A problem arises when the bean lifecycles are by defining one bean as a property of the other. A problem arises when the bean lifecycles
different. Suppose singleton bean A needs to use non-singleton (prototype) bean B, are different. Suppose singleton bean A needs to use non-singleton (prototype) bean B,
perhaps on each method invocation on A. The container creates the singleton bean A only perhaps on each method invocation on A. The container creates the singleton bean A only
once, and thus only gets one opportunity to set the properties. The container cannot once, and thus only gets one opportunity to set the properties. The container cannot
provide bean A with a new instance of bean B every time one is needed. provide bean A with a new instance of bean B every time one is needed.
A solution is to forego some inversion of control. You can xref:core/beans/factory-nature.adoc#beans-factory-aware[make bean A aware of the container] A solution is to forego some inversion of control. You can
xref:core/beans/factory-nature.adoc#beans-factory-aware[make bean A aware of the container]
by implementing the `ApplicationContextAware` interface, by implementing the `ApplicationContextAware` interface,
and by xref:core/beans/basics.adoc#beans-factory-client[making a `getBean("B")` call to the container] ask for (a and by xref:core/beans/basics.adoc#beans-factory-client[making a `getBean("B")` call to the container] ask for (a
typically new) bean B instance every time bean A needs it. The following example typically new) bean B instance every time bean A needs it. The following example
@ -103,7 +104,6 @@ You can read more about the motivation for Method Injection in
**** ****
[[beans-factory-lookup-method-injection]] [[beans-factory-lookup-method-injection]]
== Lookup Method Injection == Lookup Method Injection
@ -294,14 +294,14 @@ Kotlin::
[TIP] [TIP]
==== ====
Another way of accessing differently scoped target beans is an `ObjectFactory`/ Another way of accessing differently scoped target beans is an `ObjectFactory`/
`Provider` injection point. See xref:core/beans/factory-scopes.adoc#beans-factory-scopes-other-injection[Scoped Beans as Dependencies]. `Provider` injection point. See
xref:core/beans/factory-scopes.adoc#beans-factory-scopes-other-injection[Scoped Beans as Dependencies].
You may also find the `ServiceLocatorFactoryBean` (in the You may also find the `ServiceLocatorFactoryBean` (in the
`org.springframework.beans.factory.config` package) to be useful. `org.springframework.beans.factory.config` package) to be useful.
==== ====
[[beans-factory-arbitrary-method-replacement]] [[beans-factory-arbitrary-method-replacement]]
== Arbitrary Method Replacement == Arbitrary Method Replacement
@ -422,6 +422,3 @@ substring of the fully qualified type name. For example, the following all match
Because the number of arguments is often enough to distinguish between each possible Because the number of arguments is often enough to distinguish between each possible
choice, this shortcut can save a lot of typing, by letting you type only the choice, this shortcut can save a lot of typing, by letting you type only the
shortest string that matches an argument type. shortest string that matches an argument type.

View File

@ -1,11 +1,10 @@
[[beans-factory-properties-detailed]] [[beans-factory-properties-detailed]]
= Dependencies and Configuration in Detail = Dependencies and Configuration in Detail
As mentioned in the xref:core/beans/dependencies/factory-collaborators.adoc[previous section], you can define bean As mentioned in the xref:core/beans/dependencies/factory-collaborators.adoc[previous section],
properties and constructor arguments as references to other managed beans (collaborators) you can define bean properties and constructor arguments as references to other managed beans
or as values defined inline. Spring's XML-based configuration metadata supports (collaborators) or as values defined inline. Spring's XML-based configuration metadata supports
sub-element types within its `<property/>` and `<constructor-arg/>` elements for this sub-element types within its `<property/>` and `<constructor-arg/>` elements for this purpose.
purpose.
[[beans-value-element]] [[beans-value-element]]
@ -544,9 +543,10 @@ three approaches at the same time.
[[beans-c-namespace]] [[beans-c-namespace]]
== XML Shortcut with the c-namespace == XML Shortcut with the c-namespace
Similar to the xref:core/beans/dependencies/factory-properties-detailed.adoc#beans-p-namespace[XML Shortcut with the p-namespace], the c-namespace, introduced in Spring Similar to the
3.1, allows inlined attributes for configuring the constructor arguments rather xref:core/beans/dependencies/factory-properties-detailed.adoc#beans-p-namespace[XML Shortcut with the p-namespace],
then nested `constructor-arg` elements. the c-namespace, introduced in Spring 3.1, allows inlined attributes for configuring
the constructor arguments rather then nested `constructor-arg` elements.
The following example uses the `c:` namespace to do the same thing as the from The following example uses the `c:` namespace to do the same thing as the from
xref:core/beans/dependencies/factory-collaborators.adoc#beans-constructor-injection[Constructor-based Dependency Injection]: xref:core/beans/dependencies/factory-collaborators.adoc#beans-constructor-injection[Constructor-based Dependency Injection]:
@ -598,9 +598,9 @@ A corresponding index notation is also available for `<constructor-arg>` element
not commonly used since the plain order of declaration is usually sufficient there. not commonly used since the plain order of declaration is usually sufficient there.
In practice, the constructor resolution In practice, the constructor resolution
xref:core/beans/dependencies/factory-collaborators.adoc#beans-factory-ctor-arguments-resolution[mechanism] is quite efficient in matching xref:core/beans/dependencies/factory-collaborators.adoc#beans-factory-ctor-arguments-resolution[mechanism]
arguments, so unless you really need to, we recommend using the name notation is quite efficient in matching arguments, so unless you really need to, we recommend
throughout your configuration. using the name notation throughout your configuration.
[[beans-compound-property-names]] [[beans-compound-property-names]]
@ -621,6 +621,3 @@ The `something` bean has a `fred` property, which has a `bob` property, which ha
property, and that final `sammy` property is being set to a value of `123`. In order for property, and that final `sammy` property is being set to a value of `123`. In order for
this to work, the `fred` property of `something` and the `bob` property of `fred` must not this to work, the `fred` property of `something` and the `bob` property of `fred` must not
be `null` after the bean is constructed. Otherwise, a `NullPointerException` is thrown. be `null` after the bean is constructed. Otherwise, a `NullPointerException` is thrown.

View File

@ -20,7 +20,6 @@ user with a convenient service interface for configuring property sources and re
properties from them. properties from them.
[[beans-definition-profiles]] [[beans-definition-profiles]]
== Bean Definition Profiles == Bean Definition Profiles
@ -114,7 +113,6 @@ certain contexts but not in others. You could say that you want to register a
certain profile of bean definitions in situation A and a different profile in certain profile of bean definitions in situation A and a different profile in
situation B. We start by updating our configuration to reflect this need. situation B. We start by updating our configuration to reflect this need.
[[beans-definition-profiles-java]] [[beans-definition-profiles-java]]
=== Using `@Profile` === Using `@Profile`
@ -345,7 +343,6 @@ way to represent such an arrangement in a valid Java class in the first place
(since there can only be one method of a particular name and argument signature). (since there can only be one method of a particular name and argument signature).
==== ====
[[beans-definition-profiles-xml]] [[beans-definition-profiles-xml]]
=== XML Bean Definition Profiles === XML Bean Definition Profiles
@ -437,7 +434,6 @@ In the preceding example, the `dataSource` bean is exposed if both the `producti
`us-east` profiles are active. `us-east` profiles are active.
===== =====
[[beans-definition-profiles-enable]] [[beans-definition-profiles-enable]]
=== Activating a Profile === Activating a Profile
@ -512,7 +508,6 @@ as the following example shows:
-Dspring.profiles.active="profile1,profile2" -Dspring.profiles.active="profile1,profile2"
---- ----
[[beans-definition-profiles-default]] [[beans-definition-profiles-default]]
=== Default Profile === Default Profile
@ -567,7 +562,6 @@ the default profile by using `setDefaultProfiles()` on the `Environment` or,
declaratively, by using the `spring.profiles.default` property. declaratively, by using the `spring.profiles.default` property.
[[beans-property-source-abstraction]] [[beans-property-source-abstraction]]
== `PropertySource` Abstraction == `PropertySource` Abstraction
@ -668,7 +662,6 @@ API exposes a number of methods that allow for precise manipulation of the set o
property sources. property sources.
[[beans-using-propertysource]] [[beans-using-propertysource]]
== Using `@PropertySource` == Using `@PropertySource`
@ -777,7 +770,6 @@ may also be used as a meta-annotation to create custom composed annotations with
attribute overrides. attribute overrides.
[[beans-placeholder-resolution-in-statements]] [[beans-placeholder-resolution-in-statements]]
== Placeholder Resolution in Statements == Placeholder Resolution in Statements
@ -798,7 +790,3 @@ property is defined, as long as it is available in the `Environment`:
<import resource="com/bank/service/${customer}-config.xml"/> <import resource="com/bank/service/${customer}-config.xml"/>
</beans> </beans>
---- ----

View File

@ -7,7 +7,6 @@ implementations of special integration interfaces. The next few sections describ
integration interfaces. integration interfaces.
[[beans-factory-extension-bpp]] [[beans-factory-extension-bpp]]
== Customizing Beans by Using a `BeanPostProcessor` == Customizing Beans by Using a `BeanPostProcessor`
@ -109,7 +108,6 @@ Spring accesses other beans for matching them by type.
The following examples show how to write, register, and use `BeanPostProcessor` instances The following examples show how to write, register, and use `BeanPostProcessor` instances
in an `ApplicationContext`. in an `ApplicationContext`.
[[beans-factory-extension-bpp-examples-hw]] [[beans-factory-extension-bpp-examples-hw]]
=== Example: Hello World, `BeanPostProcessor`-style === Example: Hello World, `BeanPostProcessor`-style
@ -244,7 +242,6 @@ Bean 'messenger' created : org.springframework.scripting.groovy.GroovyMessenger@
org.springframework.scripting.groovy.GroovyMessenger@272961 org.springframework.scripting.groovy.GroovyMessenger@272961
---- ----
[[beans-factory-extension-bpp-examples-aabpp]] [[beans-factory-extension-bpp-examples-aabpp]]
=== Example: The `AutowiredAnnotationBeanPostProcessor` === Example: The `AutowiredAnnotationBeanPostProcessor`
@ -255,7 +252,6 @@ that ships with the Spring distribution and autowires annotated fields, setter m
and arbitrary config methods. and arbitrary config methods.
[[beans-factory-extension-factory-postprocessors]] [[beans-factory-extension-factory-postprocessors]]
== Customizing Configuration Metadata with a `BeanFactoryPostProcessor` == Customizing Configuration Metadata with a `BeanFactoryPostProcessor`
@ -312,7 +308,6 @@ Thus, marking it for lazy initialization will be ignored, and the
`Bean(Factory)PostProcessor` will be instantiated eagerly even if you set the `Bean(Factory)PostProcessor` will be instantiated eagerly even if you set the
`default-lazy-init` attribute to `true` on the declaration of your `<beans />` element. `default-lazy-init` attribute to `true` on the declaration of your `<beans />` element.
[[beans-factory-placeholderconfigurer]] [[beans-factory-placeholderconfigurer]]
=== Example: Property Placeholder Substitution with `PropertySourcesPlaceholderConfigurer` === Example: Property Placeholder Substitution with `PropertySourcesPlaceholderConfigurer`
@ -412,7 +407,6 @@ fails when it is about to be created, which is during the `preInstantiateSinglet
phase of an `ApplicationContext` for a non-lazy-init bean. phase of an `ApplicationContext` for a non-lazy-init bean.
===== =====
[[beans-factory-overrideconfigurer]] [[beans-factory-overrideconfigurer]]
=== Example: The `PropertyOverrideConfigurer` === Example: The `PropertyOverrideConfigurer`
@ -469,7 +463,6 @@ property overriding with a dedicated configuration element, as the following exa
---- ----
[[beans-factory-extension-factorybean]] [[beans-factory-extension-factorybean]]
== Customizing Instantiation Logic with a `FactoryBean` == Customizing Instantiation Logic with a `FactoryBean`
@ -502,6 +495,3 @@ calling the `getBean()` method of the `ApplicationContext`. So, for a given `Fac
with an `id` of `myBean`, invoking `getBean("myBean")` on the container returns the with an `id` of `myBean`, invoking `getBean("myBean")` on the container returns the
product of the `FactoryBean`, whereas invoking `getBean("&myBean")` returns the product of the `FactoryBean`, whereas invoking `getBean("&myBean")` returns the
`FactoryBean` instance itself. `FactoryBean` instance itself.

View File

@ -9,7 +9,6 @@ of a bean. This section groups them as follows:
* xref:core/beans/factory-nature.adoc#aware-list[Other `Aware` Interfaces] * xref:core/beans/factory-nature.adoc#aware-list[Other `Aware` Interfaces]
[[beans-factory-lifecycle]] [[beans-factory-lifecycle]]
== Lifecycle Callbacks == Lifecycle Callbacks
@ -41,8 +40,6 @@ startup and shutdown process, as driven by the container's own lifecycle.
The lifecycle callback interfaces are described in this section. The lifecycle callback interfaces are described in this section.
[[beans-factory-lifecycle-initializingbean]] [[beans-factory-lifecycle-initializingbean]]
=== Initialization Callbacks === Initialization Callbacks
@ -156,8 +153,6 @@ the container's overall lifecycle management, including an auto-startup mechanis
a pre-destroy stop step, and potential stop/restart callbacks (see below). a pre-destroy stop step, and potential stop/restart callbacks (see below).
==== ====
[[beans-factory-lifecycle-disposablebean]] [[beans-factory-lifecycle-disposablebean]]
=== Destruction Callbacks === Destruction Callbacks
@ -267,8 +262,6 @@ You may also implement `SmartLifecycle` for a time-bound stop step where the con
will wait for all such stop processing to complete before moving on to destroy methods. will wait for all such stop processing to complete before moving on to destroy methods.
==== ====
[[beans-factory-lifecycle-default-init-destroy-methods]] [[beans-factory-lifecycle-default-init-destroy-methods]]
=== Default Initialization and Destroy Methods === Default Initialization and Destroy Methods
@ -369,8 +362,6 @@ interceptors to the `init` method, because doing so would couple the lifecycle o
target bean to its proxy or interceptors and leave strange semantics when your code target bean to its proxy or interceptors and leave strange semantics when your code
interacts directly with the raw target bean. interacts directly with the raw target bean.
[[beans-factory-lifecycle-combined-effects]] [[beans-factory-lifecycle-combined-effects]]
=== Combining Lifecycle Mechanisms === Combining Lifecycle Mechanisms
@ -402,8 +393,6 @@ Destroy methods are called in the same order:
. `destroy()` as defined by the `DisposableBean` callback interface . `destroy()` as defined by the `DisposableBean` callback interface
. A custom configured `destroy()` method . A custom configured `destroy()` method
[[beans-factory-lifecycle-processor]] [[beans-factory-lifecycle-processor]]
=== Startup and Shutdown Callbacks === Startup and Shutdown Callbacks
@ -526,8 +515,6 @@ its own `start()` method (unlike the context refresh, the context start does not
automatically for a standard context implementation). The `phase` value and any automatically for a standard context implementation). The `phase` value and any
"`depends-on`" relationships determine the startup order as described earlier. "`depends-on`" relationships determine the startup order as described earlier.
[[beans-factory-shutdown]] [[beans-factory-shutdown]]
=== Shutting Down the Spring IoC Container Gracefully in Non-Web Applications === Shutting Down the Spring IoC Container Gracefully in Non-Web Applications
@ -590,8 +577,6 @@ Kotlin::
---- ----
====== ======
[[beans-factory-thread-safety]] [[beans-factory-thread-safety]]
=== Thread Safety and Visibility === Thread Safety and Visibility
@ -625,7 +610,6 @@ destroy callback without a preceding stop since this may happen during an extrao
shutdown after a cancelled bootstrap or in case of a stop timeout caused by another bean. shutdown after a cancelled bootstrap or in case of a stop timeout caused by another bean.
[[beans-factory-aware]] [[beans-factory-aware]]
== `ApplicationContextAware` and `BeanNameAware` == `ApplicationContextAware` and `BeanNameAware`
@ -682,7 +666,6 @@ initialization callback such as `InitializingBean.afterPropertiesSet()` or a cus
init-method. init-method.
[[aware-list]] [[aware-list]]
== Other `Aware` Interfaces == Other `Aware` Interfaces
@ -747,6 +730,3 @@ dependency type. The following table summarizes the most important `Aware` inter
Note again that using these interfaces ties your code to the Spring API and does not Note again that using these interfaces ties your code to the Spring API and does not
follow the Inversion of Control style. As a result, we recommend them for infrastructure follow the Inversion of Control style. As a result, we recommend them for infrastructure
beans that require programmatic access to the container. beans that require programmatic access to the container.

View File

@ -56,7 +56,6 @@ For instructions on how to register this or any other custom scope, see
xref:core/beans/factory-scopes.adoc#beans-factory-scopes-custom-using[Using a Custom Scope]. xref:core/beans/factory-scopes.adoc#beans-factory-scopes-custom-using[Using a Custom Scope].
[[beans-factory-scopes-singleton]] [[beans-factory-scopes-singleton]]
== The Singleton Scope == The Singleton Scope
@ -91,7 +90,6 @@ following example:
---- ----
[[beans-factory-scopes-prototype]] [[beans-factory-scopes-prototype]]
== The Prototype Scope == The Prototype Scope
@ -134,7 +132,6 @@ be handled by the client. (For details on the lifecycle of a bean in the Spring
container, see xref:core/beans/factory-nature.adoc#beans-factory-lifecycle[Lifecycle Callbacks].) container, see xref:core/beans/factory-nature.adoc#beans-factory-lifecycle[Lifecycle Callbacks].)
[[beans-factory-scopes-sing-prot-interaction]] [[beans-factory-scopes-sing-prot-interaction]]
== Singleton Beans with Prototype-bean Dependencies == Singleton Beans with Prototype-bean Dependencies
@ -152,7 +149,6 @@ and injects its dependencies. If you need a new instance of a prototype bean at
runtime more than once, see xref:core/beans/dependencies/factory-method-injection.adoc[Method Injection]. runtime more than once, see xref:core/beans/dependencies/factory-method-injection.adoc[Method Injection].
[[beans-factory-scopes-other]] [[beans-factory-scopes-other]]
== Request, Session, Application, and WebSocket Scopes == Request, Session, Application, and WebSocket Scopes
@ -162,8 +158,6 @@ if you use a web-aware Spring `ApplicationContext` implementation (such as
such as the `ClassPathXmlApplicationContext`, an `IllegalStateException` that complains such as the `ClassPathXmlApplicationContext`, an `IllegalStateException` that complains
about an unknown bean scope is thrown. about an unknown bean scope is thrown.
[[beans-factory-scopes-other-web-configuration]] [[beans-factory-scopes-other-web-configuration]]
=== Initial Web Configuration === Initial Web Configuration
@ -223,8 +217,6 @@ the same thing, namely bind the HTTP request object to the `Thread` that is serv
that request. This makes beans that are request- and session-scoped available further that request. This makes beans that are request- and session-scoped available further
down the call chain. down the call chain.
[[beans-factory-scopes-request]] [[beans-factory-scopes-request]]
=== Request scope === Request scope
@ -272,8 +264,6 @@ Kotlin::
---- ----
====== ======
[[beans-factory-scopes-session]] [[beans-factory-scopes-session]]
=== Session Scope === Session Scope
@ -322,8 +312,6 @@ Kotlin::
---- ----
====== ======
[[beans-factory-scopes-application]] [[beans-factory-scopes-application]]
=== Application Scope === Application Scope
@ -371,8 +359,6 @@ Kotlin::
---- ----
====== ======
[[beans-factory-scopes-websocket]] [[beans-factory-scopes-websocket]]
=== WebSocket Scope === WebSocket Scope
@ -380,8 +366,6 @@ WebSocket scope is associated with the lifecycle of a WebSocket session and appl
STOMP over WebSocket applications, see STOMP over WebSocket applications, see
xref:web/websocket/stomp/scope.adoc[WebSocket scope] for more details. xref:web/websocket/stomp/scope.adoc[WebSocket scope] for more details.
[[beans-factory-scopes-other-injection]] [[beans-factory-scopes-other-injection]]
=== Scoped Beans as Dependencies === Scoped Beans as Dependencies
@ -539,8 +523,6 @@ interfaces. The following example shows a proxy based on an interface:
For more detailed information about choosing class-based or interface-based proxying, For more detailed information about choosing class-based or interface-based proxying,
see xref:core/aop/proxying.adoc[Proxying Mechanisms]. see xref:core/aop/proxying.adoc[Proxying Mechanisms].
[[beans-factory-scopes-injection]] [[beans-factory-scopes-injection]]
=== Injecting Request/Session References Directly === Injecting Request/Session References Directly
@ -553,7 +535,6 @@ objects which has the advantage of working in singleton beans and serializable b
as well, similar to scoped proxies for factory-scoped beans. as well, similar to scoped proxies for factory-scoped beans.
[[beans-factory-scopes-custom]] [[beans-factory-scopes-custom]]
== Custom Scopes == Custom Scopes
@ -561,7 +542,6 @@ The bean scoping mechanism is extensible. You can define your own
scopes or even redefine existing scopes, although the latter is considered bad practice scopes or even redefine existing scopes, although the latter is considered bad practice
and you cannot override the built-in `singleton` and `prototype` scopes. and you cannot override the built-in `singleton` and `prototype` scopes.
[[beans-factory-scopes-custom-creating]] [[beans-factory-scopes-custom-creating]]
=== Creating a Custom Scope === Creating a Custom Scope
@ -664,8 +644,6 @@ Kotlin::
This identifier is different for each scope. For a session scoped implementation, this This identifier is different for each scope. For a session scoped implementation, this
identifier can be the session identifier. identifier can be the session identifier.
[[beans-factory-scopes-custom-using]] [[beans-factory-scopes-custom-using]]
=== Using a Custom Scope === Using a Custom Scope
@ -773,7 +751,3 @@ of the scope. You can also do the `Scope` registration declaratively, by using t
NOTE: When you place `<aop:scoped-proxy/>` within a `<bean>` declaration for a NOTE: When you place `<aop:scoped-proxy/>` within a `<bean>` declaration for a
`FactoryBean` implementation, it is the factory bean itself that is scoped, not the object `FactoryBean` implementation, it is the factory bean itself that is scoped, not the object
returned from `getObject()`. returned from `getObject()`.

View File

@ -37,7 +37,3 @@ by the Spring IoC container are called beans. A bean is an object that is
instantiated, assembled, and managed by a Spring IoC container. Otherwise, a instantiated, assembled, and managed by a Spring IoC container. Otherwise, a
bean is simply one of many objects in your application. Beans, and the dependencies bean is simply one of many objects in your application. Beans, and the dependencies
among them, are reflected in the configuration metadata used by a container. among them, are reflected in the configuration metadata used by a container.

View File

@ -4,4 +4,3 @@
This section covers how to use annotations in your Java code to configure the Spring This section covers how to use annotations in your Java code to configure the Spring
container. container.

View File

@ -84,6 +84,3 @@ subclassing has to be applied at runtime, reducing the overhead and the footprin
The `@Bean` and `@Configuration` annotations are discussed in depth in the following sections. The `@Bean` and `@Configuration` annotations are discussed in depth in the following sections.
First, however, we cover the various ways of creating a Spring container by using First, however, we cover the various ways of creating a Spring container by using
Java-based configuration. Java-based configuration.

View File

@ -468,6 +468,7 @@ Kotlin::
---- ----
====== ======
[[beans-java-customizing-bean-naming]] [[beans-java-customizing-bean-naming]]
== Customizing Bean Naming == Customizing Bean Naming
@ -585,6 +586,3 @@ Kotlin::
} }
---- ----
====== ======

View File

@ -905,4 +905,3 @@ Kotlin::
} }
---- ----
====== ======

View File

@ -4,7 +4,9 @@
`@Configuration` is a class-level annotation indicating that an object is a source of `@Configuration` is a class-level annotation indicating that an object is a source of
bean definitions. `@Configuration` classes declare beans through `@Bean`-annotated bean definitions. `@Configuration` classes declare beans through `@Bean`-annotated
methods. Calls to `@Bean` methods on `@Configuration` classes can also be used to define methods. Calls to `@Bean` methods on `@Configuration` classes can also be used to define
inter-bean dependencies. See xref:core/beans/java/basic-concepts.adoc[Basic Concepts: `@Bean` and `@Configuration`] for a general introduction. inter-bean dependencies. See
xref:core/beans/java/basic-concepts.adoc[Basic Concepts: `@Bean` and `@Configuration`]
for a general introduction.
[[beans-java-injecting-dependencies]] [[beans-java-injecting-dependencies]]
@ -58,7 +60,6 @@ is declared within a `@Configuration` class. You cannot declare inter-bean depen
by using plain `@Component` classes. by using plain `@Component` classes.
[[beans-java-method-injection]] [[beans-java-method-injection]]
== Lookup Method Injection == Lookup Method Injection
@ -259,6 +260,3 @@ instead) or by annotating your configuration class with
are then not intercepted, so you have to exclusively rely on dependency injection at the are then not intercepted, so you have to exclusively rely on dependency injection at the
constructor or method level there. constructor or method level there.
==== ====

View File

@ -206,7 +206,8 @@ Kotlin::
---- ----
====== ======
NOTE: Remember that `@Configuration` classes are xref:core/beans/classpath-scanning.adoc#beans-meta-annotations[meta-annotated] NOTE: Remember that `@Configuration` classes are
xref:core/beans/classpath-scanning.adoc#beans-meta-annotations[meta-annotated]
with `@Component`, so they are candidates for component-scanning. In the preceding example, with `@Component`, so they are candidates for component-scanning. In the preceding example,
assuming that `AppConfig` is declared within the `com.acme` package (or any package assuming that `AppConfig` is declared within the `com.acme` package (or any package
underneath), it is picked up during the call to `scan()`. Upon `refresh()`, all its `@Bean` underneath), it is picked up during the call to `scan()`. Upon `refresh()`, all its `@Bean`
@ -280,5 +281,3 @@ NOTE: For programmatic use cases, a `GenericWebApplicationContext` can be used a
alternative to `AnnotationConfigWebApplicationContext`. See the alternative to `AnnotationConfigWebApplicationContext`. See the
{spring-framework-api}/web/context/support/GenericWebApplicationContext.html[`GenericWebApplicationContext`] {spring-framework-api}/web/context/support/GenericWebApplicationContext.html[`GenericWebApplicationContext`]
javadoc for details. javadoc for details.

View File

@ -23,7 +23,6 @@ You can add the following dependency to your file pom.xml:
===== =====
[[beans-inject-named]] [[beans-inject-named]]
== Dependency Injection with `@Inject` and `@Named` == Dependency Injection with `@Inject` and `@Named`
@ -214,7 +213,6 @@ Kotlin::
====== ======
[[beans-named]] [[beans-named]]
== `@Named` and `@ManagedBean`: Standard Equivalents to the `@Component` Annotation == `@Named` and `@ManagedBean`: Standard Equivalents to the `@Component` Annotation
@ -339,7 +337,6 @@ annotations are not composable. You should use Spring's stereotype model for bui
custom component annotations. custom component annotations.
[[beans-standard-annotations-limitations]] [[beans-standard-annotations-limitations]]
== Limitations of JSR-330 Standard Annotations == Limitations of JSR-330 Standard Annotations
@ -388,6 +385,3 @@ features are not available, as the following table shows:
only with a shorter `get()` method name. It can also be used in combination with only with a shorter `get()` method name. It can also be used in combination with
Spring's `@Autowired` or with non-annotated constructors and setter methods. Spring's `@Autowired` or with non-annotated constructors and setter methods.
|=== |===

View File

@ -15,8 +15,6 @@ xref:core/databuffer-codec.adoc#databuffers-buffer-pooled[pooled].
* <<Codecs>> decode or encode data buffer streams into higher level objects. * <<Codecs>> decode or encode data buffer streams into higher level objects.
[[databuffers-factory]] [[databuffers-factory]]
== `DataBufferFactory` == `DataBufferFactory`
@ -33,8 +31,6 @@ The type of factory depends on the underlying client or server, for example,
`NettyDataBufferFactory` for Reactor Netty, `DefaultDataBufferFactory` for others. `NettyDataBufferFactory` for Reactor Netty, `DefaultDataBufferFactory` for others.
[[databuffers-buffer]] [[databuffers-buffer]]
== `DataBuffer` == `DataBuffer`
@ -50,8 +46,6 @@ alternate between read and write.
* Determine the index, or the last index, for a given byte. * Determine the index, or the last index, for a given byte.
[[databuffers-buffer-pooled]] [[databuffers-buffer-pooled]]
== `PooledDataBuffer` == `PooledDataBuffer`
@ -75,8 +69,6 @@ to use the convenience methods in `DataBufferUtils` that apply release or retain
`DataBuffer` only if it is an instance of `PooledDataBuffer`. `DataBuffer` only if it is an instance of `PooledDataBuffer`.
[[databuffers-utils]] [[databuffers-utils]]
== `DataBufferUtils` == `DataBufferUtils`
@ -91,8 +83,6 @@ composite buffers, if that's supported by the underlying byte buffer API.
* Skip or take from a stream of bytes until a specific byte count. * Skip or take from a stream of bytes until a specific byte count.
[[codecs]] [[codecs]]
== Codecs == Codecs
@ -107,8 +97,6 @@ Jackson Smile, JAXB2, Protocol Buffers and other encoders and decoders. See
xref:web/webflux/reactive-spring.adoc#webflux-codecs[Codecs] in the WebFlux section. xref:web/webflux/reactive-spring.adoc#webflux-codecs[Codecs] in the WebFlux section.
[[databuffers-using]] [[databuffers-using]]
== Using `DataBuffer` == Using `DataBuffer`

View File

@ -54,4 +54,3 @@ The expression language supports the following functionality:
* Collection projection * Collection projection
* Collection selection * Collection selection
* Templated expressions * Templated expressions

View File

@ -217,8 +217,6 @@ Kotlin::
====== ======
[[expressions-evaluation-context]] [[expressions-evaluation-context]]
== Understanding `EvaluationContext` == Understanding `EvaluationContext`
@ -255,7 +253,6 @@ properties. Alternatively, configure custom accessors via
`SimpleEvaluationContext.forPropertyAccessors(...)`, potentially disable assignment, and `SimpleEvaluationContext.forPropertyAccessors(...)`, potentially disable assignment, and
optionally activate method resolution and/or a type converter through the builder. optionally activate method resolution and/or a type converter through the builder.
[[expressions-type-conversion]] [[expressions-type-conversion]]
=== Type Conversion === Type Conversion
@ -431,7 +428,6 @@ numeric operations, the performance gain can be very noticeable. In an example m
benchmark run of 50,000 iterations, it took 75ms to evaluate by using the interpreter and benchmark run of 50,000 iterations, it took 75ms to evaluate by using the interpreter and
only 3ms using the compiled version of the expression. only 3ms using the compiled version of the expression.
[[expressions-compiler-configuration]] [[expressions-compiler-configuration]]
=== Compiler Configuration === Compiler Configuration
@ -524,7 +520,6 @@ property via a JVM system property (or via the
xref:appendix.adoc#appendix-spring-properties[`SpringProperties`] mechanism) to one of the xref:appendix.adoc#appendix-spring-properties[`SpringProperties`] mechanism) to one of the
`SpelCompilerMode` enum values (`off`, `immediate`, or `mixed`). `SpelCompilerMode` enum values (`off`, `immediate`, or `mixed`).
[[expressions-compiler-limitations]] [[expressions-compiler-limitations]]
=== Compiler Limitations === Compiler Limitations
@ -541,4 +536,3 @@ following kinds of expressions cannot be compiled.
* Expressions using bean references * Expressions using bean references
Compilation of additional kinds of expressions may be supported in the future. Compilation of additional kinds of expressions may be supported in the future.

View File

@ -27,8 +27,6 @@ use a similar nullability arrangement, delivering a consistent overall experienc
Spring application developers. Spring application developers.
[[use-cases]] [[use-cases]]
== Use cases == Use cases
@ -41,8 +39,6 @@ supports {kotlin-docs}/null-safety.html[null-safety]. More details
are available in the xref:languages/kotlin/null-safety.adoc[Kotlin support documentation]. are available in the xref:languages/kotlin/null-safety.adoc[Kotlin support documentation].
[[jsr-305-meta-annotations]] [[jsr-305-meta-annotations]]
== JSR-305 meta-annotations == JSR-305 meta-annotations

View File

@ -14,8 +14,6 @@ Spring. It includes the following topics:
* xref:core/resources.adoc#resources-app-ctx[Application Contexts and Resource Paths] * xref:core/resources.adoc#resources-app-ctx[Application Contexts and Resource Paths]
[[resources-introduction]] [[resources-introduction]]
== Introduction == Introduction
@ -29,8 +27,6 @@ quite complicated, and the `URL` interface still lacks some desirable functional
such as a method to check for the existence of the resource being pointed to. such as a method to check for the existence of the resource being pointed to.
[[resources-resource]] [[resources-resource]]
== The `Resource` Interface == The `Resource` Interface
@ -121,11 +117,8 @@ While this couples your code to Spring, it really only couples it to this small
utility classes, which serves as a more capable replacement for `URL` and can be utility classes, which serves as a more capable replacement for `URL` and can be
considered equivalent to any other library you would use for this purpose. considered equivalent to any other library you would use for this purpose.
NOTE: The `Resource` abstraction does not replace functionality. It wraps it where NOTE: The `Resource` abstraction does not replace functionality. It wraps it where possible.
possible. For example, a `UrlResource` wraps a URL and uses the wrapped `URL` to do its For example, a `UrlResource` wraps a URL and uses the wrapped `URL` to do its work.
work.
[[resources-implementations]] [[resources-implementations]]
@ -145,8 +138,6 @@ For a complete list of `Resource` implementations available in Spring, consult t
"All Known Implementing Classes" section of the "All Known Implementing Classes" section of the
{spring-framework-api}/core/io/Resource.html[`Resource`] javadoc. {spring-framework-api}/core/io/Resource.html[`Resource`] javadoc.
[[resources-implementations-urlresource]] [[resources-implementations-urlresource]]
=== `UrlResource` === `UrlResource`
@ -165,8 +156,6 @@ well-known (to property editor, that is) prefix (such as `classpath:`), it creat
appropriate specialized `Resource` for that prefix. However, if it does not recognize the appropriate specialized `Resource` for that prefix. However, if it does not recognize the
prefix, it assumes the string is a standard URL string and creates a `UrlResource`. prefix, it assumes the string is a standard URL string and creates a `UrlResource`.
[[resources-implementations-classpathresource]] [[resources-implementations-classpathresource]]
=== `ClassPathResource` === `ClassPathResource`
@ -186,8 +175,6 @@ constructor but is often created implicitly when you call an API method that tak
`PropertyEditor` recognizes the special prefix, `classpath:`, on the string path and `PropertyEditor` recognizes the special prefix, `classpath:`, on the string path and
creates a `ClassPathResource` in that case. creates a `ClassPathResource` in that case.
[[resources-implementations-filesystemresource]] [[resources-implementations-filesystemresource]]
=== `FileSystemResource` === `FileSystemResource`
@ -197,8 +184,6 @@ transformations but performing all operations via the `java.nio.file.Files` API.
`java.nio.path.Path` based support use a `PathResource` instead. `FileSystemResource` `java.nio.path.Path` based support use a `PathResource` instead. `FileSystemResource`
supports resolution as a `File` and as a `URL`. supports resolution as a `File` and as a `URL`.
[[resources-implementations-pathresource]] [[resources-implementations-pathresource]]
=== `PathResource` === `PathResource`
@ -208,8 +193,6 @@ as a `URL` and also implements the extended `WritableResource` interface. `PathR
is effectively a pure `java.nio.path.Path` based alternative to `FileSystemResource` with is effectively a pure `java.nio.path.Path` based alternative to `FileSystemResource` with
different `createRelative` behavior. different `createRelative` behavior.
[[resources-implementations-servletcontextresource]] [[resources-implementations-servletcontextresource]]
=== `ServletContextResource` === `ServletContextResource`
@ -222,8 +205,6 @@ filesystem. Whether or not it is expanded and on the filesystem or accessed
directly from the JAR or somewhere else like a database (which is conceivable) is actually directly from the JAR or somewhere else like a database (which is conceivable) is actually
dependent on the Servlet container. dependent on the Servlet container.
[[resources-implementations-inputstreamresource]] [[resources-implementations-inputstreamresource]]
=== `InputStreamResource` === `InputStreamResource`
@ -237,8 +218,6 @@ already-opened resource. Therefore, it returns `true` from `isOpen()`. Do not us
you need to keep the resource descriptor somewhere or if you need to read a stream you need to keep the resource descriptor somewhere or if you need to read a stream
multiple times. multiple times.
[[resources-implementations-bytearrayresource]] [[resources-implementations-bytearrayresource]]
=== `ByteArrayResource` === `ByteArrayResource`
@ -249,8 +228,6 @@ It is useful for loading content from any given byte array without having to res
single-use `InputStreamResource`. single-use `InputStreamResource`.
[[resources-resourceloader]] [[resources-resourceloader]]
== The `ResourceLoader` Interface == The `ResourceLoader` Interface
@ -385,8 +362,6 @@ objects:
|=== |===
[[resources-resourcepatternresolver]] [[resources-resourcepatternresolver]]
== The `ResourcePatternResolver` Interface == The `ResourcePatternResolver` Interface
@ -436,8 +411,6 @@ implements the `ResourcePatternResolver` interface and delegates to the default
==== ====
[[resources-resourceloaderaware]] [[resources-resourceloaderaware]]
== The `ResourceLoaderAware` Interface == The `ResourceLoaderAware` Interface
@ -483,8 +456,6 @@ xref:core/resources.adoc#resources-resourcepatternresolver[`ResourcePatternResol
application components instead of `ResourceLoader`. application components instead of `ResourceLoader`.
[[resources-as-dependencies]] [[resources-as-dependencies]]
== Resources as Dependencies == Resources as Dependencies
@ -631,16 +602,12 @@ Kotlin::
====== ======
[[resources-app-ctx]] [[resources-app-ctx]]
== Application Contexts and Resource Paths == Application Contexts and Resource Paths
This section covers how to create application contexts with resources, including shortcuts This section covers how to create application contexts with resources, including shortcuts
that work with XML, how to use wildcards, and other details. that work with XML, how to use wildcards, and other details.
[[resources-app-ctx-construction]] [[resources-app-ctx-construction]]
=== Constructing Application Contexts === Constructing Application Contexts
@ -720,7 +687,6 @@ Using `FileSystemXmlApplicationContext` loads the bean definitions from the clas
However, it is still a `FileSystemXmlApplicationContext`. If it is subsequently used as a However, it is still a `FileSystemXmlApplicationContext`. If it is subsequently used as a
`ResourceLoader`, any unprefixed paths are still treated as filesystem paths. `ResourceLoader`, any unprefixed paths are still treated as filesystem paths.
[[resources-app-ctx-classpathxml]] [[resources-app-ctx-classpathxml]]
==== Constructing `ClassPathXmlApplicationContext` Instances -- Shortcuts ==== Constructing `ClassPathXmlApplicationContext` Instances -- Shortcuts
@ -766,8 +732,6 @@ Kotlin::
See the {spring-framework-api}/context/support/ClassPathXmlApplicationContext.html[`ClassPathXmlApplicationContext`] See the {spring-framework-api}/context/support/ClassPathXmlApplicationContext.html[`ClassPathXmlApplicationContext`]
javadoc for details on the various constructors. javadoc for details on the various constructors.
[[resources-app-ctx-wildcards-in-resource-paths]] [[resources-app-ctx-wildcards-in-resource-paths]]
=== Wildcards in Application Context Constructor Resource Paths === Wildcards in Application Context Constructor Resource Paths
@ -788,7 +752,6 @@ resolved at construction time. It has nothing to do with the `Resource` type its
You cannot use the `classpath*:` prefix to construct an actual `Resource`, as You cannot use the `classpath*:` prefix to construct an actual `Resource`, as
a resource points to just one resource at a time. a resource points to just one resource at a time.
[[resources-app-ctx-ant-patterns-in-paths]] [[resources-app-ctx-ant-patterns-in-paths]]
==== Ant-style Patterns ==== Ant-style Patterns
@ -832,7 +795,6 @@ walk the contents of the jar and resolve the wildcard. This does work in most en
but fails in others, and we strongly recommend that the wildcard resolution of resources but fails in others, and we strongly recommend that the wildcard resolution of resources
coming from jars be thoroughly tested in your specific environment before you rely on it. coming from jars be thoroughly tested in your specific environment before you rely on it.
[[resources-classpath-wildcards]] [[resources-classpath-wildcards]]
==== The `classpath*:` Prefix ==== The `classpath*:` Prefix
@ -880,7 +842,6 @@ used on the last non-wildcard path segment to get all the matching resources in
class loader hierarchy and then, off each resource, the same `PathMatcher` resolution class loader hierarchy and then, off each resource, the same `PathMatcher` resolution
strategy described earlier is used for the wildcard subpath. strategy described earlier is used for the wildcard subpath.
[[resources-wildcards-in-path-other-stuff]] [[resources-wildcards-in-path-other-stuff]]
==== Other Notes Relating to Wildcards ==== Other Notes Relating to Wildcards
@ -934,8 +895,6 @@ location found. Therefore, in such cases you should prefer using `classpath*:` w
same Ant-style pattern, which searches all classpath locations that contain the same Ant-style pattern, which searches all classpath locations that contain the
`com.mycompany` base package: `classpath*:com/mycompany/**/service-context.xml`. `com.mycompany` base package: `classpath*:com/mycompany/**/service-context.xml`.
[[resources-filesystemresource-caveats]] [[resources-filesystemresource-caveats]]
=== `FileSystemResource` Caveats === `FileSystemResource` Caveats

View File

@ -30,11 +30,8 @@ implementations. They are also discussed in this chapter.
Spring supports Java Bean Validation through setup infrastructure and an adaptor to Spring supports Java Bean Validation through setup infrastructure and an adaptor to
Spring's own `Validator` contract. Applications can enable Bean Validation once globally, Spring's own `Validator` contract. Applications can enable Bean Validation once globally,
as described in xref:core/validation/beanvalidation.adoc[Java Bean Validation], and use it exclusively for all validation as described in xref:core/validation/beanvalidation.adoc[Java Bean Validation], and use
needs. In the web layer, applications can further register controller-local Spring it exclusively for all validation needs. In the web layer, applications can further
`Validator` instances per `DataBinder`, as described in xref:core/validation/beanvalidation.adoc#validation-binder[Configuring a `DataBinder`], which can register controller-local Spring `Validator` instances per `DataBinder`, as described in
be useful for plugging in custom validation logic. xref:core/validation/beanvalidation.adoc#validation-binder[Configuring a `DataBinder`],
which can be useful for plugging in custom validation logic.

View File

@ -703,7 +703,3 @@ This style of `PropertyEditor` registration can lead to concise code (the implem
of the `@InitBinder` method is only one line long) and lets common `PropertyEditor` of the `@InitBinder` method is only one line long) and lets common `PropertyEditor`
registration code be encapsulated in a class and then shared amongst as many controllers registration code be encapsulated in a class and then shared amongst as many controllers
as needed. as needed.

View File

@ -5,7 +5,6 @@ The Spring Framework provides support for the
{bean-validation-site}[Java Bean Validation] API. {bean-validation-site}[Java Bean Validation] API.
[[validation-beanvalidation-overview]] [[validation-beanvalidation-overview]]
== Overview of Bean Validation == Overview of Bean Validation
@ -78,7 +77,6 @@ specific constraints. To learn how to set up a bean validation provider as a Spr
bean, keep reading. bean, keep reading.
[[validation-beanvalidation-spring]] [[validation-beanvalidation-spring]]
== Configuring a Bean Validation Provider == Configuring a Bean Validation Provider
@ -121,7 +119,6 @@ The basic configuration in the preceding example triggers bean validation to ini
using its default bootstrap mechanism. A Bean Validation provider, such as the Hibernate using its default bootstrap mechanism. A Bean Validation provider, such as the Hibernate
Validator, is expected to be present in the classpath and is automatically detected. Validator, is expected to be present in the classpath and is automatically detected.
[[validation-beanvalidation-spring-inject]] [[validation-beanvalidation-spring-inject]]
=== Inject Jakarta Validator === Inject Jakarta Validator
@ -157,7 +154,6 @@ Kotlin::
---- ----
====== ======
[[validation-beanvalidation-spring-inject-adapter]] [[validation-beanvalidation-spring-inject-adapter]]
=== Inject Spring Validator === Inject Spring Validator
@ -199,8 +195,6 @@ invokes the underlying `jakarta.validation.Validator`, and then adapts
``ConstraintViolation``s to ``FieldError``s, and registers them with the `Errors` object ``ConstraintViolation``s to ``FieldError``s, and registers them with the `Errors` object
passed into the `validate` method. passed into the `validate` method.
[[validation-beanvalidation-spring-constraints]] [[validation-beanvalidation-spring-constraints]]
=== Configure Custom Constraints === Configure Custom Constraints
@ -276,7 +270,6 @@ Kotlin::
---- ----
====== ======
As the preceding example shows, a `ConstraintValidator` implementation can have its dependencies As the preceding example shows, a `ConstraintValidator` implementation can have its dependencies
`@Autowired` as any other Spring bean. `@Autowired` as any other Spring bean.
@ -311,7 +304,6 @@ xref:web/webmvc/mvc-ann-rest-exceptions.adoc[Error Responses] sections, and the
xref:web/webflux/controller/ann-validation.adoc[Validation] and xref:web/webflux/controller/ann-validation.adoc[Validation] and
xref:web/webflux/ann-rest-exceptions.adoc[Error Responses] sections. xref:web/webflux/ann-rest-exceptions.adoc[Error Responses] sections.
[[validation-beanvalidation-spring-method-exceptions]] [[validation-beanvalidation-spring-method-exceptions]]
=== Method Validation Exceptions === Method Validation Exceptions
@ -330,7 +322,6 @@ fields and properties, the `ParameterValidationResult` is `ParameterErrors` whic
implements `org.springframework.validation.Errors` and exposes validation errors as implements `org.springframework.validation.Errors` and exposes validation errors as
``FieldError``s. ``FieldError``s.
[[validation-beanvalidation-spring-method-i18n]] [[validation-beanvalidation-spring-method-i18n]]
=== Customizing Validation Errors === Customizing Validation Errors
@ -411,7 +402,6 @@ Properties::
Max.degrees=You cannot provide more than {1} {0} Max.degrees=You cannot provide more than {1} {0}
---- ----
[[validation-beanvalidation-spring-other]] [[validation-beanvalidation-spring-other]]
=== Additional Configuration Options === Additional Configuration Options
@ -422,7 +412,6 @@ constructs, from message interpolation to traversal resolution. See the
javadoc for more information on these options. javadoc for more information on these options.
[[validation-binder]] [[validation-binder]]
== Configuring a `DataBinder` == Configuring a `DataBinder`
@ -479,8 +468,7 @@ locally on a DataBinder instance. See
xref:web/webmvc/mvc-config/validation.adoc[Spring MVC Validation Configuration]. xref:web/webmvc/mvc-config/validation.adoc[Spring MVC Validation Configuration].
[[validation-mvc]] [[validation-mvc]]
== Spring MVC 3 Validation == Spring MVC Validation
See xref:web/webmvc/mvc-config/validation.adoc[Validation] in the Spring MVC chapter. See xref:web/webmvc/mvc-config/validation.adoc[Validation] in the Spring MVC chapter.

View File

@ -22,7 +22,3 @@ in the javadoc of
{spring-framework-api}/validation/MessageCodesResolver.html[`MessageCodesResolver`] and {spring-framework-api}/validation/MessageCodesResolver.html[`MessageCodesResolver`] and
{spring-framework-api}/validation/DefaultMessageCodesResolver.html[`DefaultMessageCodesResolver`], {spring-framework-api}/validation/DefaultMessageCodesResolver.html[`DefaultMessageCodesResolver`],
respectively. respectively.

View File

@ -9,7 +9,6 @@ the required property types. You can also use the public API anywhere in your ap
where type conversion is needed. where type conversion is needed.
[[core-convert-Converter-API]] [[core-convert-Converter-API]]
== Converter SPI == Converter SPI
@ -54,7 +53,6 @@ The following listing shows the `StringToInteger` class, which is a typical `Con
---- ----
[[core-convert-ConverterFactory-SPI]] [[core-convert-ConverterFactory-SPI]]
== Using `ConverterFactory` == Using `ConverterFactory`
@ -146,7 +144,6 @@ NOTE: Because `GenericConverter` is a more complex SPI interface, you should use
it only when you need it. Favor `Converter` or `ConverterFactory` for basic type it only when you need it. Favor `Converter` or `ConverterFactory` for basic type
conversion needs. conversion needs.
[[core-convert-ConditionalGenericConverter-SPI]] [[core-convert-ConditionalGenericConverter-SPI]]
=== Using `ConditionalGenericConverter` === Using `ConditionalGenericConverter`
@ -175,7 +172,6 @@ might match only if the target entity type declares a static finder method (for
`matches(TypeDescriptor, TypeDescriptor)`. `matches(TypeDescriptor, TypeDescriptor)`.
[[core-convert-ConversionService-API]] [[core-convert-ConversionService-API]]
== The `ConversionService` API == The `ConversionService` API
@ -208,7 +204,6 @@ use in most environments. `ConversionServiceFactory` provides a convenient facto
creating common `ConversionService` configurations. creating common `ConversionService` configurations.
[[core-convert-Spring-config]] [[core-convert-Spring-config]]
== Configuring a `ConversionService` == Configuring a `ConversionService`
@ -256,7 +251,6 @@ xref:core/validation/format.adoc#format-FormatterRegistry-SPI[The `FormatterRegi
for details on using `FormattingConversionServiceFactoryBean`. for details on using `FormattingConversionServiceFactoryBean`.
[[core-convert-programmatic-usage]] [[core-convert-programmatic-usage]]
== Using a `ConversionService` Programmatically == Using a `ConversionService` Programmatically

View File

@ -19,6 +19,3 @@ Note there are extra considerations when configuring date and time formats in we
applications. Please see applications. Please see
xref:web/webmvc/mvc-config/conversion.adoc[WebMVC Conversion and Formatting] or xref:web/webmvc/mvc-config/conversion.adoc[WebMVC Conversion and Formatting] or
xref:web/webflux/config.adoc#webflux-config-conversion[WebFlux Conversion and Formatting]. xref:web/webflux/config.adoc#webflux-config-conversion[WebFlux Conversion and Formatting].

View File

@ -26,7 +26,6 @@ application) and need to parse and print localized field values. The `Conversion
provides a unified type conversion API for both SPIs. provides a unified type conversion API for both SPIs.
[[format-Formatter-SPI]] [[format-Formatter-SPI]]
== The `Formatter` SPI == The `Formatter` SPI
@ -143,7 +142,6 @@ The Spring team welcomes community-driven `Formatter` contributions. See
{spring-framework-issues}[GitHub Issues] to contribute. {spring-framework-issues}[GitHub Issues] to contribute.
[[format-CustomFormatAnnotations]] [[format-CustomFormatAnnotations]]
== Annotation-driven Formatting == Annotation-driven Formatting
@ -275,7 +273,6 @@ Kotlin::
---- ----
====== ======
[[format-annotations-api]] [[format-annotations-api]]
=== Format Annotation API === Format Annotation API
@ -335,6 +332,7 @@ https://github.com/spring-projects/spring-framework/wiki/Date-and-Time-Formattin
page in the Spring Framework wiki. page in the Spring Framework wiki.
==== ====
[[format-FormatterRegistry-SPI]] [[format-FormatterRegistry-SPI]]
== The `FormatterRegistry` SPI == The `FormatterRegistry` SPI
@ -376,7 +374,6 @@ annotation are formatted in a certain way. With a shared `FormatterRegistry`, yo
these rules once, and they are applied whenever formatting is needed. these rules once, and they are applied whenever formatting is needed.
[[format-FormatterRegistrar-SPI]] [[format-FormatterRegistrar-SPI]]
== The `FormatterRegistrar` SPI == The `FormatterRegistrar` SPI
@ -401,12 +398,7 @@ registering a `Printer`/`Parser` pair. The next section provides more informatio
converter and formatter registration. converter and formatter registration.
[[format-configuring-formatting-mvc]] [[format-configuring-formatting-mvc]]
== Configuring Formatting in Spring MVC == Configuring Formatting in Spring MVC
See xref:web/webmvc/mvc-config/conversion.adoc[Conversion and Formatting] in the Spring MVC chapter. See xref:web/webmvc/mvc-config/conversion.adoc[Conversion and Formatting] in the Spring MVC chapter.

View File

@ -201,6 +201,3 @@ not involving a binding process. As of 6.1, this has been simplified through a n
a simple `Errors` representation which can be inspected: typically calling `hasErrors()` a simple `Errors` representation which can be inspected: typically calling `hasErrors()`
or the new `failOnError` method for turning the error summary message into an exception or the new `failOnError` method for turning the error summary message into an exception
(for example, `validator.validateObject(myObject).failOnError(IllegalArgumentException::new)`). (for example, `validator.validateObject(myObject).failOnError(IllegalArgumentException::new)`).

View File

@ -8,7 +8,3 @@ interaction between the data access layer and the business or service layer.
Spring's comprehensive transaction management support is covered in some detail, Spring's comprehensive transaction management support is covered in some detail,
followed by thorough coverage of the various data access frameworks and technologies followed by thorough coverage of the various data access frameworks and technologies
with which the Spring Framework integrates. with which the Spring Framework integrates.

View File

@ -2,8 +2,6 @@
= Appendix = Appendix
[[xsd-schemas]] [[xsd-schemas]]
== XML Schemas == XML Schemas
@ -12,8 +10,6 @@ This part of the appendix lists XML schemas for data access, including the follo
* xref:data-access/appendix.adoc#xsd-schemas-tx[The `tx` Schema] * xref:data-access/appendix.adoc#xsd-schemas-tx[The `tx` Schema]
* xref:data-access/appendix.adoc#xsd-schemas-jdbc[The `jdbc` Schema] * xref:data-access/appendix.adoc#xsd-schemas-jdbc[The `jdbc` Schema]
[[xsd-schemas-tx]] [[xsd-schemas-tx]]
=== The `tx` Schema === The `tx` Schema
@ -61,8 +57,6 @@ implemented by using AOP). The preceding XML snippet contains the relevant lines
to reference the `aop` schema so that the elements in the `aop` namespace are available to reference the `aop` schema so that the elements in the `aop` namespace are available
to you. to you.
[[xsd-schemas-jdbc]] [[xsd-schemas-jdbc]]
=== The `jdbc` Schema === The `jdbc` Schema

View File

@ -8,7 +8,6 @@ and it also lets you code without worrying about catching exceptions that are
specific to each technology. specific to each technology.
[[dao-exceptions]] [[dao-exceptions]]
== Consistent Exception Hierarchy == Consistent Exception Hierarchy
@ -42,7 +41,6 @@ The following image shows the exception hierarchy that Spring provides.
image::DataAccessException.png[] image::DataAccessException.png[]
[[dao-annotations]] [[dao-annotations]]
== Annotations Used to Configure DAO or Repository Classes == Annotations Used to Configure DAO or Repository Classes
@ -192,7 +190,3 @@ Kotlin::
NOTE: See the specific coverage of each persistence technology for details on how to NOTE: See the specific coverage of each persistence technology for details on how to
configure the application context to take advantage of these annotations. configure the application context to take advantage of these annotations.

View File

@ -53,6 +53,3 @@ takes care of and which actions are your responsibility.
The Spring Framework takes care of all the low-level details that can make JDBC such a The Spring Framework takes care of all the low-level details that can make JDBC such a
tedious API. tedious API.

View File

@ -312,6 +312,3 @@ each batch should be the batch size provided for all batches (except that the la
that might be less), depending on the total number of update objects provided. The update that might be less), depending on the total number of update objects provided. The update
count for each update statement is the one reported by the JDBC driver. If the count is count for each update statement is the one reported by the JDBC driver. If the count is
not available, the JDBC driver returns a value of `-2`. not available, the JDBC driver returns a value of `-2`.

View File

@ -22,6 +22,3 @@ and match to include a feature from a different approach.
data-access layer. This approach allows you to define your query string, declare data-access layer. This approach allows you to define your query string, declare
parameters, and compile the query. Once you do that, `execute(...)`, `update(...)`, and parameters, and compile the query. Once you do that, `execute(...)`, `update(...)`, and
`findObject(...)` methods can be called multiple times with various parameter values. `findObject(...)` methods can be called multiple times with various parameter values.

View File

@ -62,6 +62,7 @@ The following example shows C3P0 configuration:
include-code::./ComboPooledDataSourceConfiguration[tag=snippet,indent=0] include-code::./ComboPooledDataSourceConfiguration[tag=snippet,indent=0]
[[jdbc-DataSourceUtils]] [[jdbc-DataSourceUtils]]
== Using `DataSourceUtils` == Using `DataSourceUtils`
@ -196,6 +197,3 @@ In terms of exception behavior, `JdbcTransactionManager` is roughly equivalent t
`JpaTransactionManager` and also to `R2dbcTransactionManager`, serving as an immediate `JpaTransactionManager` and also to `R2dbcTransactionManager`, serving as an immediate
companion/replacement for each other. `DataSourceTransactionManager` on the other hand companion/replacement for each other. `DataSourceTransactionManager` on the other hand
is equivalent to `JtaTransactionManager` and can serve as a direct replacement there. is equivalent to `JtaTransactionManager` and can serve as a direct replacement there.

View File

@ -1081,6 +1081,3 @@ Kotlin::
// keyHolder.getKey() now contains the generated key // keyHolder.getKey() now contains the generated key
---- ----
====== ======

View File

@ -255,6 +255,3 @@ You can extend Spring JDBC embedded database support in two ways:
We encourage you to contribute extensions to the Spring community at We encourage you to contribute extensions to the Spring community at
{spring-framework-issues}[GitHub Issues]. {spring-framework-issues}[GitHub Issues].

View File

@ -141,6 +141,3 @@ Ensuring that the database initializer is initialized first can also be easy. So
parent context contains the `DataSource`, and the child context contains the business parent context contains the `DataSource`, and the child context contains the business
components). This structure is common in Spring web applications but can be more components). This structure is common in Spring web applications but can be more
generally applied. generally applied.

View File

@ -599,6 +599,3 @@ Kotlin::
} }
---- ----
====== ======

View File

@ -8,7 +8,9 @@ and its various callback interfaces, plus a variety of related classes. A subpac
named `org.springframework.jdbc.core.simple` contains the `SimpleJdbcInsert` and named `org.springframework.jdbc.core.simple` contains the `SimpleJdbcInsert` and
`SimpleJdbcCall` classes. Another subpackage named `SimpleJdbcCall` classes. Another subpackage named
`org.springframework.jdbc.core.namedparam` contains the `NamedParameterJdbcTemplate` `org.springframework.jdbc.core.namedparam` contains the `NamedParameterJdbcTemplate`
class and the related support classes. See xref:data-access/jdbc/core.adoc[Using the JDBC Core Classes to Control Basic JDBC Processing and Error Handling], xref:data-access/jdbc/advanced.adoc[JDBC Batch Operations], and class and the related support classes. See
xref:data-access/jdbc/core.adoc[Using the JDBC Core Classes to Control Basic JDBC Processing and Error Handling],
xref:data-access/jdbc/advanced.adoc[JDBC Batch Operations], and
xref:data-access/jdbc/simple.adoc[Simplifying JDBC Operations with the `SimpleJdbc` Classes]. xref:data-access/jdbc/simple.adoc[Simplifying JDBC Operations with the `SimpleJdbc` Classes].
* `datasource`: The `org.springframework.jdbc.datasource` package contains a utility class * `datasource`: The `org.springframework.jdbc.datasource` package contains a utility class
@ -16,7 +18,8 @@ for easy `DataSource` access and various simple `DataSource` implementations tha
use for testing and running unmodified JDBC code outside of a Jakarta EE container. A subpackage use for testing and running unmodified JDBC code outside of a Jakarta EE container. A subpackage
named `org.springframework.jdbc.datasource.embedded` provides support for creating named `org.springframework.jdbc.datasource.embedded` provides support for creating
embedded databases by using Java database engines, such as HSQL, H2, and Derby. See embedded databases by using Java database engines, such as HSQL, H2, and Derby. See
xref:data-access/jdbc/connections.adoc[Controlling Database Connections] and xref:data-access/jdbc/embedded-database-support.adoc[Embedded Database Support]. xref:data-access/jdbc/connections.adoc[Controlling Database Connections] and
xref:data-access/jdbc/embedded-database-support.adoc[Embedded Database Support].
* `object`: The `org.springframework.jdbc.object` package contains classes that represent * `object`: The `org.springframework.jdbc.object` package contains classes that represent
RDBMS queries, updates, and stored procedures as thread-safe, reusable objects. See RDBMS queries, updates, and stored procedures as thread-safe, reusable objects. See
@ -31,7 +34,5 @@ are translated to exceptions defined in the `org.springframework.dao` package. T
that code using the Spring JDBC abstraction layer does not need to implement JDBC or that code using the Spring JDBC abstraction layer does not need to implement JDBC or
RDBMS-specific error handling. All translated exceptions are unchecked, which gives you RDBMS-specific error handling. All translated exceptions are unchecked, which gives you
the option of catching the exceptions from which you can recover while letting other the option of catching the exceptions from which you can recover while letting other
exceptions be propagated to the caller. See xref:data-access/jdbc/core.adoc#jdbc-SQLExceptionTranslator[Using `SQLExceptionTranslator`]. exceptions be propagated to the caller. See
xref:data-access/jdbc/core.adoc#jdbc-SQLExceptionTranslator[Using `SQLExceptionTranslator`].

View File

@ -231,4 +231,3 @@ access by unwrapping it. You can use the `SqlTypeValue` to create an array and p
it with values from the Java `java.sql.Array`, as the following example shows: it with values from the Java `java.sql.Array`, as the following example shows:
include-code::./SqlTypeValueFactory[tag=oracle-array,indent=0] include-code::./SqlTypeValueFactory[tag=oracle-array,indent=0]

View File

@ -768,6 +768,3 @@ Kotlin::
The `execute` call passes in an empty `Map`, because this call does not take any parameters. The `execute` call passes in an empty `Map`, because this call does not take any parameters.
The list of actors is then retrieved from the results map and returned to the caller. The list of actors is then retrieved from the results map and returned to the caller.

View File

@ -3,6 +3,3 @@
:page-section-summary-toc: 1 :page-section-summary-toc: 1
This section covers data access when you use Object Relational Mapping (ORM). This section covers data access when you use Object Relational Mapping (ORM).

View File

@ -109,6 +109,3 @@ In summary, you can implement DAOs based on the plain persistence technology's A
annotations while still benefiting from Spring-managed transactions, dependency annotations while still benefiting from Spring-managed transactions, dependency
injection, and transparent exception conversion (if desired) to Spring's custom injection, and transparent exception conversion (if desired) to Spring's custom
exception hierarchies. exception hierarchies.

View File

@ -515,6 +515,3 @@ the following events occur when a JTA transaction commits:
* Hibernate is synchronized to the JTA transaction, so the transaction is called back * Hibernate is synchronized to the JTA transaction, so the transaction is called back
through an `afterCompletion` callback by the JTA transaction manager and can through an `afterCompletion` callback by the JTA transaction manager and can
properly clear its cache. properly clear its cache.

View File

@ -48,7 +48,8 @@ The benefits of using the Spring Framework to create your ORM DAOs include:
aspect-oriented programming (AOP) style method interceptor either through the aspect-oriented programming (AOP) style method interceptor either through the
`@Transactional` annotation or by explicitly configuring the transaction AOP advice in `@Transactional` annotation or by explicitly configuring the transaction AOP advice in
an XML configuration file. In both cases, transaction semantics and exception handling an XML configuration file. In both cases, transaction semantics and exception handling
(rollback and so on) are handled for you. As discussed in xref:data-access/orm/general.adoc#orm-resource-mngmnt[Resource and Transaction Management], (rollback and so on) are handled for you. As discussed in
xref:data-access/orm/general.adoc#orm-resource-mngmnt[Resource and Transaction Management],
you can also swap various transaction managers, without affecting your ORM-related code. you can also swap various transaction managers, without affecting your ORM-related code.
For example, you can swap between local transactions and JTA, with the same full services For example, you can swap between local transactions and JTA, with the same full services
(such as declarative transactions) available in both scenarios. Additionally, (such as declarative transactions) available in both scenarios. Additionally,
@ -61,6 +62,3 @@ technologies such as MongoDB, you might want to check out the
{spring-site-projects}/spring-data/[Spring Data] suite of projects. If you are {spring-site-projects}/spring-data/[Spring Data] suite of projects. If you are
a JPA user, the {spring-site-guides}/gs/accessing-data-jpa/[Getting Started Accessing a JPA user, the {spring-site-guides}/gs/accessing-data-jpa/[Getting Started Accessing
Data with JPA] guide from https://spring.io provides a great introduction. Data with JPA] guide from https://spring.io provides a great introduction.

View File

@ -627,7 +627,3 @@ On `LocalSessionFactoryBean`, this is available through the `bootstrapExecutor`
property. On the programmatic `LocalSessionFactoryBuilder`, an overloaded property. On the programmatic `LocalSessionFactoryBuilder`, an overloaded
`buildSessionFactory` method takes a bootstrap executor argument. `buildSessionFactory` method takes a bootstrap executor argument.
==== ====

Some files were not shown because too many files have changed in this diff Show More