Commit Graph

857 Commits

Author SHA1 Message Date
Phillip Webb
9c66624deb Polish 2014-12-08 23:12:45 -08:00
Phillip Webb
2f03351cf6 Fix auto-configuration order for Spring Data Rest
Update Rest, Hypermedia and HttpMessageConverter auto-configuration to
ensure beans are created in the correct order.

Prior to this commit the MappingJackson2HttpMessageConverter bean would
not be created because Spring Data Rest's TypeConstrained versions had
already been registered.

Fixes gh-1729
2014-12-08 21:45:35 -08:00
Sebastien Deleuze
27d9d7fd55 Add support for autowired Jackson handlers
Inject the ApplicationContext into Jackson2ObjectMapperBuilder to allow
Jackson handlers to be autowired. See SPR-10768.

Fixes gh-2081
2014-12-08 14:25:25 -08:00
Phillip Webb
7ae75c2707 Merge branch '1.1.x' 2014-12-08 09:26:49 -08:00
Phillip Webb
fcad7c4fde Guard for null BeanFactory in @ConditionalOnBean
See gh-2080
2014-12-08 09:25:12 -08:00
Phillip Webb
1f66277fd6 Fix JmsProperties bean not found exception
Update JndiConnectionFactoryAutoConfiguration to ensure that the
JmsProperties bean is created. Prior to this commit deployment to
a WildFly would fail with a NoSuchBeanDefinitionException.

Fixes gh-2072
2014-12-05 22:46:35 -08:00
Phillip Webb
778aa39016 Add Undertow WebSocket auto-configuration
Fixes gh-2028
2014-12-03 15:35:19 -08:00
Phillip Webb
211f20b9c6 Add setIgnoreDefaultModelOnRedirect support
Add a `spring.mvc.set-ignore-default-model-on-redirect` property to
allow RequestMappingHandlerAdapter.setIgnoreDefaultModelOnRedirect to
be easily customized and change the default value to 'true'.

Fixes gh-2018
2014-12-03 11:31:09 -08:00
Phillip Webb
447c9ff204 Polish 2014-12-02 15:19:51 -08:00
Maciej Walkowiak
c74e56d185 Apply pubSubDomain property to ContainerFactory
Previously, tuning the pubSubDomain flag only impacted the created
JmsTemplate leaving any default listeners with the default settings.

If no default JmsListenerContainerFactory is defined, the created
one is using that property as well now.
2014-12-02 15:04:00 +01:00
Andy Wilkinson
f9b5c6b1ae Merge branch '1.1.x' 2014-12-02 11:22:57 +00:00
Andy Wilkinson
3b78aa9493 Make Security auto-config conditional on spring-security-config
SecurityAutoConfiguration, via its import of
AuthenticationManagerConfiguration, requires spring-security-config
to be on the classpath as AuthenticationManagerConfiguration extends
GlobalAuthenticationConfigurerAdapter from spring-security-config.

This commit makes SecurityAutoConfiguration conditional on the
presence of GlobalAuthenticationConfigurerAdapter so that the
auto-configuration will be disabled in its absence rather than causing
an app to fail to start.

Closes gh-2046
2014-12-02 11:18:23 +00:00
Andy Wilkinson
064f88a9fb Use a free port, rather than 8080, in WebSocketAutoConfigurationTests
Closes gh-2043
2014-12-02 09:46:48 +00:00
Phillip Webb
09dac5ff00 Apply formatting and cleanup rules 2014-12-01 19:35:03 -08:00
Phillip Webb
48db5457f1 Polish 2014-12-01 19:32:05 -08:00
Dave Syer
911d39f937 Ensure authentication events get published
When the user provides their own AuthenticationManager we do a lazy
initialization and didn't (till now) inject the AuthenticationEventPublisher

Fixes gh-2033
2014-12-01 17:42:18 +00:00
Stephane Nicoll
1a5916665c Remove unused RabbitMQ dynamic property flag
Fixes gh-1999
2014-11-27 14:49:35 +01:00
Stephane Nicoll
65e9d6a6e0 Add property description
Set the field javadoc of many properties that are managed via
configuration so that the "description" field is available in the
meta-data.

