Commit Graph

6914 Commits

Author SHA1 Message Date
Andy Wilkinson ee409482b3 Enable the use of formatter off and on tags in Eclipse
This commit enables the use of // @formatter:off and // @formatter:on
to surround lines of code that should not be formatted. It also adds
a code template that can be used to quickly wrap the selected lines
of text with the off and on comments.

Closes gh-5050
2016-01-29 16:05:18 +00:00
Vedran Pavic 93de0d7dc0 Improve systemd service documentation
Closes gh-5041
2016-01-28 11:31:28 +01:00
Stephane Nicoll 135ebb8ded Merge pull request #5013 from izeye/polish-20160123
* pr/5013:
  Polish
2016-01-24 19:13:14 +01:00
Johnny Lim 9a31e02806 Polish
Closes gh-5013
2016-01-24 19:13:01 +01:00
Andy Wilkinson 4c1bb38878 Fix broken locking in Restarter.initialize
Closes gh-4955
2016-01-22 15:21:00 +00:00
Phillip Webb c77a7e0cba Fixup version numbers following release 2016-01-21 19:18:01 -08:00
Spring Buildmaster 504d3e97ba Next development version 2016-01-21 18:41:30 -08:00
Phillip Webb 6d19d737a4 Downgrade to Spring Web Services 2.2.3
Since 2.2.5 hasn't yet been released we'll need to rollback for our
release.

See gh-4789
2016-01-21 17:40:48 -08:00
Phillip Webb ebabc63bbb Refine ContextId NAME_PATTERN
Update the ContextIdApplicationContextInitializer default NAME_PATTERN
to favor the developer defined `${spring.application.name}` value over
the deployer defined `${vcap.application.name}`.

Fixes gh-4926
2016-01-21 15:31:33 -08:00
Phillip Webb fd3e5cf304 Defer disable persistence logic to a listener
Update TomcatEmbeddedServletContainerFactory so that logic to disable
persistent sessions happens after Tomcat's standard Manager creation
logic.

Fixes gh-4543
2016-01-21 15:13:37 -08:00
Phillip Webb e520c47c4f Refine `messages.properties` detection
Update `ResourceBundleCondition` to only enable the messages source
if `messages.properties` (and not `messages*.properties`) exists. This
operation is much faster that performing a pattern match since a full
jar entry scan is not required.

Since adding `messages.properties` is good practice and this change
allows us to delete the custom `PathMatchingResourcePatternResolver`
it seems like a fine compromise to make.

Fixes gh-4930
See gh-4811
2016-01-21 15:13:33 -08:00
Phillip Webb cf93f84e87 Polish 2016-01-21 14:15:49 -08:00
Andy Wilkinson acfae2ebff Upgrade to Spring AMQP 1.5.3.RELEASE
Closes gh-5003
2016-01-21 20:24:03 +00:00
Andy Wilkinson d1be03fcf0 Upgrade to Postgresql 9.4.1207.jre7
Closes gh-5002
2016-01-21 20:22:06 +00:00
Andy Wilkinson 0ed671cb0e Upgrade to jOOQ 3.7.2
Closes gh-5001
2016-01-21 20:21:26 +00:00
Andy Wilkinson 5a04b58432 Upgrade to ActiveMQ 5.12.2
Closes gh-5000
2016-01-21 20:21:01 +00:00
Andy Wilkinson 7c9ec1de0e Upgrade to Undertow 1.3.14.Final
Closes gh-4999
2016-01-21 20:20:37 +00:00
Andy Wilkinson 46f712ec34 Upgrade to Embedded Mongo 1.50.2
Closes gh-4998
2016-01-21 20:20:17 +00:00
Andy Wilkinson ffd58dd5c7 Upgrade to Jackson 2.6.5
Closes gh-4997
2016-01-21 20:19:17 +00:00
Andy Wilkinson d4e44fedc4 Merge branch '1.2.x' 2016-01-21 20:18:38 +00:00
Andy Wilkinson 91c497e8bf Upgrade to AspectJ 1.8.8
Closes gh-4996
2016-01-21 20:17:46 +00:00
Phillip Webb 93c3b22bb4 Merge branch '1.2.x' 2016-01-21 11:14:20 -08:00
Phillip Webb c71aa32fbb Polish 2016-01-21 10:53:25 -08:00
Phillip Webb af36bf6864 Remove TODO in FlywayAutoConfiguration
Now tracked by gh-4995
2016-01-21 10:42:33 -08:00
Andy Wilkinson a05a5b3f1c Fix problem reported by Checkstyle 2016-01-21 17:48:18 +00:00
Andy Wilkinson 9dc858cdf5 Add missing properties to RepackageTask and improve test coverage
Closes gh-4978
2016-01-21 17:04:25 +00:00
Andy Wilkinson 36133d93fe Fix incorrect header depth in the documentation 2016-01-21 15:02:32 +00:00
Andy Wilkinson 854cacdb4f Fix useStartStopDaemon in launch script and allow config via conf file
Commit 5a1ee6eb added support for disabling use of start-stop-daemon
via a placeholder in the default launch script. Unfortunately, that
placeholder was subsequently broken in 81a47639.

