Commit Graph

44 Commits

Author SHA1 Message Date
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
Dave Syer
d6a670e13e [bs-47] Add default command line args to SpringApplication
* See SpringApplication.setDefaultCommandLineArgs
* Assumes command line is in "simple" form (TODO: if we
need JOpt etc. support then the command line args parsing from
Spring needs to be exposed)
* If defaults are provided the command line might be re-ordered
slightly (non-option args come after option args)
* Allows custom application.properties file names to be specified
as a side effect (--spring.config.name=... or
--spring.config.location=...}.

[Fixes #48284369]
2013-04-26 10:45:08 +01:00
Dave Syer
bcf86b320e [bs-72], [bs-75] Add Batch plugin features
* Auto config in main bootstrap jar
* Compiler enhancements in groovy cli
* Sample script in cli samples

[Fixes #48716881], [Fixes #48788313]
2013-04-26 07:01:37 +01:00
Dave Syer
83e0ea22c1 [bs-19] Add samples and CLI support for Spring Integration
$ cd spring-bootstrap-cli
    $ export SPRING_HOME=target
    $ src/main/scripts/spring run samples/integration.groovy

The big disadvantage at the moment is that there is no goo way to
detect Spring Integration in the AST (at least not as good as @Enable*).
So for now we are looking for @MessageEndpoint or a class name with
SpringIntegration in it.

[#48151147]
2013-04-25 17:15:05 +01:00
Dave Syer
d82c50804f [bs-73] Tweak algorithm for detecting anonymous classes
Apparently an anonymous class in Groovy is no anonymous in the compiled code,
so we need another heuristic.  We now check for non-existence of public
constructors (if there are none then there's no point regsistering that
class with an application context).

[#48718891]
2013-04-25 17:12:01 +01:00
Dave Syer
a2d328ae3a [bs-73] Anonymous classes cannot be used in @Bean definitions in .groovy scripts
* Added a test for each of the classes loaded by the SpringApplication
* If it's an anonymous class or looks like a Groovy closure we ignore it
* The CLI sample job.groovy also modified to take advantage

[Fixes #48718891]
2013-04-25 16:02:44 +01:00
Dave Syer
38f0cf1ed2 [bs-62] Add integration tests for CLI samples
[Fixes #48658503]
2013-04-24 16:09:17 +01:00
Dave Syer
8a4b50e289 [bs-14] Ensure all servlet context initializers are called
Misuse of TreeSet in EmbeddedWebApplicationContext corrected
(use List and Comparator instead of TreeSet).

[Fixes #48055339]
2013-04-24 10:14:22 +01:00
Dave Syer
fb6b224470 Fast forward existing prototype work 2013-04-24 10:02:07 +01:00