Commit Graph

79 Commits

Author SHA1 Message Date
Dave Syer
3c34326208 [bs-141] Add Bootstrap WebApplicationInitializer got traditional wars
[#50806851] [bs-141] First class escape hatch from jar to war for web applications
2013-06-01 14:43:55 +01:00
Phillip Webb
7e3c158f3a Polish 2013-05-31 12:26:30 -07:00
Dave Syer
969c7d6fa1 Make sure ThymeleafAutoConfiguration works if imported directly
Before this change if Layout dialect not available then the nested class is
loaded and barfs because it depended on the layout dialect (in a
@ConditionalOnClass annotation).
2013-05-31 16:18:03 +01:00
Dave Syer
990627b328 [bs-144] Make EmbedddedContainerConfiguration an import selector
Previously EmbedddedContainerConfiguration cannot be imported directly.
This change ensures that the nested classes are not loaded automatically
so there can be no issues with the annotation parameters.

There might be a case for a change in Spring here since the framework
itself could just be more cautious when processing nested classes.

[Fixes #50880927]
2013-05-31 13:24:04 +01:00
Dave Syer
6c22e0ab6e [bs-140] Extract framework-provided @ConfigurationProperties into @Bean
Allows @ConfigurationProperties beans to be declared explicitly (to set default values)

[#50804109]
2013-05-31 13:02:30 +01:00
Dave Syer
cf201ffd80 [bs-142] Add @AssertMissingBean
Example usage is to fail fast if trying to provide
a @ConfigurationProperties bean and it was already
defined

[Fixes #50812235]
2013-05-30 14:15:06 +01:00
Dave Syer
8023a862c3 Add test for @ConfigurationProperties
Various parent context topologies are tried to ensure that the properties
are bound sensibly.

[#50804109] Allow @ConfigurationProperties beans to be declared
explicitly (to set default values)
2013-05-30 11:22:03 +01:00
Dave Syer
3ba5f56808 [bs-138] Add @OnManagementContext for management beans
User adds @OnManagementContext to a bean or @Configuration and
it should be included in the management context (if there is one)
whether it is the main context or a child.

Makes it easy to secure the management endpoints and keep
the rest open (see actuator-ui-sample).

[#50721675]
2013-05-30 08:43:50 +01:00
Dave Syer
729cfe813b [bs-22] Add more unit tests 2013-05-29 09:37:31 +01:00
Dave Syer
aabff1a774 [bs-61] Allow non-default servlets and filters to be registered
* The RegistrationBean (ServletInitializer) now exposes a registration
target object, and this is used to prevent double registration of those
objects.
* If there is a Servlet with bean id "dispatcherServlet" it is mapped to
"/" (unless already registered as a ServletRegistrationBean).

[Fixes #48645559]
2013-05-29 07:41:48 +01:00
Dave Syer
b7c0e3279e [bs-22] Add loads of actuator tests
Discovered a few issues along the way and refactored
accordingly.

[#48127729] [bs-22] Add missing unit tests
2013-05-23 18:37:48 +01:00
Dave Syer
29a81b8795 [bs-130] Prevent double registration
* A simple check to see if it is already registered
fixed the original problem
* Also removed the need to have @ConfigurationProperties
on a bean class (unless you want to specify the target name
etc.)

[Fixes #50256421] [bs-130] When actuator app starts the
@ConfigurationProperties are registered with the bean
factory several times
2013-05-22 15:21:07 +01:00
Dave Syer
a700ed4479 [bs-133] Move ServerProperties to spring-bootstrap core
[Fixes #50345533]
2013-05-22 13:08:12 +01:00
Dave Syer
f73fbfc901 [bs-131] Use MapPropertySource instead of SimpleCommandLinePropertySource
[Fixes #50267831] --server.port=9000 not working on command line
2013-05-21 15:26:16 +01:00
Dave Syer
caf1aab9db [bs-22] Add tests for variour @Conditional implementations
[#48127729] [bs-22] Add missing unit tests
2013-05-21 09:51:49 +01:00
Dave Syer
c6b4c48181 [bs-22] Add tests for OnResourceCondition
[#48127729] [bs-22] Add missing unit tests
2013-05-21 09:37:07 +01:00
Dave Syer
c675d9c76e [bs-22] Add tests for Yaml processing
* Gap in logic identified, so DocumentMatcher refactored to
return an enum

[#48127729] [bs-22] Add missing unit tests
2013-05-21 09:26:35 +01:00
Dave Syer
7531c5acfb [bs-22] Add test for Batch auto config
[#48127729] [bs-22] Add missing unit tests
2013-05-21 09:26:01 +01:00
Dave Syer
8bb968d8f5 Switch favicon.ico value 2013-05-18 18:58:08 +01:00
Dave Syer
2861ad4106 [bs-122] Support for Spring Data DomainClassConverter
[#49906951]
2013-05-18 16:52:17 +01:00
Dave Syer
ab121dc91b [bs-127] Add DataSourceTransactionManager if no others are in use
* If the auto config class has a high Order it can check for
an existing transaction manager
* Unit tests added, and checked also witrh petclinic

[Fixes #50064347]
2013-05-18 16:20:22 +01:00
Dave Syer
8dae41f24c Fix missing trailing / in resource paths 2013-05-18 16:03:27 +01:00
Dave Syer
a12f0dcd12 [bs-51] Add support for h2 and Derby embedded database
Also included support for database shutdown in @PreDestroy

[Fixes #48387903]
2013-05-17 17:57:56 +01:00
Dave Syer
1a0902b32a Improve logging for @Conditional processing
[Fixes #49989913] [bs-125] @Conditional* seem to get processed multiple times?
2013-05-17 17:31:31 +01:00
Dave Syer
00c227ac01 Add favicon.ico 2013-05-17 16:12:06 +01:00
Dave Syer
a1dd6e3293 Fix data sample (needed an enum for spring.jpa.ddl_auto) 2013-05-17 16:07:40 +01:00
Dave Syer
369b0834a0 Re-order spring.factories so vanilla JPA users get component scan detection 2013-05-17 13:58:09 +01:00
Dave Syer
50f3a2c614 Add logging to BasicDataSourceConfiguration 2013-05-17 12:11:42 +01:00
Dave Syer
2dc296caa9 [bs-98] Add support for Tomcat database pool
* If Tomcat jdbc is available and the driverClassName and url
are provided or can be guessed (e.g. for HSQL) it is used.
Properties spring.database.{driverClassName,url} are consulted.

* If Commons DBCP is available it is used (if Tomcat is not)

* Otherwise an EmbeddedDatabase is created if all the bits are
available

* A JdbcOperations and a NamedParameterJdbcOperations are
available by default if a DataSource is created

* The data source is initialized from spring.database.schema (csv
of resource patterns)

[Fixes #49393511]
2013-05-17 11:57:02 +01:00
Dave Syer
74fffeba73 Rename LoggingInitializer to be consistent with others 2013-05-17 11:56:30 +01:00
Dave Syer
83b5240a0f Add some dependencies 2013-05-17 11:54:52 +01:00
Dave Syer
73f28a3809 [bs-22] Add tests for JPA auto configuration
* Extracted the component scan detector so it can be used
without @EnableAutoConfiguration
* Added unit tests
* Improve logging in @Conditional processing

[#48127729]
2013-05-16 14:05:07 +01:00
Dave Syer
ad2e311f2f [bs-124] Add tests for @ConditionalOnBean
[#49989537] [bs-124] @ConditionalOnBean doesn't work
2013-05-16 12:14:46 +01:00
Dave Syer
728b4887c1 [bs-107] Remove "z" suffix from management endpoints
* /varz->/metrics
* /healthz->/health
* all actuator endpoints are now in a subpackage

[Fixes #49496887]
2013-05-15 16:13:23 +01:00
Dave Syer
53078c320e [bs-118], [bs-119]: add UI builder features
* MessageSource created automatically (location
spring.messages.basename:messages)
* Thymeleaf configured automatically to look for
templates in classpath:/templates
* Added static resource handlers for classpath:/static
and classpath:/

[Fixes #49832165] [bs-118] Support for thymeleaf templates
2013-05-15 15:58:18 +01:00
Dave Syer
ceea71fc38 [bs-53] Fix class loading problem with Log in a Condition 2013-05-13 17:36:07 +01:00
Dave Syer
ad3076784d [bs-53] Aid for users debugging auto-configuration failures
Add logging to Condition implementations.

[Fixes #48389533]
2013-05-13 14:27:43 +01:00
Dave Syer
ef5c8aa304 [bs-115] Add EmbeddedServletContainerCustomizer as a callback
* All instances are called before the container is started in
 a bean post processor
* Users still have to be careful because the customizer is
called very early in the ApplicationContext lifecycle (e.g.
might have to do a lookup for some dependencies instead of
@Autowired)

[Fixes #49671463] User-hook for customizing embedded servlet container
2013-05-10 17:20:08 +01:00
Dave Syer
ad19edf03b Fix bug introduced by Spring @Configuration processing 2013-05-10 15:45:12 +01:00
Dave Syer
fc8240ac88 Fix ordering problem with validator being null 2013-05-10 14:45:18 +01:00
Dave Syer
ceab9b9b33 [bs-111] Extract trace logging from Security config
It's not really a security feature (just logging request headers),
so better to put it in the main actuator autoconfig.

[Fixes #49578819] [bs-111] Unresolvable cycle when separating management.port
2013-05-09 12:21:47 +01:00
Phillip Webb
c8f37a95c9 [bs-18] Unhack direct field access
Remove reflection hacks from ConfigurationPropertiesBindingConfiguration
following updates to Spring 4.0
2013-05-08 20:55:20 -07:00
Phillip Webb
44947b13a8 Polish calling of ExitCodeGenerators 2013-05-08 14:45:58 -07:00
Phillip Webb
a0fb085102 Refactor to work with Spring 4.0
Refactor code to work with Spring 4.0 M1
2013-05-08 14:41:51 -07:00
Phillip Webb
4743d1803c Update JavaLoggerConfigurer to use AC ClassLoader
Update JavaLoggerConfigurer to use the ApplicationContext classloader
rather then the default classloader. Also refactored to introduce
LoggingSystem enum to act as a strategy for the specific logging
systems.
2013-05-08 14:41:51 -07:00
Phillip Webb
e7a67ba2a8 Use commons-logging for bootstrap dependencies
Update main bootstrap modules to use Apache commons-logging rather than
SLF4J.
2013-05-08 13:37:23 -07:00
Phillip Webb
cafded9e7e Polish JavaDoc 2013-05-08 13:20:25 -07:00
Dave Syer
8bfe07c730 Use HttpStatus in ErrorPage 2013-05-08 15:33:25 +01:00
Dave Syer
4a292bd93f [bs-97] Support adding management endpoints to a different network
* ManagementProperties and ServerProperties now support an address property
* For example set management.port=9001,management.address=127.0.0.1 to listen
on port 9001 but only for connections from the localhost

[Fixes #49395783]
2013-05-08 12:08:02 +01:00
Dave Syer
a5810af882 Add mvn deployment gumf 2013-05-08 10:53:37 +01:00