Skip to content

Commit 0b50d1e

Browse files
committed
Merge branch '5.1.x'
2 parents c80028b + 484ec64 commit 0b50d1e

File tree

2 files changed

+86
-86
lines changed

2 files changed

+86
-86
lines changed

src/docs/asciidoc/integration-appendix.adoc

+15-16
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,10 @@ different properties with `jee`:
176176
[[xsd-schemas-jee-local-slsb]]
177177
==== `<jee:local-slsb/>` (Simple)
178178

179-
The `<jee:local-slsb/>` element configures a reference to a local EJB Stateless SessionBean.
179+
The `<jee:local-slsb/>` element configures a reference to a local EJB Stateless Session Bean.
180180

181-
The following example shows how to configures a reference to a local EJB Stateless
182-
SessionBean without `jee`:
181+
The following example shows how to configures a reference to a local EJB Stateless Session Bean
182+
without `jee`:
183183

184184
[source,xml,indent=0]
185185
[subs="verbatim,quotes"]
@@ -191,8 +191,8 @@ SessionBean without `jee`:
191191
</bean>
192192
----
193193

194-
The following example shows how to configures a reference to a local EJB Stateless
195-
SessionBean with `jee`:
194+
The following example shows how to configures a reference to a local EJB Stateless Session Bean
195+
with `jee`:
196196

197197
[source,xml,indent=0]
198198
[subs="verbatim,quotes"]
@@ -206,10 +206,10 @@ SessionBean with `jee`:
206206
[[xsd-schemas-jee-local-slsb-complex]]
207207
==== `<jee:local-slsb/>` (Complex)
208208

209-
The `<jee:local-slsb/>` element configures a reference to a local EJB Stateless SessionBean.
209+
The `<jee:local-slsb/>` element configures a reference to a local EJB Stateless Session Bean.
210210

211-
The following example shows how to configures a reference to a local EJB Stateless
212-
SessionBean and a number of properties without `jee`:
211+
The following example shows how to configures a reference to a local EJB Stateless Session Bean
212+
and a number of properties without `jee`:
213213

214214
[source,xml,indent=0]
215215
[subs="verbatim,quotes"]
@@ -224,8 +224,8 @@ SessionBean and a number of properties without `jee`:
224224
</bean>
225225
----
226226

227-
The following example shows how to configures a reference to a local EJB Stateless
228-
SessionBean and a number of properties with `jee`:
227+
The following example shows how to configures a reference to a local EJB Stateless Session Bean
228+
and a number of properties with `jee`:
229229

230230
[source,xml,indent=0]
231231
[subs="verbatim,quotes"]
@@ -242,11 +242,10 @@ SessionBean and a number of properties with `jee`:
242242
[[xsd-schemas-jee-remote-slsb]]
243243
==== <jee:remote-slsb/>
244244

245-
The `<jee:remote-slsb/>` element configures a reference to a `remote` EJB Stateless
246-
SessionBean.
245+
The `<jee:remote-slsb/>` element configures a reference to a `remote` EJB Stateless Session Bean.
247246

248-
The following example shows how to configures a reference to a remote EJB Stateless
249-
SessionBean without `jee`:
247+
The following example shows how to configures a reference to a remote EJB Stateless Session Bean
248+
without `jee`:
250249

251250
[source,xml,indent=0]
252251
[subs="verbatim,quotes"]
@@ -263,8 +262,8 @@ SessionBean without `jee`:
263262
</bean>
264263
----
265264

266-
The following example shows how to configures a reference to a remote EJB Stateless
267-
SessionBean with `jee`:
265+
The following example shows how to configures a reference to a remote EJB Stateless Session Bean
266+
with `jee`:
268267

269268
[source,xml,indent=0]
270269
[subs="verbatim,quotes"]

src/docs/asciidoc/integration.adoc

+71-70
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ a number of Java EE (and related) technologies.
1919
== Remoting and Web Services with Spring
2020