Closes gh-1808
2014-11-27 14:23:27 +01:00
Andy Wilkinson
40a7445fec Merge branch '1.1.x' 2014-11-26 17:51:56 +00:00
Andy Wilkinson
64599261a5 Allow mongo port, host, and credentials to be configured individually
Previously, the host had to have a custom value for the configuration
of the port or credentials (username and password) to take effect. This
meant, for example, that you couldn’t just set the port or just set the
username and password while using the default host.

This commit allows the port or username and password to be configured
without also configuring the host. The default host (localhost) and
port (27017) are retained.

Fixes gh-2008
2014-11-26 17:34:21 +00:00
Oliver Gierke
123b90fa64 Register all packages where @EnableAutoConfiguration is used
Previously, when @EnableAutoConfiguration was used in multiple packages,
the last @EnableAutoConfiguration that was processed would
win and only its package would be stored as an auto-configuration
package.

This commit updates AutoConfigurationPackages to allow multiple package
name registrations. AutoConfigurationPackages.set(…) has been altered to
augment the constructor arguments of the BeanDefinition registered for
the initial call to the method so that the packages handed to the method
call will be added to the bean definition and not replace the previous
ones. The method has been renamed register(…) to reflect the changed
behavior.

Closes gh-1994
2014-11-26 11:21:58 +00:00
Andy Wilkinson
d5b7f49f83 Merge branch '1.1.x' 2014-11-26 10:22:06 +00:00
Andy Wilkinson
9270303a9a Remove double “and” from DataSourceInitializer’s javadoc 2014-11-26 10:21:57 +00:00
Andy Wilkinson
d5ad502d31 Disable Undertow auto-config if required XNIO classes are unavailable
Fixes gh-1986
2014-11-24 10:46:11 +00:00
Dave Syer
9f7bd0cddc Inject ResourceConfig instance (not class) into Jersey
If you inject the class (via a servlet parameter) it seems that
Jersey tries to create all the beans for you (and fails). I thought
it was supposed to work (according to the docs), so I'm a bit confused
but the sample now has Spring DI and the tests pass.

Fixes gh-1981
2014-11-22 17:17:53 +00:00
Phillip Webb
2a9a749329 Polish 2014-11-21 13:27:19 -08:00
Dave Syer
5b044356dc Clarify the deprecation status of HttpMapperProperties 2014-11-21 09:19:32 +00:00
Phillip Webb
70a1438c6f Don't replace MappingJackson2HttpMessageConverter
Guard against Spring Data REST TypeConstrained Jackson converters
replacing the default MappingJackson2HttpMessageConverter.

Fixes gh-1968
2014-11-20 17:36:55 -08:00
Phillip Webb
bf0629522c Only use Gson if Jackson is missing
Update HttpMessageConvertersAutoConfiguration to only register Gson
support when Jackson is not on the classpath.

Fixes gh-1967
2014-11-20 17:21:25 -08:00
Phillip Webb
2b57c5a4dd Rename spring.data.mongo.repositories.enabled
Rename mongo to mongodb.

Fixes gh-1966
2014-11-20 14:57:49 -08:00
Phillip Webb
670ba33bec Improve MongoDataAutoConfiguration
Update MongoDataAutoConfiguration to provide easier configuration of
CustomConversions, the MappingMongoConverter, MongoMappingContext
and an authentication database.

Fixes gh-1619
Fixes gh-1730
2014-11-20 14:55:19 -08:00
Phillip Webb
2a8579026f Polish 2014-11-20 10:16:33 -08:00
Stephane Nicoll
11894a5412 Fix manual metadata format inconsistency
Fixes gh-1961
2014-11-20 13:58:39 +01:00
Dave Syer
12a7df6c40 Be defensive about classloader in MessageSourceAutoConfiguration
Fixes gh-1960
2014-11-20 12:29:16 +00:00
juzer
428d2caac1 Fixed potential ClassCastException getting error
Update DefaultErrorAttributes to expect a `Throwable` ERROR_ATTRIBUTE
rather than an `Exception`.

