Commit Graph

1657 Commits

Author SHA1 Message Date
Phillip Webb c6c2959aa3 Merge remote-tracking branch '1.3.x' 2016-02-19 16:10:09 -08:00
Phillip Webb a9afe0a944 Formatting 2016-02-19 16:07:10 -08:00
Andy Wilkinson d6e0b5a165 Use @DirtiesContext to avoid unwanted context caching in the tests
We rarely use the same configuration in multiple test classes, but
Spring’s Test framework caches each context by default. For projects
with large numbers of integration tests, this can lead to tens of
contexts being cached. This increases memory usage, live thread count,
etc for no benefit.

This commit adds @DirtiesContext to the integration tests in
spring-boot, spring-boot-autoconfigure, and spring-boot-actuator so
that the context is closed once the test class has completed.

See gh-5141
2016-02-19 11:20:22 +00:00
Stephane Nicoll a95568d3e8 Polish contribution
Closes gh-5128
2016-02-18 15:27:36 +01:00
Christoph Strobl fc22731420 Add Redis Cluster support
Introduce configuration options for "spring.redis.cluster.nodes" and
"spring.redis.cluster.max-redirects". Properties such as "timeout" and
others remain available via "spring.redis.timeout" and do not have to be
configured on the cluster itself.

See gh-5128
2016-02-18 15:27:36 +01:00
Stephane Nicoll 888270bd03 Polish contribution
Closes gh-5171
2016-02-18 11:30:02 +01:00
Brian Clozel 4ca04abcb2 Add configuration key for GzipResourceResolver
This commit adds a new key that configures a GzipResourceResolver
in the resource handling chain.

Configuring an application with the following will add that resolver,
which checks for gzipped resources in the configured locations:

```
spring.resources.chain.gzipped=true
```

This means that if a resource "style.css" is requested, the
GzipResourceResolver will look for resources named "style.css.gz", which
should be a gzipped variant of the "style.css" file. Note that this
resolver only checks for variants if the client supports the "gzip"
encoding, as defined in the "Accept-Encoding" HTTP request headers.

Fixes #4683
2016-02-18 11:27:15 +01:00
Andy Wilkinson 4189e145bb Polishing
- Remove usages of deprecated APIs
 - Remove redundant version on dependency declaration
2016-02-17 16:53:09 +00:00
Stephane Nicoll d5732afa67 Add missing configuration entry 2016-02-17 11:00:33 +01:00
Stephane Nicoll 90f0fc6ce3 Harmonize JTA properties
Previously, both Atomikos and Bitronix were bound on the `spring.jta`
namespace which makes very hard to figure out which property belong to
which implementation. Besides, `AtomikosProperties` only exposed public
setter which does not generate any useful meta-data.

This commit moves the external configuration for Atomikos and Bitronix to
`spring.jta.atomikos.properties` and `spring.jta.bitronix.properties`
respectively. It also improves the meta-data support for those two
namespaces.

Closes gh-5165
2016-02-16 16:44:50 +01:00
Stephane Nicoll ff5b05fed9 Override default consistency for Couchbase
Spring Data Couchbase 2.0 sets the default consistency to "update-after"
which is good for performance reason but can be quite confusing. Since
the team has decided to switch to "read-your-own-writes" in 2.1, Spring
Boot already offers the improved default right now.

This commit exposes an additional property that can be used to change
the Couchbase's default consistency.

Closes gh-5159
2016-02-16 14:28:09 +01:00
Stephane Nicoll 64a5cad09a Improve couchbase support
Expose an `auto-index` property that controls if views and indexes
should be created automatically.

Update the sample so that it uses this new property, lowering the manual
steps to make it working on a vanilla couchbase server.

See gh-3498
2016-02-16 11:42:14 +01:00
Stephane Nicoll da3b49e024 Polish contribution
Closes gh-3499
2016-02-16 09:31:50 +01:00
Eddú Meléndez 76f1ca4188 Add Couchbase support
Closes gh-3498
2016-02-16 09:31:50 +01:00
Andy Wilkinson ecf11e0230 Merge branch '1.3.x' 2016-02-15 21:46:06 +00:00
Andy Wilkinson d69e0486c1 Allow Thymeleaf's LayoutDialect to be overridden
Closes gh-5151
2016-02-15 21:27:34 +00:00
Stephane Nicoll b205e02e33 Upgrade to Spring Data Hopper M1
Closes gh-5120
2016-02-15 14:57:08 +01:00
Stephane Nicoll 85cc885fd1 Merge branch '1.3.x' 2016-02-12 16:26:41 +01:00
Stephane Nicoll b726974bca Allow to easily customize ListenerContainerFactory
Previously, if one wants to create a custom `JmsListenerContainerFactory`
or `RabbitListenerContainerFactory`, a bunch of code from the auto-
configuration must be duplicated.