2121
Spring features integration classes for remoting support with various technologies.
22-
The remoting support eases the development of remote-enabled services, implemented by
23-
your usual POJOs. Currently, Spring supports the following remoting technologies:
22+
The remoting support eases the development of remote-enabled services, implemented
23+
by your usual POJOs. Currently, Spring supports the following remoting technologies:
2424

2525
* *Remote Method Invocation (RMI)*: Through the use of `RmiProxyFactoryBean` and
2626
`RmiServiceExporter`, Spring supports both traditional RMI (with `java.rmi.Remote`
@@ -34,10 +34,11 @@ your usual POJOs. Currently, Spring supports the following remoting technologies
3434
`HessianServiceExporter`, you can transparently expose your services through the
3535
lightweight binary HTTP-based protocol provided by Caucho.
3636
* *JAX-WS*: Spring provides remoting support for web services through JAX-WS.
37-
* *JMS*: Remoting by using JMS as the underlying protocol is supported through the
38-
`JmsInvokerServiceExporter` and `JmsInvokerProxyFactoryBean` classes.
39-
* *AMQP*: Remoting by using AMQP as the underlying protocol is supported by the Spring
40-
AMQP project.
37+
* *JMS*: Remoting via JMS as the underlying protocol is supported through the
38+
`JmsInvokerServiceExporter` and `JmsInvokerProxyFactoryBean` classes in the
39+
`spring-jms` module.
40+
* *AMQP*: Remoting via AMQP as the underlying protocol is supported by the
41+
separate Spring AMQP project.
4142

4243
While discussing the remoting capabilities of Spring, we use the following domain
4344
model and corresponding services:
@@ -86,9 +87,9 @@ model and corresponding services:
8687
}
8788
----
8889

89-
This section starts by exposing the service to a remote client by using RMI and talk a bit about
90-
the drawbacks of using RMI. It then continues with an example that uses Hessian as the
91-
protocol.
90+
This section starts by exposing the service to a remote client by using RMI and talk a bit
91+
about the drawbacks of using RMI. It then continues with an example that uses Hessian as
92+
the protocol.
9293

9394

9495

@@ -141,8 +142,8 @@ The following example shows how to do so:
141142
In the preceding example, we override the port for the RMI registry. Often, your application
142143
server also maintains an RMI registry, and it is wise to not interfere with that one.
143144
Furthermore, the service name is used to bind the service. So, in the preceding example, the
144-
service is bound at `'rmi://HOST:1199/AccountService'`. We use this URL later on
145-
to link in the service at the client side.
145+
service is bound at `'rmi://HOST:1199/AccountService'`. We use this URL later on to link in
146+
the service at the client side.
146147

147148
NOTE: The `servicePort` property has been omitted (it defaults to 0). This means that an
148149
anonymous port is used to communicate with the service.
@@ -6776,16 +6777,17 @@ You can find a further explanation of the differences between a buffer and a cac
67766777
https://en.wikipedia.org/wiki/Cache_(computing)#The_difference_between_buffer_and_cache[here].
67776778
****
67786779

6779-
At its core, the cache abstraction applies caching to Java methods, thus reducing the number
6780-
of executions based on the information available in the cache. That is, each time a
6781-
targeted method is invoked, the abstraction applies a caching behavior that checks
6782-
whether the method has been already executed for the given arguments. If it has been executed,
6783-
the cached result is returned without having to execute the actual method. If the method has
6784-
not been executed, then it is executed, and the result is cached and returned to the user so that, the
6785-
next time the method is invoked, the cached result is returned. This way, expensive
6786-
methods (whether CPU- or IO-bound) can be executed only once for a given set of
6787-
parameters and the result reused without having to actually execute the method again.
6788-
The caching logic is applied transparently without any interference to the invoker.
6780+
At its core, the cache abstraction applies caching to Java methods, thus reducing the
6781+
number of executions based on the information available in the cache. That is, each time
6782+
a targeted method is invoked, the abstraction applies a caching behavior that checks
6783+
whether the method has been already executed for the given arguments. If it has been
6784+
executed, the cached result is returned without having to execute the actual method.
6785+
If the method has not been executed, then it is executed, and the result is cached and
6786+
returned to the user so that, the next time the method is invoked, the cached result is
6787+
returned. This way, expensive methods (whether CPU- or IO-bound) can be executed only
6788+
once for a given set of parameters and the result reused without having to actually
6789+
execute the method again. The caching logic is applied transparently without any
6790+
interference to the invoker.
67896791

