Commit Graph

2713 Commits

Author SHA1 Message Date
Phillip Webb ddcb5ee328 Polish 2017-04-04 09:36:27 -07:00
Andy Wilkinson 09898308ab Update autoconfigure's test deps to align with latest spring-kafka-test 2017-04-04 15:32:57 +01:00
Stephane Nicoll 78845fe63a Switch default value of spring.aop.proxy-target-class
This commit ensures that the default proxying value matches the opinion we
have applied for `@EnableTransactionManagement`

Closes gh-8786
2017-04-04 17:27:00 +03:00
Andy Wilkinson 6c6b9c284d Upgrade to Solr 6.5 and align with latest Spring Data Solr snapshots
Closes gh-8801
2017-04-04 14:47:07 +01:00
Andy Wilkinson 7f870aa19a Merge branch '1.5.x' 2017-04-04 10:23:04 +01:00
Andy Wilkinson 94e9c9417d Merge branch '1.4.x' into 1.5.x 2017-04-04 10:22:50 +01:00
Andy Wilkinson b280e3092d Don't forward to welcome page that won't exist due to custom mapping
Previously, WelcomePageHandlerMapping would forward to index.html.
This assumed that the static path pattern was always /**. If it had
been customised to, for example, /foo/**, then the forward would still
be to index.html and a 404 would result as the page is actually
available at /foo/index.html.

At first glance, it would appear that the forward should be made to
foo/index.html. However, as it's a forward rather than a redirect,
any relative URLs in the index.html page would then be resolved using
/ whereas they should be resolved using /foo/. This could be addressed
by using a redirect rather than a forward, but we don't want to do
that as it's more invasive and would require a roundtrip back to the
client. Instead, this commit simply stops performing the forward when
the static path pattern is not /**.

Closes gh-8788
2017-04-04 10:13:24 +01:00
Stephane Nicoll 3915f37dae Merge branch '1.5.x' 2017-04-03 10:42:41 +03:00
Stephane Nicoll 5cc2e103f2 Disable unexpected datasource initialization
This commit restore the disabling of datasource initialization that was
accidently removed in db33a75 so that other tests aren't affected by it.
2017-04-03 10:42:12 +03:00
Stephane Nicoll 4c32d6a7de Merge branch '1.5.x' 2017-04-03 09:50:36 +03:00
Stephane Nicoll 0163731043 Automatically enable transaction management for Neo4j
This commit makes sure that `@EnableTransactionManagement` is
auto-configured with Neo4j. It actually reuses what was done in #8434,
making sure that the `Neo4jDataAutoConfiguration` is ordered properly.

Closes gh-8587
2017-04-03 09:37:37 +03:00
Stephane Nicoll db33a75484 Enable transaction management consistently
Previously to this commit, transaction management was only enabled when
a `DataSource` is configured. The processing of `@Transactional`
annotations are now enabled as long as a `PlatformTransactionManager` is
present.

Also, the `spring.aop.proxy-target-class` is now honoured if set, still
defaulting to CGLIB mode.

Closes gh-8434
2017-04-03 09:24:15 +03:00
Andy Wilkinson f52b0b975a Update WebFlux auto-configuration following recent API changes 2017-03-31 11:27:09 +01:00
Brian Clozel df2d6b370e Fix compilation error with latest webflux changes
See commit c5bcefbd in Spring Framework, which refactored
the RequestMappingHandlerAdapter.
2017-03-29 09:56:04 +02:00
Andy Wilkinson aaf76e435e Align with latest Neo4j OGM 3.0 snapshots
See gh-8687
2017-03-28 10:09:36 +01:00
Johnny Lim 287520a810 Polish
Closes gh-8698
2017-03-28 10:06:00 +02:00
Andy Wilkinson d322d8613b Upgrade to Flyway 4.1.2
Closes gh-8752
2017-03-25 20:41:43 +00:00
Madhura Bhave 0ab7c25d9f Revert "Change default for new_generator_mappings to true"
This reverts commit 735dbc4583.
2017-03-24 17:07:14 -07:00
Andy Wilkinson e0a80c287c Remove Tomcat 7.0 and 8.0-based WebSocket support
Closes gh-8615
2017-03-24 21:58:59 +00:00
Madhura Bhave 735dbc4583 Change default for new_generator_mappings to true
Closes gh-7612
2017-03-24 14:35:26 -07:00
Andy Wilkinson a9a31107cf Align with API changes in latest Spring Data Kay snapshots
See gh-7461
2017-03-24 11:26:27 +00:00
Andy Wilkinson 87ebec6838 Upgrade to Jackson 2.9.0.pr2
As part of the upgrade, this commit removes the use of any API that
has been deprecated in 2.9. This includes the config props endpoint's
use of SerializationFeature.WRITE_NULL_MAP_VALUES. This has been
replaced with configuring serialization inclusion to only include
properties with non-null values. This means that all null-valued
properties will no longer be serialized, not just those that are an
entry in a map.

Closes gh-8604
Closes gh-8537
Closes gh-7695
2017-03-23 15:22:20 +00:00
Andy Wilkinson 25bf4a14cd Start building against Neo4j OGM 3.0.0 snapshots
This commit our Neo4j OGM dependency with the Spring Data Neo4j
snapshots that are currently included in snapshots of Spring Data Kay.

It switches to using Neo4j's Bolt driver by default, aligning it with
the default of the latest Spring Data Neo4j 5 snapshots.

It also contains a workaround for a Neo4j OGM issue [1] and a change
to Neo4jDataAutoConfigurationTests that prevents the entire classpath
from being scanned.

See gh-8687

[1] https://github.com/neo4j/neo4j-ogm/issues/340
2017-03-22 15:24:49 +00:00
Phillip Webb 34de119eba Polish 2017-03-16 13:04:03 -07:00
Stephane Nicoll da7287322b Polish 2017-03-16 12:44:06 +01:00
Stephane Nicoll b7d3aad54b Merge branch '1.5.x' 2017-03-16 12:43:47 +01:00
Stephane Nicoll fa3679af71 Merge branch '1.4.x' into 1.5.x 2017-03-16 12:40:12 +01:00
Stephane Nicoll cd76da9a4c Avoid using immutable collections for configuration proprerties
Closes gh-8620
2017-03-16 12:39:48 +01:00
Andy Wilkinson 1893fdab0d Revert "Upgrade to Jackson 2.9.0.pr1"
This reverts commit 10ae5e8f3f. Health
serialization fails with Jackson 2.9.0 (gh-7695).

See gh-8537
2017-03-15 17:01:12 +00:00
Andy Wilkinson 10ae5e8f3f Upgrade to Jackson 2.9.0.pr1
As part of the upgrade, this commit removes the use of any API that
has been deprecated in 2.9.0.pr1. This includes the config props
endpoint's use of SerializationFeature.WRITE_NULL_MAP_VALUES. This
has been replaced with configuring serialization inclusion to only
include properties with non-null values. This means that all
null-valued properties will no longer be serialized, not just those
that are an entry in a map.

Closes gh-8604
Closes gh-8537
2017-03-15 16:38:08 +00:00
Stephane Nicoll 7ee5e43109 Merge branch '1.5.x' 2017-03-15 15:11:02 +01:00
Stephane Nicoll 22934e097d Merge branch '1.4.x' into 1.5.x 2017-03-15 15:10:37 +01:00
Vedran Pavic 17aad4f00c Improve `RedisSessionConfiguration` conditions
Closes gh-8582
2017-03-15 15:09:31 +01:00
Johnny Lim a3d15ed222 Polish
Closes gh-8621
2017-03-15 09:01:54 +01:00
Phillip Webb b76ca0bf8f Restructure web auto-configuration
Restructure `org.springframework.boot.autoconfigure.web` to better align
with the new package structure in `spring-boot`.

Auto-configuration is now split into client, servlet and reactive
sub-packages. In addition a new `http` package now handles common
HTTP concerns.

Fixes gh-8616
2017-03-14 22:06:28 -07:00
Phillip Webb 33e54ed723 Relocate `org.springframework.boot.web.support`
Move `org.springframework.boot.web.support` under the `servlet` package.

Fixes gh-8557
2017-03-14 22:03:03 -07:00
Phillip Webb 099e188f9f Unify WebServerFactoryCustomizers
Replace `ReactiveWebServerCustomizer` and `WebServerFactoryCustomizer`
with a unified `WebServerFactoryCustomizer`.

Fixes gh-8558
2017-03-14 21:43:23 -07:00
Phillip Webb 13db69bf41 Drop superfluous `@Order` annotation
Remove `@Order` which has no effect on `ImportBeanDefinitionRegistrar`.

Fixes gh-8603
2017-03-14 13:49:18 -07:00
Phillip Webb 4100360ceb Make ReactiveWebServerFactory functional interface
Update `ReactiveWebServerFactory` to contain only a single method.

Fixes gh-8559
2017-03-14 13:45:53 -07:00
Phillip Webb 69b72874ea Extract logging listeners
Separate logging ApplicationListeners classes to a different package
so that the root `logging` package is no longer aware of `context`
concerns.

Fixes gh-8611
2017-03-14 13:45:53 -07:00
Madhura Bhave 517b30acbb Merge branch '1.5.x' 2017-03-14 11:35:53 -07:00
Madhura Bhave 8deb72be80 Fix ResourceServerProperties validation
Only try and validate if clientId is present.

Fixes gh-8565
2017-03-14 11:03:21 -07:00
Phillip Webb 67556ba8ea Restructure embedded web server packages
Rework `org.springframework.boot.context.embedded` to relocate classes
to `org.springframework.boot.web`. Packages are now organized around
the following areas:

Packages for shared concerns, for example the `WebServer` interface
to start/stop a server and the common configuration elements:
- org.springframework.boot.web.context
- org.springframework.boot.web.server

Servlet specific packages:
- org.springframework.boot.web.servlet.server
- org.springframework.boot.web.servlet.context
- org.springframework.boot.web.servlet.filter

Reactive specific packages:
- org.springframework.boot.web.reactive.context
- org.springframework.boot.web.reactive.server

Embedded server implementations (both reactive and servlet):
- org.springframework.boot.web.embedded

In addition:

- Rename `EmbeddedServletContainerFactory` to `ServletWebServerFactory`
  to align with the `ReactiveWebServerFactory`.
- Rename `EmbeddedWebApplicationContext` to
  `ServletWebServerApplicationContext` and
- Rename `EmbeddedReactiveWebApplicationContext` to
  `ReactiveWebServerApplicationContext`.
- Add checkstyle rules to restrict imports.
- Fixup all affected code to use the correct imports and local names.

Fixes gh-8532
2017-03-12 21:08:25 -07:00
Phillip Webb b1f679b1c5 Fix HttpHandlerAutoConfiguration
Fix HttpHandlerAutoConfiguration following upstream Spring Framework
changes.
2017-03-10 20:16:05 -08:00
Stephane Nicoll 4f7e5efac8 Merge branch '1.5.x' 2017-03-10 16:29:31 +01:00
Stephane Nicoll 5d27c7e501 Handle non supported JOOQ dialect
This commit uses a fallback translator if the JOOQ Dialect in use is not
one we support.

Closes gh-8521
2017-03-10 16:27:44 +01:00
Stephane Nicoll 5ca197b5b6 Merge branch '1.5.x' 2017-03-10 10:39:00 +01:00
Stephane Nicoll f8bf05b91f Polish contribution
Closes gh-8474
2017-03-10 10:20:48 +01:00
srichard 0ddaca57fb Add Tomcat Access Log's fileDateFormat property
Closes gh-8396
2017-03-10 09:57:00 +01:00
Stephane Nicoll abef1ee4db Merge branch '1.5.x' 2017-03-10 09:37:21 +01:00
Stephane Nicoll feb1ab375f Merge branch '1.4.x' into 1.5.x 2017-03-10 09:36:55 +01:00
Eddú Meléndez 251090b1e5 Add missing spring-data-cassandra metadata
This commit adds the missing
`spring.data.cassandra.repositories.enabled` in the metadata and the
documentation.

Closes gh-8562
2017-03-10 09:34:19 +01:00
Stephane Nicoll 6624fe47c3 Merge branch '1.4.x' into 1.5.x 2017-03-09 18:33:28 +01:00
Stephane Nicoll e7922a574a Polish 2017-03-09 18:33:13 +01:00
Stephane Nicoll 68ef19b69b Merge branch '1.5.x' 2017-03-09 18:31:08 +01:00
Stephane Nicoll 207ab3ecb4 Merge branch '1.4.x' into 1.5.x 2017-03-09 18:21:40 +01:00
Stephane Nicoll 07c56c60ba Make sure Hazelcast bootstraps before any JCache setup
This commit makes sure that if a `javax.cache.CacheManager` is required,
an auto-configured `HazelcastInstance` is fully resolved first. This
prevents the case where the JCache bootstrap actually starts an instance
early, followed by a second (potentially unwanted) instance created by the
regular auto-configuration.

Since the JCache implementation works with an `HazelcastInstance` behind
the scenes, if there is one `HazelcastInstance` configured and it has a
name, then we configure the `CacheProvider` to use that. Future Hazelcast
version will allow to pass the instance directly (i.e. not requiring an
actual name).

Closes gh-8484
2017-03-09 17:59:20 +01:00
Johnny Lim 709ee23255 Polish
Closes gh-8526
2017-03-08 06:58:19 +01:00
Phillip Webb d8f827d224 Cleanup and format code 2017-03-06 17:08:09 -08:00
Phillip Webb 425dbc3e52 Update copyright header for edited files 2017-03-06 15:04:07 -08:00
Phillip Webb 2a592103f0 Polish formatting 2017-03-06 15:03:43 -08:00
Phillip Webb 91a7bf92e6 Merge branch '1.5.x' 2017-03-06 12:04:55 -08:00
Phillip Webb fedd7b9506 Polish 2017-03-06 12:01:05 -08:00
Phillip Webb a3d5101369 Merge branch '1.4.x' into 1.5.x 2017-03-06 11:48:52 -08:00
Phillip Webb f5aeac3658 Polish 2017-03-06 11:43:29 -08:00
Stephane Nicoll 546338ac80 Avoid early initializations for reactive support
This commit flags the `BeanPostProcessor` registered by the reactive
embedded support as `synthetic` so that it doesn't trigger an early
initialization of other components.

See gh-8467
2017-03-06 08:27:28 +01:00
Stephane Nicoll 36d6ab41a2 Merge branch '1.5.x' 2017-03-06 08:21:33 +01:00
Stephane Nicoll 28bba876fa Merge branch '1.4.x' into 1.5.x 2017-03-06 08:19:12 +01:00
Stephane Nicoll 9fb9a67c4b Avoid early initializations
This commit flags the two `BeanPostProcessors` registered by the
embedded support as `synthetic` so that they don't trigger an early
initialization of other components.

Closes gh-8467
2017-03-06 08:16:58 +01:00
Spring Buildmaster d23fa24340 Next Development Version 2017-03-03 16:18:26 +00:00
Spring Buildmaster 2a83e80a9b Next Development Version 2017-03-03 14:39:21 +00:00
Andy Wilkinson edc2facd7a Merge branch '1.5.x' 2017-03-03 14:02:19 +00:00
Andy Wilkinson 9e9f006720 Polish "Enable customization of RestTemplate that retrieves JwtAccessTokenConverter's key"
See gh-8268
See gh-5859
2017-03-03 13:55:40 +00:00
Eddú Meléndez dc9ff73805 Enable customization of RestTemplate that retrieves JwtAccessTokenConverter's key
Closes gh-8268
See gh-5859
2017-03-03 13:55:40 +00:00
Stephane Nicoll 2e1cda8743 Merge branch '1.5.x' 2017-03-03 11:45:37 +01:00
Stephane Nicoll d74af04724 Rename JSR 303 Validator bean name
Closes gh-8481
2017-03-03 11:45:26 +01:00
Stephane Nicoll 28a8e3db2f Remove spring.cache.hazelcast.config
Remove the creation of a separate `HazelcastInstance` specific to caching.
Instead, the general `HazelcastAutoConfiguration` is used and if a
`HazelcastInstance` bean is present we wrap it in a `CacheManager`.

Closes gh-8470
2017-03-03 11:18:06 +01:00
Stephane Nicoll d811b5fb1d Merge branch '1.5.x' 2017-03-03 10:31:26 +01:00
Stephane Nicoll bb8800a625 Deprecate spring.cache.hazelcast.config
The additional configuration for an `HazelcastInstance` will be removed
in 2.0. This commit makes sure that the property is deprecated in 1.5

See gh-8470
2017-03-03 10:30:06 +01:00
Vedran Pavic 1c789f1a8d Remove dependency management for `hibernate-entitymanager`
Closes gh-8433
2017-03-02 18:31:53 +01:00
Andy Wilkinson 5285a8db44 Merge branch '1.5.x' 2017-03-02 16:47:04 +00:00
Madhura Bhave 605b0aefc6 Simplify validation logic in ResourceServerProperties
Closes gh-8306
Closes gh-8317
2017-03-02 16:45:54 +00:00
Stephane Nicoll cb40ea485b Merge branch '1.5.x' 2017-03-02 14:31:49 +01:00
Stephane Nicoll 3e0e4e81b9 Polish 2017-03-02 14:31:31 +01:00
Stephane Nicoll 5cc569fc91 Improve execution speed of `CacheAutoConfigurationTests`
As of Hazelcast 3.7, the bootstrap is pretty slow by default due to the
networking discovery. This commit disables both TCP/IP and multicast
discoveries.
2017-03-02 14:28:33 +01:00
Stephane Nicoll 5278baca01 Polish 2017-03-02 12:18:09 +01:00
Stephane Nicoll ea18fe58e4 Remove useless checked exception throw clause 2017-03-02 12:16:28 +01:00
Stephane Nicoll ad9d912009 Merge branch '1.5.x' 2017-03-02 12:13:51 +01:00
Stephane Nicoll 0d61f92479 Ignore URI when local.mongo.port is set
This commit makes sure that if `local.mongo.port` is set, a `MongoClient`
on the embedded MongoDB instance is created. When an embedded instance
is detected, only the `host` property is used and the `uri` is ignored if
set.

This makes sure that the auto-configured `MongoClient` automatically
switches to the embedded server, even if a production uri has been
specified.

Closes gh-8219
2017-03-02 11:50:11 +01:00
Phillip Webb 58ac67eb27 Merge branch '1.5.x' 2017-03-02 00:09:56 -08:00
Phillip Webb 3ee7dae09b Merge branch '1.4.x' into 1.5.x 2017-03-01 23:44:40 -08:00
Phillip Webb f1012c104a Polish 2017-03-01 23:29:20 -08:00
Phillip Webb 987b6c956e Polish 2017-03-01 20:43:04 -08:00
Phillip Webb 57111aba22 Get published DataSource from EntityManager
Update DataSourceInitializedPublisher to always attempt to obtain the
published DataSource directly from the EntityManager. In the case where
the EntityManager doesn't provide a DataSource, the previous logic is
used.

Fixes gh-8296
2017-03-01 20:42:26 -08:00
Andy Wilkinson 205faa1950 Merge branch '1.5.x' 2017-03-01 15:08:12 +00:00
Andy Wilkinson 70472b36f1 Merge branch '1.4.x' into 1.5.x 2017-03-01 15:07:06 +00:00
Andy Wilkinson 59d3a79c82 Avoid eager initialization when finding beans by annotation
Closes gh-8269
2017-03-01 15:05:54 +00:00
Andy Wilkinson 373474f8f6 Merge branch '1.5.x' 2017-03-01 14:37:18 +00:00
Andy Wilkinson 4390c81115 Merge branch '1.4.x' into 1.5.x 2017-03-01 14:37:10 +00:00
Andy Wilkinson 8a326a8713 Simplify BeanTypeRegistry by requiring a DefaultListableBeanFactory
Closes gh-8439
2017-03-01 14:36:26 +00:00
Stephane Nicoll cf64d9fd35 Reuse auto-configured `Validator` in WebFlux
This commit makes sure that if a `Validator` is auto-configured, it is
reused as the `webFluxValidator`. This is pretty much the same thing as
what was done recently for Spring MVC.

Since the infrastructure is now shared, the package protected class has
been published in the `.validation` package.

Closes gh-8400
2017-02-28 15:49:21 +01:00
Stephane Nicoll deaa6089b0 Move `HttpHandler` configuration to a dedicated auto-configuration
An `HttpHandler` bean must be provided once the infrastructure triggered
by `@EnableWebFlux` has been processed. Rather than creating a
`HttpHandler` in that auto-configuration, this commit moves it to a
dedicated auto-config, like we do for `DispatcherServlet` for
servlet-based webapps.

As this is the only bean we auto-configure in a functional fashion, the
`WebFluxFunctionalAutoConfiguration` is now merged with this new
auto-configuration, making its purposes clearer.

Cloess gh-8436
2017-02-28 15:18:23 +01:00
Phillip Webb a4bcd20b64 Merge branch '1.5.x' 2017-02-27 20:43:18 -08:00
Phillip Webb ca1540cefe Update header copyright for changed files 2017-02-27 20:41:18 -08:00
Phillip Webb 77f6ed8357 Further rework Spring MVC JSR-303 validation
Rework Spring MVC JSR-303 validation support a little more to move
most of the creation logic to the wrapper class. Also rename
`SpringValidatorAdapterWrapper` -> `WebMvcValidator`.

See gh-8223
2017-02-27 20:41:18 -08:00
Phillip Webb 7ed1a26c2d Fix test failures when running in Eclipse
Update MultipartAutoConfigurationTests to reset the Tomcat URL factory.
2017-02-27 20:41:18 -08:00
Phillip Webb 5867cd6175 Polish 2017-02-27 20:41:18 -08:00
Phillip Webb 47b00c086c Polish 2017-02-27 13:56:17 -08:00
Stephane Nicoll d1d70b0207 Merge branch '1.5.x' 2017-02-27 19:10:03 +01:00
Stephane Nicoll 0435f122d4 Rework JSR-303 validation exposure with Spring MVC
This commit improves the initial solution by actually overriding the
`mvcValidator` `@Bean`. This gives us more control as whether a custom
validator has been specified or not. We now wrap it regardless of it
being custom or provided by auto-configuration.

Closes gh-8223
2017-02-27 19:09:29 +01:00
Stephane Nicoll c333ccfe20 Merge branch '1.5.x' 2017-02-27 16:16:21 +01:00
Stephane Nicoll d8f62c46ad Prevent warning due to BPP dependency
`MethodValidationPostProcessor` requires a `Validator` so we need to flag
it as an infrastructure bean to prevent an additional log that indicates
it won't be post-processed.

We obviously don't want to post-process the `Validator` here so adding the
additional meta-data is a good idea anyway.

Closes gh-8422
2017-02-27 16:16:09 +01:00
Stephane Nicoll c5595f296c Add support for Mock test with WebFlux
This commit add mock support for WebFlux with an infrastructure similar
to what `WebMvcTest` provides. `@WebFluxTest` can be used to test
controllers with a narrowed classpath that is relevant to WebFlux. Also,
`@SpringBootTest` now starts WebFlux in "mock" mode by default and
`@AutoConfigureWebTestClient` can be used to inject a `WebTestClient`
connected to the `ApplicationContext`.

To make that happen, a `ReactiveWebApplicationContext` interface has been
introduced to mirror what `WebApplicationContext` currently does. Things
are still a bit volatile at this point and that infra may move to Spring
Framework at some point.

Closes gh-8401
2017-02-27 15:05:34 +01:00
Brian Clozel 3a8be10be8 Enable Tomcat, Jetty and Undertow reactive auto-conf
Closes gh-8403
2017-02-24 17:46:04 +01:00
Stephane Nicoll f1d4d8434b Hide javax.servlet.SessionTrackingMode
The server's session can now be configured in both a servlet and a
reactive environment. The latter has not requirement on the servlet API
and this commit removes the requirement to the `SessionTrackingMode`
enum.

Closes gh-8402
2017-02-24 17:41:39 +01:00
Brian Clozel 8317977e1b Add WebFlux auto-configuration
This commit creates auto-configuration classes for both the
annotation and functional variants of the WebFlux framework.

They provide the basic support to get started with those, by
creating the required `HttpHandler` using the provided application
context (for annotation) or `RouterFunction`s (for functional).

They do support `WebFilter` registration and a few advanced
features such as resource handling, `messageReaders|Writers`
and `ViewResolver` auto-registration.

Closes gh-8386
2017-02-24 13:03:11 +01:00
Brian Clozel 656b509f03 Add support for reactive web servers auto-configuration
This commit adds the auto-configuration for creating reactive
`EmbeddedWebServer` instances. This adds support for the
following servers: Reactor Netty, Tomcat, Jetty and Undertow.

Fixes gh-8302
Fixes gh-8117
2017-02-24 13:03:11 +01:00
Brian Clozel 0b162e894b Manage EmbeddedWebServer in ReactiveWebApplicationContext
This commit adds an `EmbeddedWebServer` instance to the
`ReactiveWebApplicationContext` and ties it to the application
lifecycle.

To launch a reactive web application, two elements are required
from the context:

* a `ReactiveWebServerFactory` to create a server instance
* a `HttpHandler` instance to handle HTTP requests

Closes gh-8337
2017-02-24 13:03:11 +01:00
Brian Clozel f331ac133f Add reactive web server infrastructure
This commit adds the infrastructure for creating and customizing
reactive embedded web servers. Common configuration has been refactored
into the new `ConfigurableEmbeddedWebServer` interface.

See gh-8302
2017-02-24 13:03:11 +01:00
Stephane Nicoll a38d2456c3 Merge branch '1.5.x' 2017-02-24 11:05:27 +01:00
Stephane Nicoll 4aa99b9531 Avoid exposing several javax.validaton.Validator beans
This commit makes sure that the Spring `Validator` used by the MVC
layer doesn't expose a JSR-303 contract, if any.

The default implementation of the `mvcValidator` is
`LocalValidatorFactoryBean`. While this object is exposed as a Spring
`Validator` only, its runtime capabilities expose that contract as well
as the standard `Validator` and `ValidatorFactory` ones.

Concretely, if an auto-configuration is checking if a
`javax.validation.Validator` bean is missing, the condition will match
since we only know about "advertized types": beans haven't been created
yet so we can't inspect their runtime capabilities. Since the condition
match, we will auto-configure a bean. At runtime though, we're no longer
ale to inject a `javax.validation.Validator` by type since two candidates
are available.

This commit introduces `SpringValidatorAdapterWrapper`, a wrapper class
on any `SpringValidatorAdapter` (`LocalValidatorFactoryBean` being one of
the available implementations) that only exposes the Spring contract.

Also, if a `javax.validation.Validator` bean is available, we will use it
for the MVC layer, rather than creating a new one.

Closes gh-8223
2017-02-24 11:01:42 +01:00
Andy Wilkinson 4ff159adbe Merge branch '1.5.x' 2017-02-22 12:19:14 +00:00
Andy Wilkinson b034a505a5 Polish 0f42c5dd
- Apply standard code formatting
- Add class javadoc to MultipleResourceServerConfigurationTests
- Add missing @Override annotations
- Remove unused ExpectedException field
- Remove use of SpringApplicationBuilder from the tests
- Use @ImportAutoConfiguration to import auto-configuration
- Add assertions to verify that the orders haven't been changed
- Remove unnecessary mocking of EmbeddedServletContainerFactory

See gh-8347
2017-02-22 12:16:05 +00:00
Dave Syer c544aff72f Merge remote-tracking branch 'origin/1.5.x' 2017-02-22 11:32:20 +00:00
Dave Syer 0f42c5dd94 Check there is only one ResourceServerConfiguration before modifying
Fixes gh-8347
2017-02-22 11:30:17 +00:00
Madhura Bhave b8a38d60b7 Merge branch '1.5.x' 2017-02-21 12:14:23 -08:00
Madhura Bhave 67810abd9e Match ResourceServerCondition if JWK config present
Closes gh-8350
2017-02-21 12:02:49 -08:00
Stephane Nicoll 91009cfc01 Merge branch '1.5.x' 2017-02-20 14:04:55 +01:00
Stephane Nicoll 43a534f4ca Polish contribution
Closes gh-8195
2017-02-20 14:03:07 +01:00
Mathieu Ouellet fa8f0a6136 Add schema validation options for embedded LDAP
See gh-8195
2017-02-20 12:07:53 +01:00
Stephane Nicoll 4304cdb91a Merge branch '1.5.x' 2017-02-16 10:08:02 +01:00
Stephane Nicoll f57ddff478 Remove dead code
Closes gh-8305
2017-02-16 10:04:57 +01:00
Madhura Bhave b4134e239e Add autoconfiguration for JWKTokenStore
If `jwk.key-set-uri` is present.

Closes gh-4437
2017-02-15 12:05:29 -08:00
Andy Wilkinson 04a87ee4c1 Merge branch '1.5.x' 2017-02-15 17:25:18 +00:00
Andy Wilkinson 01729cc1d2 Merge branch '1.4.x' into 1.5.x 2017-02-15 17:25:07 +00:00
Andy Wilkinson 9e1238e286 Consider resource loader path when checking Groovy template availability
Closes gh-8304
2017-02-15 17:24:57 +00:00
Andy Wilkinson 57fe8b966e Use Spring Session's defaults for its filter's dispatcher types
Closes gh-8288
2017-02-15 12:24:01 +00:00
Andy Wilkinson fe6320db42 Align Security filter dispatcher types with Spring Security's defaults
Closes gh-8289
2017-02-14 17:02:36 +00:00
Stephane Nicoll ce6372c46f Add support of reactive repositories with `@DataMongoTest`
Closes gh-8280
2017-02-14 11:21:51 +01:00
Stephane Nicoll 50553137d3 Merge branch '1.5.x' 2017-02-14 10:32:48 +01:00
Stephane Nicoll a0ef61a27d Enable proxy target class for `MethodValidationPostProcessor`
Closes gh-8277
2017-02-14 10:32:26 +01:00
Andy Wilkinson f9015be619 Merge branch '1.5.x' 2017-02-13 12:37:15 +00:00
Andy Wilkinson e0b355d313 Avoid ClassNotFoundException caused by areturn verification
The verifier's type checker is required to check that a type returned
from a method (an areturn instruction) is assignable to the method's
declared return type. When the return type is an interface, the JLS
states that it should be treated as java.lang.Object. This means that
no analysis of the type being returned is required and verification
passes. When the return type is a class, the type being returned must
be analyzed to ensure that it is compatible. This analysis causes the
return type to be loaded during verification.

Prior to this commit, BasicBatchConfigurer's
createAppropriateTransactionManager method had a return type of
AbstractPlatformTransactionManager and a branch that could return
a JpaTransactionManager. This caused the verifier to attempt to load
JpaTransactionManager so that it could check that it was assignable
to AbstractPlatformTransactionManager. This would fail when
spring-orm is not on the classpath as JpaTransactionManager could not
be loaded.

This commit updates BasicBatchConfigurer to change the return type
of createAppropriateTransactionManager so that it returns a
PlatformTransactionManager which is an interface. As described above,
this relaxes the verification of any areturn instructions in the
method and, in this particular case stops the verifier from trying to
load JpaTransactionManager.

Closes gh-8181
2017-02-13 12:36:17 +00:00
Stephane Nicoll b30d4303d5 Polish contribution
Closes gh-8230
2017-02-09 15:54:59 +01:00
Mark Paluch 48b0f1577b Provide a starter for reactive Spring Data MongoDB
Add autoconfiguration to bootstrap MongoDB Reactive Streams driver
components, reactive Spring Data MongoDB and reactive repositories. Add
bean dependency processor for flapdoodle so embedded MongoDB instances
are configured before bootstraping the reactive MongoDB client.

Add Spring Data MongoDB Reactive starter with blocking and non-blocking
dependencies. MongoDB requires a separate driver that is used in the
`ReactiveMongoTemplate` while `MappingMongoConverter` (shared amongst
blocking/reactive Template API) requires the blocking driver to resolve
DBRefs.

See gh-8230
2017-02-09 15:54:59 +01:00
Andy Wilkinson 16b7bf7f73 Merge branch '1.5.x' 2017-02-09 13:50:23 +00:00
Andy Wilkinson 601c6aa305 Tidy up code formatting and address some compiler warnings 2017-02-09 13:48:55 +00:00
Andy Wilkinson df08863641 Make ServletRegistrationBean and FilterRegistration bean generic
Closes gh-7666
2017-02-09 13:36:35 +00:00
Stephane Nicoll 064faf9560 Merge branch '1.5.x' 2017-02-09 10:43:20 +01:00
Stephane Nicoll aa49468171 Allow to define a custom MessageRecoverer
This commit improves `SimpleRabbitListenerContainerFactoryConfigurer` to
use a custom `MessageConverter`. If such a bean is present, it is used
for the default factory that is auto-configured.

Closes gh-8194
2017-02-09 10:43:03 +01:00