This commit introduces two services to configure such factory for JMS
and AMQP with the same sensible defaults that were applied by the
auto-configufrations.

Closes gh-5138
2016-02-12 16:16:44 +01:00
Andy Wilkinson 3f0686fa7e Merge branch '1.3.x' 2016-02-11 14:27:07 +00:00
Andy Wilkinson fc2e51a773 Preserve ordering when auto-configuring WebSocket MessageConverters
Previously, WebSocketMessagingAutoConfiguration added a single
additional converter. This was a MappingJackson2MessageConverter
configured with the auto-configured ObjectMapper.
AbstractMessageBrokerConfiguration places additional converters before
any of the default converters. This meant that the auto-configuration
had the unwanted side-effect of changing the ordering of the
converters. A MappingJackson2MessageConverter was now first in the
list, whereas, by default, it's last in the list after a
StringMessageConverter and a ByteArrayMessageConverter.

This commit updates WebSocketMessagingAutoConfiguration so that it
switches off the registration of the default converters and registers
a StringMessageConverter, ByteArrayMessageConverter and
MappingJackson2MessageConverter in that order. A test has been
added to verify that the types of these three converters match
the types of the default converters. A second test that verifies
that String responses are converted correctly has also been added
alongside the existing test that verified the behaviour for JSON
responses.

Closes gh-5123
2016-02-11 14:18:24 +00:00
Stephane Nicoll b3069e4d43 Merge branch '1.3.x' 2016-02-11 15:05:55 +01:00
Stephane Nicoll c10943c653 Polish Javadoc
Closes gh-4936
2016-02-11 15:05:07 +01:00
Kazuki Shimizu 4e177eeed7 Auto-configure ResourceUrlEncodingFilter when using FreeMarker
Closes gh-5126
2016-02-11 11:33:57 +00:00
Stephane Nicoll 1f106ddf8c Enable connection validation by default
Hikari and Commons DBCP2 are already validating that the connection is
valid before borrowing it from the pool. This commit makes that behaviour
consistent by enabling that feature for the Tomcat and Commons DBCP data
sources.

Since a validation query is required in those cases, the infrastructure
of `DataSourceHealthIndicator` has been merged in a single place: the
`DatabaseDriver` enum provides not only the driver class names but also
the validation query, if any.

Closes gh-4906
2016-02-11 12:03:18 +01:00
Stephane Nicoll eb7b1ec33c Merge branch '1.3.x' 2016-02-10 14:29:59 +01:00
Stephane Nicoll 2a8a3741f5 Merge DriverClassNameProvider in DatabaseDriver
DriverClassNameProvider is unused but was probably restored by a merge
commit at some point. It wasn't obvious and updated that class rather
than `DatabaseDriver`.

This commit updates `DatabaseDriver` and deletes
`DriverClassNameProvider`.

Closes gh-5076
2016-02-10 14:28:58 +01:00
Phillip Webb 2b18e99ac7 Polish 2016-02-08 11:01:52 -08:00
Stephane Nicoll a27176807f Polish contribution
Closes gh-4188
2016-02-08 15:44:09 +01:00
Eddú Meléndez 5776d6a8d7 Add support of Jackson in Jersey
If Jackson is configured for the project, the `ObjectMapper` is now
reused and added in the Jersey's context.

Closes gh-4131
2016-02-08 15:34:44 +01:00
Phillip Webb a5ae81c1c1 Use AssertJ in spring-boot-autoconfigure
See gh-5083
2016-02-06 15:15:25 -08:00
Phillip Webb 516afcd2ca Polish 2016-02-06 15:02:12 -08:00
Phillip Webb ed01ae9ebf Use deterministic DataSource config import order
Update DataSourceAutoConfiguration so that pooled datasource
configurations are only loaded via an @Import. If left as nested
classes, the load order is JVM specific and can result in the wrong
configuration being loaded.