67906792
IMPORTANT: This approach works only for methods that are guaranteed to return the same
67916793
output (result) for a given input (or arguments) no matter how many times it is executed.
@@ -6794,12 +6796,11 @@ The caching abstraction provides other cache-related operations, such as the abi
67946796
to update the content of the cache or to remove one or all entries. These are useful if
67956797
the cache deals with data that can change during the course of the application.
67966798

6797-
As with other services in the Spring Framework, the caching service is an
6798-
abstraction (not a cache implementation) and requires the use of actual storage to
6799-
store the cache data -- that is, the abstraction frees you from having to write
6800-
the caching logic but does not provide the actual data store. This abstraction is
6801-
materialized by the `org.springframework.cache.Cache` and
6802-
`org.springframework.cache.CacheManager` interfaces.
6799+
As with other services in the Spring Framework, the caching service is an abstraction
6800+
(not a cache implementation) and requires the use of actual storage to store the cache data --
6801+
that is, the abstraction frees you from having to write the caching logic but does not
6802+
provide the actual data store. This abstraction is materialized by the
6803+
`org.springframework.cache.Cache` and `org.springframework.cache.CacheManager` interfaces.
68036804

68046805
Spring provides <<cache-store-configuration, a few implementations>> of that abstraction:
68056806
JDK `java.util.concurrent.ConcurrentMap` based caches, https://www.ehcache.org/[Ehcache 2.x],
@@ -6844,11 +6845,12 @@ For caching declaration, Spring's caching abstraction provides a set of Java ann
68446845
[[cache-annotations-cacheable]]
68456846
==== The `@Cacheable` Annotation
68466847

6847-
As the name implies, you can use `@Cacheable` to demarcate methods that are cacheable -- that
6848-
is, methods for which the result is stored in the cache so that, on subsequent invocations
6849-
(with the same arguments), the value in the cache is returned without having to actually
6850-
execute the method. In its simplest form, the annotation declaration requires the name
6851-
of the cache associated with the annotated method, as the following example shows:
6848+
As the name implies, you can use `@Cacheable` to demarcate methods that are cacheable --
6849+
that is, methods for which the result is stored in the cache so that, on subsequent
6850+
invocations (with the same arguments), the value in the cache is returned without
6851+
having to actually execute the method. In its simplest form, the annotation declaration
6852+
requires the name of the cache associated with the annotated method, as the following
6853+
example shows:
68526854

68536855
[source,java,indent=0]
68546856
[subs="verbatim,quotes"]
@@ -6860,10 +6862,9 @@ of the cache associated with the annotated method, as the following example show
68606862
In the preceding snippet, the `findBook` method is associated with the cache named `books`.
68616863
Each time the method is called, the cache is checked to see whether the invocation has
68626864
already been executed and does not have to be repeated. While in most cases, only one
6863-
cache is declared, the annotation lets multiple names be specified so that more
6864-
than one cache is being used. In this case, each of the caches is checked before
6865-
executing the method -- if at least one cache is hit, the associated value is
6866-
returned.
6865+
cache is declared, the annotation lets multiple names be specified so that more than one
6866+
cache is being used. In this case, each of the caches is checked before executing the
6867+
method -- if at least one cache is hit, the associated value is returned.
68676868

68686869
NOTE: All the other caches that do not contain the value are also updated, even though
68696870
the cached method was not actually executed.
@@ -6880,17 +6881,17 @@ The following example uses `@Cacheable` on the `findBook` method:
68806881
[[cache-annotations-cacheable-default-key]]
68816882
===== Default Key Generation
68826883

