Commit Graph

58 Commits

Author SHA1 Message Date
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
Dave Syer
694a1dd408 Bump version to 0.5.0.BUILD-SNAPSHOT 2013-05-08 10:07:22 +01:00
Dave Syer
b462bc6e6c [bs-96] Switch off m2e errors about /eclipse path
* Uploaded m2e eclipse baggage to http://static.springsource.org
* Changed location in parent pom
* Removed all main.basedir properties from poms

[Fixes #49285987]
2013-05-07 07:37:47 +01:00
Dave Syer
7e548b5bd4 [bs-93] Add /info endpoint with git properties etc.
* If git.properties is on the classpath (e.g. from the Maven plugin)
/info will list the commit id, branch and dates.
* If application.yml has an info object at the top level that will
be diplayed as well (so e.g. you can use Maven resource filtering
top add the project name, version etc.)
* RelaxedDataBinder can now be used to bind to a Map (as opposed to
a nested Map inside teh target bean)

[Fixes #49130073]
2013-05-03 12:45:06 +01:00
Dave Syer
f5bfc37896 Use Resource[] for database initialization 2013-05-03 08:16:22 +01:00
Dave Syer
47f60684e3 [bs-94] Add database initializer if schema.sql detected
* If an embedded database is created it is also initialized from
classpath:/schema.sql if it exists
* Also added (but didn't use) @ConditionalOnResource

[Fixes #49142305]
2013-05-02 18:07:53 +01:00
Dave Syer
61a94f212d [bs-89] Allow user to plugin validator for @ConfigurationProperties
* Also fix ordering problem in integration tests
(An application context not being closed led  to port 8080
being already in use.)
* Validator can be specified by providing a Spring Validator with
bean id configurationPropertiesValidator.

[Fixes #49067859]
2013-05-02 16:23:08 +01:00
Dave Syer
504d96eb51 [bs-92] Add simple main wrapper for SpringApplication
* Added Spring class
* Used in demo project in README
* Also fixed cycle in spring-bootstrap jar

[Fixes #49121565]
2013-05-02 15:37:47 +01:00
Dave Syer
a968b140cc Add java docs to SpringApplication.main 2013-05-02 07:15:55 +01:00
Dave Syer
ce0e443b0a [bs-84] Add basic getting started guide to service project
Still work in progress, bubt enough there to get someone up a
nd running I hope
[#49047467]
2013-05-01 16:10:57 +01:00
Dave Syer
bd79ec2362 [bs-22] Move @ConfigurationProperties processing to main jar
Also add unit tests.  Note also the start.groovy for the service
sample now works.

[#48127729]
2013-05-01 14:01:13 +01:00
Dave Syer
30087cf6b9 [bs-55] Add strategy for setting system exit code
* Added ExitCodeGenerator and SpringApplication.exit
convenience method
* User can add bean of type ExitCodeGenerator or supply
one in the call to exit()

[Fixes #48475971]
2013-05-01 11:17:27 +01:00
Dave Syer
4d372bcc25 Remove runComponents from SpringApplication
It was basically duplicating run(Object[], String[]) - unless
there is some harm in registering a non-component with the context
that I haven't seen yet.
2013-05-01 09:59:10 +01:00
Dave Syer
833b13bbbc [bs-80] Add configurable / switchable web request trace logging (headers etc)
* Added a bean post processor for the Spring Security filter chain
(so you only get traces by default if security is on)
* Every request is logged at trace level if the dump requests flag is
on
* Requests are also dumped to a TraceRepository for later analysis (very
useful for tracing problems in real time when a support call comes in)

[Fixes #48976001]
2013-04-30 15:24:27 +01:00
Dave Syer
361f500ed5 [bs-28] Add /shutdown endpoint to service apps
Disabled by default use container.allow_shutdown=true to switch
it on.  Then POST to /shutdown to shut down the app.

[#48059059]
2013-04-30 10:17:39 +01:00
Dave Syer
c4028656ef Move context initializers into subpackage 2013-04-29 17:28:04 +01:00
Dave Syer
bb62ca835e [bs-24] Support multi-file compile from command line
* Each non-option arg is tested to see if it is a file
* If it is .groovy (or .java) it is compiled

[#48127661]
2013-04-29 15:54:09 +01:00
Dave Syer
e8e059bc90 [bs-78] Add port=0 option to switch off main servlet container
[Fixes #48888639]
2013-04-29 09:15:03 +01:00
Dave Syer
628a8c79aa [bs-19] Medley of changes supporting integration apps
* Use file adapters in sample instead of internal flow
* Add Exception to signature of CommandLineRunner for
implementation convenience
* Updates for Security snapshots
2013-04-29 08:35:01 +01:00
Dave Syer
10c333ea10 [bs-73] Tweak algorithm for detecting anonymous classes
@Bean definitions in Groovy that contain closures have the bean name in
the class name.  Ugh.  Added regex match to catch that.

[#48718891]
2013-04-26 12:02:49 +01:00
Dave Syer
ec351e5f7d Add test for custom context initializer
[#48127729] [bs-22] Add missing unit tests
2013-04-26 11:05:17 +01:00
Dave Syer
4ca26058fa [bs-73] Tweak configuration class detection algorithm some more
This looks like becoming a recurring theme. Unfortunately it's
not very easy to test if a class might eventually be instantiatable
by Spring.

This change fixes the main bootstrap SpringApplicationTests
which were failing because they used non-static inner classes
for test configurations.
2013-04-26 10:45:17 +01:00