This commit reinstates the placeholder and adds tests to verify that all
of the placeholders in the launch script can be replaced and that they
have the required default values. Furthermore, it also allows the use of
start-stop-daemon to be configured via USE_START_STOP_DAEMON in an
app’s .conf file. This allows the configuration to be changed after the
app has been built.

Closes gh-4985
2016-01-21 14:58:51 +00:00
Stephane Nicoll 44f508208a Merge branch '1.2.x' 2016-01-21 14:16:24 +01:00
Stephane Nicoll 58ebfdcbd3 Polish contribution
Closes gh-4973
2016-01-21 14:10:35 +01:00
Jacques-Etienne Beaudet a749855cb5 Allow indexed access of `flyway.locations`
This commit allows to use the `flyway.locations` in an indexed fashion
(i.e. typically in YAML configuration).

See gh-4973
2016-01-21 14:08:39 +01:00
Andy Wilkinson e33221aae1 Configure existing Jersey servlet registration created by the SCI
When a Jersey app is deployed to a standalone container, Jersey’s
ServletContainerInitializer will run and register a servlet for a class
annotated with @ApplicationPath. If Jersey’s ServletContainerInitializer
runs before Spring’s, this servlet will take precedence over the
servlet registered by JerseyAutoConfiguration and will therefore not be
configured with any init parameters specified using spring.jersey.init

For the case where Jersey’s SCI runs first, this commit updates
JerseyAutoConfiguration to examine the servlet context for an existing
registration of Jersey’s servlet (Jersey names the registration using
the fully-qualified name of the ResourceConfig subclass). If a
registration is found its init parameters are configured using the
configuration provided by spring.jersey.init.

For the case where Spring’s SCI runs first, this commit updates
JerseyAutoConfiguration so that it names its registration using the
fully-qualified name of the ResourceConfig sub-class. This allows
Jersey’s SCI to find the existing registration rather than attempting
to configure its own.

Closes gh-2471
2016-01-21 11:48:31 +00:00
Andy Wilkinson 2039ed48c1 Merge pull request #4801 from mbenson
* gh-4801:
  Add mainApplicationClass accessor to SpringApplication
2016-01-21 10:49:55 +00:00
Matt Benson 34b1de6c39 Add mainApplicationClass accessor to SpringApplication
Closes gh-4801
2016-01-21 10:26:43 +00:00
Andy Wilkinson 03669002de Check for null context when trying to find an exception mapper
If application context refresh fails, SpringApplication will have a 
null context. Previously, this would result in an NPE when looking for
an ExitCodeExceptionMapper.

This commit updates SpringApplication to gracefully handle the context
being null when looking for an ExitCodeExceptionMapper.

Closes gh-4803
2016-01-21 10:22:16 +00:00
Stephane Nicoll ea5195c8a6 Better document how DataSource is bound to the env
Closes gh-4971
2016-01-21 11:13:12 +01:00
Andy Wilkinson 2dc3660a32 Align launcher exception handling with direct invocation of main method
Previously, if an application’s main method threw an exception,
MainMethodRunner would catch the exception and call System.exit(1).
This meant that the JVM would exit, irrespective of whether or not
any non-daemon threads were running. In contrast, when an application’s
main method was invoked directly (in an IDE, for example) the JVM
would not exit if one or more non-daemon threads were running. This
is standard JVM behaviour that we should be consistent with in the
launcher.

This commit updates MainMethodRunner to wrap any exception thrown by an
application’s main method in a RuntimeException and rethrow it. This
alllows the JVM to handle the exception and use its normal rules for
deciding whether or not it should exit.

Closes gh-4984
2016-01-21 09:57:13 +00:00
Stephane Nicoll 9f728b3d59 Fix wrong import 2016-01-21 10:37:40 +01:00
Stephane Nicoll a61b29e6ac Merge pull request #4987 from rakk/master
* pr/4987:
  Update inconsistent documentation