6883-
Since caches are essentially key-value stores, each invocation of a cached method needs
6884-
to be translated into a suitable key for cache access. The caching
6885-
abstraction uses a simple `KeyGenerator` based on the following algorithm:
6884+
Since caches are essentially key-value stores, each invocation of a cached method
6885+
needs to be translated into a suitable key for cache access. The caching abstraction
6886+
uses a simple `KeyGenerator` based on the following algorithm:
68866887

68876888
* If no params are given, return `SimpleKey.EMPTY`.
68886889
* If only one param is given, return that instance.
68896890
* If more than one param is given, return a `SimpleKey` that contains all parameters.
68906891

68916892
This approach works well for most use-cases, as long as parameters have natural keys
6892-
and implement valid `hashCode()` and `equals()` methods. If that is not the case, you need to change the
6893-
strategy.
6893+
and implement valid `hashCode()` and `equals()` methods. If that is not the case,
6894+
you need to change the strategy.
68946895

68956896
To provide a different default key generator, you need to implement the
68966897
`org.springframework.cache.interceptor.KeyGenerator` interface.
@@ -6956,8 +6957,9 @@ The preceding snippets show how easy it is to select a certain argument, one of
69566957
properties, or even an arbitrary (static) method.
69576958

69586959
If the algorithm responsible for generating the key is too specific or if it needs
6959-
to be shared, you can define a custom `keyGenerator` on the operation. To do
6960-
so, specify the name of the `KeyGenerator` bean implementation to use, as the following example shows:
6960+
to be shared, you can define a custom `keyGenerator` on the operation. To do so,
6961+
specify the name of the `KeyGenerator` bean implementation to use, as the following
6962+
example shows:
69616963

69626964
[source,java,indent=0]
69636965
[subs="verbatim,quotes"]
@@ -6985,8 +6987,8 @@ To provide a different default cache resolver, you need to implement the
69856987
The default cache resolution fits well for applications that work with a
69866988
single `CacheManager` and have no complex cache resolution requirements.
69876989

6988-
For applications that work with several cache managers, you can
6989-
set the `cacheManager` to use for each operation, as the following example shows:
6990+
For applications that work with several cache managers, you can set the
6991+
`cacheManager` to use for each operation, as the following example shows:
69906992

69916993
[source,java,indent=0]
69926994
[subs="verbatim,quotes"]
@@ -7034,8 +7036,8 @@ of caching.
70347036

70357037
For those particular cases, you can use the `sync` attribute to instruct the underlying
70367038
cache provider to lock the cache entry while the value is being computed. As a result,
7037-
only one thread is busy computing the value, while the others are blocked until the
7038-
entry is updated in the cache. The following example shows how to use the `sync` attribute:
7039+
only one thread is busy computing the value, while the others are blocked until the entry
7040+
is updated in the cache. The following example shows how to use the `sync` attribute:
70397041

70407042
[source,java,indent=0]
70417043
[subs="verbatim,quotes"]
@@ -7046,8 +7048,8 @@ entry is updated in the cache. The following example shows how to use the `sync`
70467048
<1> Using the `sync` attribute.
70477049

70487050

7049-
NOTE: This is an optional feature, and your favorite cache library may not support it. All
7050-
`CacheManager` implementations provided by the core framework support it. See the
7051+
NOTE: This is an optional feature, and your favorite cache library may not support it.
7052+
All `CacheManager` implementations provided by the core framework support it. See the
70517053
documentation of your cache provider for more details.
70527054

70537055
[[cache-annotations-cacheable-condition]]
@@ -7161,11 +7163,11 @@ available to the context so that you can use them for key and conditional comput
71617163
[[cache-annotations-put]]
71627164
==== The `@CachePut` Annotation
71637165

7164-
When the cache needs to be updated without interfering with the method
7165-
execution, you can use the `@CachePut` annotation. That is, the method is always
7166-
executed and its result is placed into the cache (according to the `@CachePut` options). It
7167-
supports the same options as `@Cacheable` and should be used for cache population rather
7168-
than method flow optimization. The following example uses the `@CachePut` annotation:
7166+
When the cache needs to be updated without interfering with the method execution,
7167+
you can use the `@CachePut` annotation. That is, the method is always executed and its
7168+
result is placed into the cache (according to the `@CachePut` options). It supports
7169+
the same options as `@Cacheable` and should be used for cache population rather than
7170+
method flow optimization. The following example uses the `@CachePut` annotation:
71697171