Fixes gh-1931
2014-11-19 13:36:57 -08:00
Phillip Webb
c34cfb27a3 Polish 2014-11-19 10:52:26 -08:00
Phillip Webb
3a4d62fb3a Gracefully ignore placeholder exceptions
Update BeanTypeRegistry to gracefully ignore LoadBeanClassException and
BeanDefinitionStoreException exceptions in the same way as
DefaultListableBeanFactory.doGetBeanNamesForType() does.

Fixes gh-1955
2014-11-19 09:59:14 -08:00
Dave Syer
7fa0ea7c3b Add support for spring.jersey.type=filter
Fixes gh-1756
2014-11-19 16:51:55 +00:00
Dave Syer
3a4f1f6f39 Attempt to get Jersey working as filter 2014-11-19 15:57:31 +00:00
Andy Wilkinson
90af8bf54a Add auto-configuration for Jetty 9's WebSocket support
Closes gh-1269
2014-11-19 14:44:54 +00:00
Phillip Webb
b583262211 Use SmartInitializingSingleton when possible
Switch implementations of ApplicationListener<ContextRefreshEvent> for
SmartInitializingSingleton when possible.

Fixes gh-1939
2014-11-18 13:50:49 -08:00
Andy Wilkinson
7a783f5a18 Merge branch '1.1.x' 2014-11-18 21:31:19 +00:00
Andy Wilkinson
863c099161 Add missing copyright headers 2014-11-18 21:29:54 +00:00
Andy Wilkinson
1864d79077 Polish Undertow contribution
Closes gh-1779
2014-11-18 21:20:34 +00:00
sopov.ivan
c501b889af Add support for using Undertow as an embedded container
See gh-1779
2014-11-18 21:20:34 +00:00
Andy Wilkinson
f43d6925c5 Apply spring.jackson.* config to HypermediaAutoConfiguration’s ObjectMapper
Previously, HypermediaAutoConfiguration would trigger the creation of
an ObjectMapper bean named _halObjectMapper. This bean did not have the
spring.jackson.* configuration applied to it, however its presence
would revent JacksonAutoConfiguration from creating its
ObjectMapper. This left the user with an ObjectMapper that did not
honour the spring.jackson.* configuration.

This commit updates HypermediaAutoConfiguration to use the
Jackson2ObjectMapperBuilder that may have been created by
JacksonAutoConfiguration. If the builder exists it is used to configure
the _halObjectMapper bean.

Fixes gh-1949
2014-11-18 15:51:30 +00:00
Andy Wilkinson
35b7ba5cda Deprecate http.mappers.* properties
The http.mappers.* configuration properties assumed that the mapping
was JSON (on of the property names was jsonPrettyPrint) and also only
exposed a small subset of the configuration options supported by
Jackson (and GSON). The property names implied that it would configure
all HTTP mapping, however it was ignored by GsonAutoConfiguration.

This commit deprecates the support for http.mappers.* in favour of
configuring Jackson or Gson instead. Jackson can be configured
declaratively using the spring.jackson.* properties or programtically.
Gson can be configured programatically by using a GsonBuilder to
create a Gson instance with the desired configuration.
gh-1946 has been opened to add support for declarative configuration
of Gson.

Closes gh-1945
2014-11-18 13:51:48 +00:00
Andy Wilkinson
6cfd6cad64 Merge branch '1.1.x' 2014-11-18 13:16:45 +00:00
Andy Wilkinson
9eae29938c Test that http.mappers props are applied by JacksonAutoConfiguration
Closes gh-1919
2014-11-18 11:47:29 +00:00
Nicolás J. García
f51b304c2a Update JackonAutoConfiguration to apply all http.mappers properties
Previously, only the http.mappers.json-sort-keys property was applied
by JacksonAutoConfiguration. This commit updates it to also apply the
http.mappers.json-pretty-print property as well.

See #1919
2014-11-18 11:40:29 +00:00