Closes gh-2183
2016-02-05 11:38:05 -08:00
Phillip Webb 3d0355434c Drop unneeded version tag from POM.xml 2016-02-05 11:37:08 -08:00
Phillip Webb a80ada64c3 Formatting 2016-02-03 12:16:53 -08:00
Vedran Pavic 1bc3eb8f0a Fix MariaDB driver class name
Closes gh-5075
2016-02-03 13:16:04 +01:00
Stephane Nicoll 34d87df425 Clarify use of the `spring.datasource` prefix
Previously, Spring Boot mapped both `DataSourceProperties` and the actual
`DataSource` implementation to the same prefix. This results in a huge
amount of keys in the `spring.datasource` namespace  with no way to
identify those that are valid for the pooled data source in use.

This commit maps the four pooled data sources we support in four isolated
namespace, keeping `spring.datasource` only for the common settings.

These are `spring.datasource.tomcat`, `spring.datasource.hikari`,
`spring.datasource.dbcp` and `spring.datasource.dbcp2` for the Tomcat,
Hikari, Commons DBCP and Commons DBCP2 implementations respectively.

Closes gh-2183
2016-02-03 11:05:23 +01:00
Phillip Webb 26dfbeb8f4 Share MetadataReaderFactory
Add SharedMetadataReaderFactoryContextInitializer to ensure that a
shared caching MetadataReaderFactory is used between configuration
classes and auto-configure sorting.