71707172
[source,java,indent=0]
71717173
[subs="verbatim,quotes"]
@@ -7177,11 +7179,11 @@ than method flow optimization. The following example uses the `@CachePut` annota
71777179
IMPORTANT: Using `@CachePut` and `@Cacheable` annotations on the same method is generally
71787180
strongly discouraged because they have different behaviors. While the latter causes the
71797181
method execution to be skipped by using the cache, the former forces the execution in
7180-
order to execute a cache update. This leads to unexpected behavior and, with the exception of
7181-
specific corner-cases (such as annotations having conditions that exclude them from each
7182+
order to execute a cache update. This leads to unexpected behavior and, with the exception
7183+
of specific corner-cases (such as annotations having conditions that exclude them from each
71827184
other), such declarations should be avoided. Note also that such conditions should not rely
7183-
on the result object (that is, the `#result` variable), as these are validated up-front to confirm
7184-
the exclusion.
7185+
on the result object (that is, the `#result` variable), as these are validated up-front to
7186+
confirm the exclusion.
71857187

71867188

71877189
[[cache-annotations-evict]]
@@ -7207,11 +7209,11 @@ all entries from the `books` cache:
72077209
<1> Using the `allEntries` attribute to evict all entries from the cache.
72087210

72097211

7210-
This option comes in handy when an entire cache region needs to be cleared out. Rather
7211-
than evicting each entry (which would take a long time, since it is inefficient), all the
7212-
entries are removed in one operation, as the preceding example shows. Note that the framework ignores
7213-
any key specified in this scenario as it does not apply (the entire cache is evicted, not
7214-
only one entry).
7212+
This option comes in handy when an entire cache region needs to be cleared out.
7213+
Rather than evicting each entry (which would take a long time, since it is inefficient),
7214+
all the entries are removed in one operation, as the preceding example shows.
7215+
Note that the framework ignores any key specified in this scenario as it does not apply
7216+
(the entire cache is evicted, not only one entry).
72157217

72167218
You can also indicate whether the eviction should occur after (the default) or before
72177219
the method executes by using the `beforeInvocation` attribute. The former provides the
@@ -7222,10 +7224,9 @@ The latter (`beforeInvocation=true`) causes the eviction to always occur before
72227224
method is invoked. This is useful in cases where the eviction does not need to be tied
72237225
to the method outcome.
72247226

7225-
Note that `void` methods can be used with `@CacheEvict` - as the
7226-
methods act as a trigger, the return values are ignored (as they do not interact with the
7227-
cache). This is not the case with `@Cacheable` which adds or updates data into the cache
7228-
and, thus, requires a result.
7227+
Note that `void` methods can be used with `@CacheEvict` - as the methods act as a trigger,
7228+
the return values are ignored (as they do not interact with the cache). This is not the case
7229+
with `@Cacheable` which adds or updates data into the cache and, thus, requires a result.
72297230

72307231

72317232
[[cache-annotations-caching]]
@@ -7714,9 +7715,9 @@ or eviction contracts.
77147715

77157716
NOTE: Ehcache 3.x is fully JSR-107 compliant and no dedicated support is required for it.
77167717

7717-
The Ehcache 2.x implementation is located in the `org.springframework.cache.ehcache` package.
7718-
Again, to use it, you need to declare the appropriate `CacheManager`. The following
7719-
example shows how to do so:
7718+
The Ehcache 2.x implementation is located in the `org.springframework.cache.ehcache`
7719+
package. Again, to use it, you need to declare the appropriate `CacheManager`.
7720+
The following example shows how to do so:
77207721

77217722
[source,xml,indent=0]
77227723
[subs="verbatim,quotes"]

0 commit comments

Comments
 (0)