Commit Graph

160 Commits

Author SHA1 Message Date
Dave Syer
9e14409334 Improve test coverage in RelaxedDataBinder 2013-07-26 10:32:10 +01:00
Dave Syer
b1f4320c17 Added new logic to RelaxedDataBinder to deal with nested stuff
* Leverages existing behaviour of BeanWrapperImpl where possible
to autogrow collections and lists
* Logic for scanning and converting bean paths encapsulated in
BeanPath inner class

[Fixes #53947797] [bs-249]
@ConfigurationProperties cannot bind to Map<String,List<Thing>>
2013-07-26 10:10:31 +01:00
Phillip Webb
e695b4a6ea Use Registrar to register BeanPostProcessors
Use a ImportBeanDefinitionRegistrar to register BeanPostProcessors
rather than using @Bean definitions. Prevents warnings about
beans not having all BeanPostProcessors applied.
2013-07-25 00:18:20 -07:00
Phillip Webb
132722100a Turn down logging 2013-07-25 00:18:20 -07:00
Phillip Webb
da07cdf41f Fix TomcatEmbeddedWebappClassLoader for Tomcat 8
Rework TomcatEmbeddedWebappClassLoader to deal with the fact that
the 'system' field is final in Tomcat 8.

Issue: #53945989
2013-07-25 00:18:20 -07:00
Dave Syer
a365b8c1b6 Added ignored test cases for binding to maps
[#53947797] [bs-249] @ConfigurationProperties cannot bind to
Map<String,List<Thing>> or Map<String,Thing>
2013-07-24 13:21:20 +01:00
Dave Syer
ca74168936 Exclude JSP classes by default 2013-07-24 11:44:40 +01:00
Dave Syer
abf36c30f9 Add back no-op setLoader to ServerProperties
Tomcat starts up with server.loader System property set so
we need to accept that.

[Fixes #50806851] [bs-141]
First class escape hatch from jar to war for web applications
2013-07-23 18:10:09 +01:00
Dave Syer
4ecfbf68bf Allow multi-valued spring.config.name
Now accepts CSV list and later values override in the
implied map that is generated.

[Fixes #53785419] [bs-245]
2013-07-23 11:10:54 +01:00
Dave Syer
01ebd6da08 Fix CLI script 2013-07-22 12:06:35 +01:00
Dave Syer
944fd4f4b8 Enhance some docs and add content to READMEs 2013-07-19 17:36:22 +01:00
Phillip Webb
8fdfe245ca Add tests for session timeouts
Add unit tests for session timeouts and also added a convenience method
to set the time with a TimeUnit.

Issue: #53667353
2013-07-19 09:19:59 -07:00
Phillip Webb
100edf9a4b Remove getters from ConfEmbServletContainerFactory
Only provide setters on the ConfigurableEmbeddedServletContainerFactory
interface.
2013-07-19 08:57:21 -07:00
Phillip Webb
adbbc35944 Reduce logging level for non-critical warning 2013-07-19 08:50:15 -07:00
Phillip Webb
b824d6309a Hide hibernate validator version INFO logging 2013-07-19 08:50:15 -07:00
Dave Syer
ea3d2e74dd Add sessionTimeout to embedded servlet containers
* ConfigurableEmbeddedServletContainerFactory now has a sessionTimeout
property
* The ServerProperties in Actuator supports it

[Fixes #53667353] [bs-243] Support setSessionTimeout
2013-07-19 09:37:35 +01:00
Phillip Webb
1b780beddd Support mime type extension mappings
Add MimeMappings class to encapsulate mappings between file extensions
and mime types.

Issue: #51754753
2013-07-18 15:54:56 -07:00
Dave Syer
4469f36975 Format thread ID to be fixed width
...instead of...
[#53530203] [bs-237] Put [thread] at end of log line
2013-07-18 21:51:30 +01:00
Phillip Webb
9ce3428597 Add EmbeddedServletContainer.start() method
Add EmbeddedServletContainer.start() method that is used to start the
embedded servlet container once the application context has finished
being refreshed.

Refactored existing EmbeddedServletContainerFactory implementations to
no longer keep server instances locally.

Issue: #53538787
2013-07-18 11:38:25 -07:00
Phillip Webb
facbbd4c93 Remove unnecessary TODO from SimpleJsonParser 2013-07-18 10:18:59 -07:00
Dave Syer
fff2a804bc Add springcli.properties for version labels
[Fixes #53030591] [bs-191] Use filtering in maven build
2013-07-18 16:33:12 +01:00
Dave Syer
ffa70f7c7e [bs-239] Race condition in embedded container contexts
I'll mark this as fixing the bug in tracker, but it might benefit
from some re-working at some point. The basic idea is to use
our old friend ContextRefreshedEvent to start the server listening
for connections. Delaying and making public the start() method from the
EmbeddedServletContainer doesn't help because you need the server to
start in order to get a ServletContext for Spring.

[Fixes #53538787]
2013-07-18 11:29:00 +01:00
Phillip Webb
50109d4ace Set PID early for logging
Set PID early in the initialization process to ensure log enties are
not written without an ID.
2013-07-17 23:25:24 -07:00
Dave Syer
7dd186aa40 Use enum for parent context modes in @ConditionalOnBean
@ConditionOn*Bean now have search=ALL by default (CURRENT and
PARENTS also supported).

[Fixes #53538357]
2013-07-17 12:25:54 +01:00
Phillip Webb
521608fda3 Extract CLI parsing from config file initializer
Extract command line property parsing logic from the
ConfigFileApplicationContextInitializer and instead perform it as part
of the SpringApplication initialization. This allows SpringApplications
that do not use the ConfigFileApplicationContextInitializer to still
expose command line arguments as property sources.

SpringApplicationInitializers may now implement EnvironmentAware if
they need access to the environment during early initialization.

This commit also removes the custom command line parsing logic that
was temporarily added to work around SPR-10579 which has since been
fixed upstream.
2013-07-17 00:23:25 -07:00
Dave Syer
4ce6b64dce [bs-175] Generic dispatcher features for SpringApplication
* Move Spring.main into SpringApplication.main
* User can bind command line or application.properties into
SpringApplication
* User can provide sources dynamically with --spring.main.sources
(a CSV list of class names, package names or XML resource locations)
* One side effect was to make DocumentMatchers stateless

[#52830829]
2013-07-16 10:45:36 +01:00
Dave Syer
f52d624be5 Add option in @OnBeanCondition to *only* look in parent
[Fixes #53374039] [bs-231] Broken tests for management port configuration
2013-07-15 11:16:02 +01:00
Phillip Webb
14aa163731 Start to breakup README.md documentation 2013-07-14 20:50:44 -07:00
Phillip Webb
30bf5dcb0d Do not using static finals for PID and format
Update SimpleFormatter so that the PID and format can be different per
formatter instance.
2013-07-14 06:55:15 -07:00
Dave Syer
217a6a4cd1 Unify log format of default JDK logger with other systems 2013-07-14 08:58:47 +01:00
Phillip Webb
dc1b787a01 Support color log output
Rework logback formatting to include ansi color output. Also added
support for JUL over SLF4J to ensure that tomcat logging looks OK.

Issue: #53249833
2013-07-13 21:05:07 -07:00
Phillip Webb
5c46a39494 Polish ANSI code 2013-07-13 16:05:56 -07:00
Phillip Webb
a324beadac Create LoggingSystem class to configure logging
Add LoggingSystem class that can be used to configure various logging
systems in a consistent way. Mostly the code is migrated from the
LoggingApplicationContextInitializer.
2013-07-13 16:04:08 -07:00
Phillip Webb
ae20d389c4 Add SpringApplicationInitializer strategy
Add SpringApplicationInitializer that can be used to initialize a
SpringApplication before it runs. An ApplicationContextInitializer
can optionally implement this interface.
2013-07-13 16:04:07 -07:00
Phillip Webb
0b673d82e2 Add simple ANSI encoder and colorize the banner
Issue: #51754753
2013-07-12 13:51:50 -07:00
Phillip Webb
2a4454b524 Add simple Java Util Logging formatter
Add simple formatter used with the default logging.properties to
improve JUL output.
2013-07-12 00:44:16 -07:00
Phillip Webb
d4b9014b64 Log useful information on startup
Include the bootstrap version number in the banner and log information
such as the host name when starting.

Issue: #53030523
2013-07-12 00:44:05 -07:00
Phillip Webb
7d0c0fc0dd Polish 2013-07-11 11:21:34 -07:00
Dave Syer
6dbd6d7c4c [bs-178] Use OpenEntityManagerInView by default in webapp with JPA
If JPA is used and the context is a webapp we add the OEMIV interceptor.
It can be switched off by the user declaring a bean of type OEMSIVI or
the corresponding Filter, or by setting spring.jpa.open_in_view=false.

[Fixes #52939983]
2013-07-11 18:13:49 +01:00
Dave Syer
a7c3edefe8 Tied up loose end for spring profile binding in YAML
The short story: we only support comma-separated spring.profiles
in YAML documents.

[#51968679]
2013-07-11 15:24:25 +01:00
Dave Syer
d5aad97d1f [bs-168] Support convenient binding of @Bean to external source
@ConfigurationProperties now has a path() attribute that can be used
to specify a resource location explicitly.

[Fixes #51968657]
2013-07-11 13:23:24 +01:00
Dave Syer
15ba11f302 [bs-167] Fixed YamlProcessor to not create a key for an array
[Fixes #51968679] YamlPropertiesFactoryBean creates unbindable keys
(the toString() of the whole map for instance)
2013-07-11 11:07:42 +01:00
Phillip Webb
86ce60593b Relax logging tests for CI 2013-07-10 10:50:04 -07:00
Phillip Webb
fbc68fe145 Tweak EmbeddedServletContainerCustomizer javadoc
Make it a little clearer that a
EmbeddedServletContainerCustomizerBeanPostProcessor is usually involved.

Issue: #53029445
2013-07-10 09:02:04 -07:00
Phillip Webb
3ba700a861 Revert accidentally changed logging.properties 2013-07-09 13:15:43 -07:00
Phillip Webb
02ae46d40e Further attempt to fix CI log test failures 2013-07-08 21:35:00 -07:00
Phillip Webb
83d3b508a8 Revert "@Ignore logging tests that fail on CI"
This reverts commit 2630aa732f.
2013-07-08 20:27:40 -07:00
Phillip Webb
dbd29f36ec Protect against malformed logging.config
Ensure that any user specified logging.config exists. Required for
CI build as bamboo sets a "LOGGING_CONFIG" environment variable.
2013-07-08 19:30:34 -07:00
Phillip Webb
2630aa732f @Ignore logging tests that fail on CI 2013-07-08 17:56:23 -07:00
Phillip Webb
abad5aa8e4 Attempt to fix logging tests that fail in CI 2013-07-08 17:45:27 -07:00