Fixes gh-4993
2016-01-29 21:42:18 -08:00
Phillip Webb f276ff4bd0 Polish 2016-01-27 16:02:36 -08:00
Stephane Nicoll b02073b455 Polish 2016-01-27 17:12:09 +01:00
Stephane Nicoll 217f825d3d Clarify DataSourceAutoConfiguration
The `DataSource` auto-configuration in Spring Boot supports two modes:
regular pooled DataSource and embedded database (via the
`EmbeddedDatabase` infrastructure provided by `spring-jdbc`. These were
previously named `NonEmbedded` and `Embedded` respectively.

This commit clarifies those mode and in particular that a pooled
`DataSource` can also handle an embedded database.

Closes gh-4634
2016-01-27 17:11:48 +01:00
Stephane Nicoll 762097ef29 Refactor logic from DataSourceProperties
Introduce dedicate method to determine the actual value to use based on
the configuration and the environment.

Closes gh-1436
2016-01-26 16:24:24 +01:00
Stephane Nicoll 3562026e9a Polish contribution
Closes gh-4574
2016-01-26 15:18:32 +01:00
Patrick Bray 3bf6c2fe1f Support for SendGrid ApiKey
See gh-4574
2016-01-26 15:01:19 +01:00
Stephane Nicoll 58751a43c1 Polish contribution
Closes gh-4590
2016-01-26 14:59:38 +01:00
Eddú Meléndez c68ffa5ba0 Add Thymeleaf's Java8TimeDialect
Closes gh-4576
2016-01-26 14:43:10 +01:00
Stephane Nicoll 854a67588e Remove reference to spring.view.*
Closes gh-3278
2016-01-26 08:19:22 +01:00
Stephane Nicoll 8e3d63ab6a Polish contribution
Closes gh-4632
2016-01-25 16:24:20 +01:00
Huang YunKun d796845664 Remove deprecated use of spring.mvc.*
Closes gh-4086
2016-01-25 16:01:05 +01:00
Stephane Nicoll cafe1dc4c6 Polish contribution
Fix additional use of \n

Closes gh-4707
2016-01-25 15:43:04 +01:00
mnhock e0ec607735 Use a platform-specific line separator
See gh-4707
2016-01-25 14:37:38 +01:00
Stephane Nicoll 4ff5afc636 Polish contribution
Removing all deprecated code

Closes gh-4905
Closes gh-4917
2016-01-25 14:06:20 +01:00
Eddú Meléndez 7b9cd20e98 Remove deprecated code
See gh-4905
2016-01-25 14:05:53 +01:00
Phillip Webb fbaf209240 Move master to 1.4.0.BUILD-SNAPSHOT 2016-01-24 10:45:24 -08:00
Johnny Lim 9a31e02806 Polish
Closes gh-5013
2016-01-24 19:13:01 +01:00
Spring Buildmaster 504d3e97ba Next development version 2016-01-21 18:41:30 -08:00
Phillip Webb e520c47c4f Refine `messages.properties` detection
Update `ResourceBundleCondition` to only enable the messages source
if `messages.properties` (and not `messages*.properties`) exists. This
operation is much faster that performing a pattern match since a full
jar entry scan is not required.

Since adding `messages.properties` is good practice and this change
allows us to delete the custom `PathMatchingResourcePatternResolver`
it seems like a fine compromise to make.

Fixes gh-4930
See gh-4811
2016-01-21 15:13:33 -08:00
Phillip Webb cf93f84e87 Polish 2016-01-21 14:15:49 -08:00
Phillip Webb 93c3b22bb4 Merge branch '1.2.x' 2016-01-21 11:14:20 -08:00
Phillip Webb c71aa32fbb Polish 2016-01-21 10:53:25 -08:00
Phillip Webb af36bf6864 Remove TODO in FlywayAutoConfiguration
Now tracked by gh-4995
2016-01-21 10:42:33 -08:00
Stephane Nicoll 44f508208a Merge branch '1.2.x' 2016-01-21 14:16:24 +01:00
Stephane Nicoll 58ebfdcbd3 Polish contribution
Closes gh-4973
2016-01-21 14:10:35 +01:00
Jacques-Etienne Beaudet a749855cb5 Allow indexed access of `flyway.locations`
This commit allows to use the `flyway.locations` in an indexed fashion
(i.e. typically in YAML configuration).

See gh-4973
2016-01-21 14:08:39 +01:00
Andy Wilkinson e33221aae1 Configure existing Jersey servlet registration created by the SCI
When a Jersey app is deployed to a standalone container, Jersey’s
ServletContainerInitializer will run and register a servlet for a class
annotated with @ApplicationPath. If Jersey’s ServletContainerInitializer
runs before Spring’s, this servlet will take precedence over the
servlet registered by JerseyAutoConfiguration and will therefore not be
configured with any init parameters specified using spring.jersey.init

For the case where Jersey’s SCI runs first, this commit updates
JerseyAutoConfiguration to examine the servlet context for an existing
registration of Jersey’s servlet (Jersey names the registration using
the fully-qualified name of the ResourceConfig subclass). If a
registration is found its init parameters are configured using the
configuration provided by spring.jersey.init.

For the case where Spring’s SCI runs first, this commit updates
JerseyAutoConfiguration so that it names its registration using the
fully-qualified name of the ResourceConfig sub-class. This allows
Jersey’s SCI to find the existing registration rather than attempting
to configure its own.

Closes gh-2471
2016-01-21 11:48:31 +00:00
Stephane Nicoll 9f728b3d59 Fix wrong import 2016-01-21 10:37:40 +01:00
Stephane Nicoll ea8e0cfc48 Support for simple numeric Flyway version
While Flyway's `MigrationVersion` is a String value, a simple "0" is
also a valid number. When such value is not wrapped in YAML, an integer
is injected rather than a String which leads to a failure as we can't
convert it.

This commit updates the `StringToMigrationVersionConverter` to also
supports conversion from a Number. This is a convenience for users
using YAML for configuration

Closes gh-4981
2016-01-21 10:26:12 +01:00
Andy Wilkinson 6f8d4c77e6 Handle multiple ContextRefreshedEvents in BackgroundPreinitializer
The same initializer will receive multiple ContextRefreshedEvents
when their is an application context hierarchy. This commit updates
the initializer to correctly handle multiple ContextRefreshedEvents
and only act upon the first that it receives.

See gh-4871
2016-01-20 22:23:57 +00:00
Andy Wilkinson 992e90f43d Ensure that background preinit has completed before refresh returns
This commit is a continuation of the changes made in b85b608. It
addresses an additional problem when testing applications where two
contexts are refreshed in quick succession. In this scenario, it
was possible, theoretically at least, for the first context’s background preinitialization to still be in progress and creating loggers when the
second is refreshed and resets the logger context.

This commit updates BackgroundPreinitializer so that, upon receipt of
a ContextRefreshedEvent, it waits for preinitialization to have
completed. In the scenario described above, this ensures that
preinitialization has completed before the call to refresh() for the
first context returns, thereby preventing it from running in parallel
with the refresh of the second context.

Closes gh-4871
2016-01-20 21:56:54 +00:00
Stephane Nicoll 179467bdd9 Make HazelcastJpaDependencyAutoConfiguration public
If Both Hazelcast and Hibernate are available, Spring Boot takes the
opinion that Hazelcast can be used for 2nd level caching and therefore
need to start before Hibernate.

Unfortunately, some users require Hibernate in some of their hazelcast
use case so the link is actually reversed. One way for such user is to
disable the auto-configuration that deals with this link. This class is
now public so that users can locate them and exclude them if necessary.

Closes gh-4960
2016-01-20 18:40:45 +01:00
Andy Wilkinson b85b60828c Perform background preinitialization after logging system setup
Previously, BackgroundPreinitializer would kick off preinitialization
on a separate thread in response to an ApplicationStartedEvent. This
work would then race with the logging system being set up in response
to an ApplicationEnvironmentPreparedEvent. When Logback’s being used
this race is problematic. As part of Logback’s setup,
LoggerContext.stop() is called. This calls LoggerContext.reset() which
can fail with a ConcurrentModificationException if another thread tries
to create a Logger at the same time. This is a known bug in Logback [1].

This commit updates BackgroundPreinitializer to respond to
an ApplicationEnvironmentPreparedEvent and to order itself so that it’s
called after LoggingApplicationListener has responded to the same event
by initializing the logging system.

Closes gh-4871

[1] http://jira.qos.ch/browse/LOGBACK-397
2016-01-20 11:49:57 +00:00
Andy Wilkinson 112b707b67 Ensure that MongoClient is not created with a null credentials list
Mongo’s 2.x driver allowed the credentials list to be null, however
the 3.x driver requires an empty list instead. The behaviour of the 2.x
driver is the same whether the client is created with a null credential
list or an empty credential list.

This commit aligns with the requirements of the 3.x driver by ensuring
that we never pass in a null credential list when creating the client.

Closes gh-4076
2016-01-18 16:06:38 +00:00
Stephane Nicoll 7d975ecd2e Polish 2016-01-18 10:53:04 +01:00
Stephane Nicoll af5d765a08 Enable resource chain if webjars locator is present
Webjars locator is a good hint that the resource chain should be
enabled. The sole presence of the library now enables the resource chain
unless the configuration states otherwise.

Closes gh-4403
2016-01-18 10:35:26 +01:00
mnhock 8f1f8dd680 Use entrySet() rather than using keySet() and then calling get(key)
Closes gh-4813
2016-01-15 17:01:58 +00:00
Andy Wilkinson 1107079683 Merge branch '1.2.x' 2016-01-15 11:20:01 +00:00
Andy Wilkinson b56eef236e Close Reader used by MustacheViewResolver when compiling a Template
Previously, MustacheViewResolver would create an InputStreamReader
that wraps the template Resource's InputStream but would fail to close
the Reader. When the InputStream was a FileInputStream, this caused
the resolver to leak file handles.

This commit updates the resolver to close the Reader once the Template
has been compiled, thereby allowing any underlying resources to be
cleaned up immediately, rather than having to wait for the JVM to exit.

Closes gh-4921
2016-01-15 11:19:24 +00:00
Andy Wilkinson 24fd503743 Merge branch '1.2.x' 2016-01-14 15:57:13 +00:00
Andy Wilkinson b99739212a Correct the name of MySQL's XADataSource implementation
Closes gh-4942
2016-01-14 15:53:00 +00:00
Andy Wilkinson 27a81e1463 Complete static final logger changes that were started in ec2f33f9
This commit completes the changes to consistently used static final
fields for Log instances that were started in ec2f33f9. Specifically it:

 - Removes this. when accessing logger fields that are now static
 - Renames some fields from log to logger
 - Makes some logger fields static

See gh-4784
2016-01-13 16:22:35 +00:00
Andy Wilkinson 150a6f0f5c Switch off Security Filter auto-config when spring-security-config is absent
SecurityFilterAutoConfiguration uses SecurityProperties which uses
SessionCreationPolicy from spring-security-config. This commit makes
SecurityFilterAutoConfiguration conditional on SessionCreationPolicy,
thereby preventing a startup failure if spring-security-web is on the
classpath but spring-security-config is not.

Closes gh-4919
2016-01-13 15:01:31 +00:00
Phillip Webb d2fed8bb07 Polish 2016-01-13 11:58:42 +00:00
Stephane Nicoll 72754c27b2 Allow to override BasicBatchConfigurer
Issue #4533 was supposed to make BasicBatchConfigurer public again but
unfortunately only the class visibility was changed. This commit makes
sure it can be overridden.

Closes gh-4888
2016-01-05 17:53:42 +00:00
Stephane Nicoll b1c2226e23 Merge branch '1.2.x'
# Conflicts:
#	spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/websocket/WebSocketAutoConfiguration.java
2015-12-28 13:51:18 +01:00
Stephane Nicoll 12cefd2c2b Only enable Tomcat's websocket support on Java7+
Tomcat's websocket support requires Java7 or later. That commit makes
sure to register its support only when such requirement is met.

Closes gh-4846
2015-12-28 13:49:12 +01:00
Spring Buildmaster 8db59059a5 Next Development Version 2015-12-18 05:43:02 -08:00
Stephane Nicoll bb736e255b Fix SNAPSHOT version 2015-12-17 14:15:14 +01:00
Phillip Webb 945b42588b Refine server.server-header documentation
Fixes gh-4461
2015-12-16 21:11:49 +00:00
Kirill Vlasov ec2f33f986 Make loggers private static final
Apply consistency across all static loggers.

Closes gh-4784
2015-12-16 21:02:53 +00:00
Kirill Vlasov 786aacf2e9 Use Collections.isEmpty() instead of .size() == 0
Ensure that Collections.isEmpty() is used to check if there are no
elements in a collections. This is more explicit and can be faster than
calling .size().

Closes gh-4783
2015-12-16 20:59:33 +00:00
Andy Wilkinson 3352e60631 Remove use of diamond operator in tests so that they’re Java 6 compatible
See gh-4163
2015-12-16 11:40:17 +00:00
Andy Wilkinson 037a27e257 Add a workaround for DATACMNS-776
Spring Data’s web support includes a handler method argument resolver,
ProxyingHandlerMethodArgumentResolver, that inaccurately claims that it
can handle all interface handler method arguments. This causes problems
for handler methods that take Spring Mobile’s Device as an argument as
the proxied Device instance does not behave correctly.

This commit works around the problem by assigning an order to the 
WebMvcConfigurerAdapter that registers Spring Mobile’s argument resolver
with Spring MVC. This ordering ensures that Spring Mobile’s resolver
takes precedence over Spring Data’s for Device arguments.

Closes gh-4163
2015-12-16 11:13:34 +00:00
Jacob Swanson ae565b805a Fix mail connection test exception message
Closes gh-4780
2015-12-16 10:25:47 +00:00
Artur Konczak 786f025818 Auto-configure Elasticsearch converter and context
Extend ElasticsearchDataAutoConfiguration to also configure an
ElasticsearchConverter and SimpleElasticsearchMappingContext both
of which are required for Spring Data REST.

Closes gh-3847
2015-12-15 20:03:41 +00:00
Andy Wilkinson bcaee0ebee Perform initialization in foreground if BackgroundPreinitializer fails
Google App Engine probits the creation of new threads. This leads to a
failure in BackgroundPreinitializer when the single thread executor
attempts to create its single thread.

This commit enhances the existing fail safety of
BackgroundPreinitializer by catching any exceptions thrown while
creating the executor and submitting the tasks to it. Any initialisation
that has not performed in the background will be performed in the
foreground instead.

Closes gh-4662
2015-12-15 14:59:24 +00:00
Phillip Webb 543a746de7 Fix checkstyle issues
See gh-4763
2015-12-14 19:07:48 +00:00
Phillip Webb 5719fab142 Merge branch '1.2.x' 2015-12-14 18:58:25 +00:00
Phillip Webb edb16a13ee Protect against SpEL injections
Prevent potential SpEL injection attacks by ensuring that whitelabel
error view SpEL placeholders are not recursively resolved.

Fixes gh-4763
2015-12-14 18:49:59 +00:00
Andy Wilkinson 5cb9b9a9e9 Merge branch '1.2.x' 2015-12-14 16:49:55 +00:00
Andy Wilkinson 7d5cc3da63 Stop ActiveMQ pooled connection factory when context is closed
Previously, ActiveMQ's pooled connection factory was not closed as
part of the application context being closed. This would leave
non-daemon threads running which could cause shutdown to hang unless
the JVM itself was shutting down (in which case a shutdown hook would
stop the pool).

This commit configures each pooled connection factory bean with a
custom destroy method so that the pool is stopped as part of the
application context being closed. To allow the destroy method to only
be declared when the connection factory is pooled, the bean method
has been split into two; one for pooled and one for non-pooled. This
is a partial backport of the changes made in bedf2edf.

Closes gh-4748
2015-12-14 16:49:18 +00:00