2016-01-21 10:32:42 +01:00
Robert Kapala 9de13446c4 Update inconsistent documentation
Closes gh-4987
2016-01-21 10:32:16 +01:00
Stephane Nicoll ea8e0cfc48 Support for simple numeric Flyway version
While Flyway's `MigrationVersion` is a String value, a simple "0" is
also a valid number. When such value is not wrapped in YAML, an integer
is injected rather than a String which leads to a failure as we can't
convert it.

This commit updates the `StringToMigrationVersionConverter` to also
supports conversion from a Number. This is a convenience for users
using YAML for configuration

Closes gh-4981
2016-01-21 10:26:12 +01:00
Stephane Nicoll c23af8f54e Support of GenericConverter
This commit makes sure to also include any `GenericConverter` flagged for
inclusion in the conversion service to use to convert configuration keys.

Previously, those were ignored as `Converter` and `GenericConverter` are
two separate interfaces.

Closes gh-4988
2016-01-21 10:20:26 +01:00
Andy Wilkinson 6f8d4c77e6 Handle multiple ContextRefreshedEvents in BackgroundPreinitializer
The same initializer will receive multiple ContextRefreshedEvents
when their is an application context hierarchy. This commit updates
the initializer to correctly handle multiple ContextRefreshedEvents
and only act upon the first that it receives.

See gh-4871
2016-01-20 22:23:57 +00:00
Andy Wilkinson 992e90f43d Ensure that background preinit has completed before refresh returns
This commit is a continuation of the changes made in b85b608. It
addresses an additional problem when testing applications where two
contexts are refreshed in quick succession. In this scenario, it
was possible, theoretically at least, for the first context’s background preinitialization to still be in progress and creating loggers when the
second is refreshed and resets the logger context.

This commit updates BackgroundPreinitializer so that, upon receipt of
a ContextRefreshedEvent, it waits for preinitialization to have
completed. In the scenario described above, this ensures that
preinitialization has completed before the call to refresh() for the
first context returns, thereby preventing it from running in parallel
with the refresh of the second context.

Closes gh-4871
2016-01-20 21:56:54 +00:00
Stephane Nicoll 179467bdd9 Make HazelcastJpaDependencyAutoConfiguration public
If Both Hazelcast and Hibernate are available, Spring Boot takes the
opinion that Hazelcast can be used for 2nd level caching and therefore
need to start before Hibernate.

Unfortunately, some users require Hibernate in some of their hazelcast
use case so the link is actually reversed. One way for such user is to
disable the auto-configuration that deals with this link. This class is
now public so that users can locate them and exclude them if necessary.

Closes gh-4960
2016-01-20 18:40:45 +01:00
Andy Wilkinson 5e5542f09c Describe the ordering of spring.config.location in the documentation
Closes gh-4964
2016-01-20 12:13:57 +00:00
Andy Wilkinson b85b60828c Perform background preinitialization after logging system setup
Previously, BackgroundPreinitializer would kick off preinitialization
on a separate thread in response to an ApplicationStartedEvent. This
work would then race with the logging system being set up in response
to an ApplicationEnvironmentPreparedEvent. When Logback’s being used
this race is problematic. As part of Logback’s setup,
LoggerContext.stop() is called. This calls LoggerContext.reset() which
can fail with a ConcurrentModificationException if another thread tries
to create a Logger at the same time. This is a known bug in Logback [1].

This commit updates BackgroundPreinitializer to respond to
an ApplicationEnvironmentPreparedEvent and to order itself so that it’s
called after LoggingApplicationListener has responded to the same event
by initializing the logging system.

Closes gh-4871

[1] http://jira.qos.ch/browse/LOGBACK-397
2016-01-20 11:49:57 +00:00
Andy Wilkinson 00f4538529 Don’t check that a Gauge’s value is a Number until it’s being read
Spring Boot’s metrics require all values to be Numbers. A Dropwizard
Gauge can have a non-Number value. Previously, to prevent this causing
a problem, MetricRegistryMetricReader would check the value of a Gauge
when it’s being added and ignore it if it had a non-Number value.
Unfortunately, retrieving the value of a Gauge can take a non-trivial
amount of time (hence CachedGauge) so this approach, while functional,
could be improved.

This commit updates the filtering to happen when a Metric is being
retrieved from MetricRegistryMetricReader (via findOne or findAll)
when its value is required anyway. At this point, any Gauge with a
non-Number value is ignored.

Closes gh-4874
2016-01-20 11:19:07 +00:00
Andy Wilkinson d7fbe9efbb Merge branch 'gh-4976' 2016-01-20 10:14:57 +00:00
Andy Wilkinson 2f24c1862a Polish contribution 2016-01-20 10:14:47 +00:00