Commit Graph

235 Commits

Author SHA1 Message Date
Phillip Webb a20df82067 Polish 2018-04-02 09:51:42 -07:00
Phillip Webb ecfc8d73f1 Be defensive when clearing caches for restart
Update `Restarter` to be much more defensive when attempting to clear
caches. We now use `clearCache()` methods whenever possible, and only
fall back to field access when absolutely necessary. In addition field
access now ignore any exceptions.

Fixes gh-12719
2018-04-02 09:43:03 -07:00
Andy Wilkinson 146858505f Synchronize on class loading lock in RestartClassLoader
Closes gh-12171
2018-02-23 15:33:56 +00:00
Phillip Webb 2c429ba77d Restore static final formatting
Restore static final constants to upper case formatting.

See gh-10457
2017-12-13 12:21:57 -08:00
Stephane Nicoll e85578cf2f Polish 2017-11-23 18:00:49 +01:00
Johnny Lim b965171b41 Add missing null check in FileSystemWatcher.stopAfter()
Closes gh-10941
2017-11-07 08:45:25 +01:00
Andy Wilkinson 71c15cb65e Avoid possible livelock when stopping FileSystemWatcher in parallel
Previously, if the file watcher thread tried to stop the
FileSystemWatcher when another thread was already stopping it a
livelock could occur. The livelock occurred because the file watcher
thread would attempt to lock a monitor that was being held by a thread
that had joined the file watcher thread and was waiting for it to die.

This commit avoid the livelock by narrowing the synchronization that's
used when stopping the FileSystemWatcher. The monitor is used to
obtain a reference to the file watcher thread in a thread-safe manner,
but it is released prior to joining the file watcher thread and
waiting for it to die. This will allow a parallel attempt by the
file watcher thread to stop itself to succeed.

Closes gh-10496
2017-10-02 20:03:17 +01:00
Andy Wilkinson 205c25bf0f Polish 2017-10-02 15:56:52 +01:00
Johnny Lim bfa291f671 Polish 2017-10-02 15:07:03 +01:00
Andy Wilkinson bcbf7b5511 Update ChangeableUrlsTests to cope with URL-like Windows file paths
Closes gh-10268
2017-10-02 12:53:25 +01:00
Andy Wilkinson f01bb8e175 Polish 2017-09-29 12:04:46 +01:00
Andy Wilkinson c27d678b81 Improve handling of absolute URLs in Class-Path manifest attribute
Closes gh-10268
2017-09-29 11:45:57 +01:00
Andy Wilkinson 7eb9193862 Tolerate absolute URLs in manifest's Class-Path attribute
Closes gh-10268
2017-09-25 16:47:27 +01:00
Andy Wilkinson 8761ef547c Log single message per jar with faulty Class-Path manifest attribute
Previously, when DevTools encountered a jar with a Class-Path manifest
attribute that referenced non-existent files, it would log one
message per entry in the attribute that did not exist. While useful
information, this has proven to be too verbose.

This commit aims to strike a better balances by logging a single
message for an entire jar. The message is a single line that
includes the path to the jar with the faulty Class-Path manifest
attribute and the paths of all of the files that do not exist that are
referenced by the attribute.

Closes gh-10111
2017-09-07 20:43:09 +01:00
Andy Wilkinson f3b26525f7 Use System.out rather than err for ignored Class-Path entry message
Closes gh-9802
2017-07-20 10:37:49 +01:00
Phillip Webb aa57ca7e18 Polish 2017-07-06 16:53:04 -07:00
Misagh Moayyed 07d09f3f18 Add missing whitespace in log
Closes gh-9597
2017-06-26 08:48:37 +02:00
Andy Wilkinson 59122358d3 Clean up and format code 2017-06-16 08:58:14 +01:00
Stephane Nicoll cbdab9edb3 Add support for custom ProtocolResolver with Devtools
Prior to this commit, custom `ProtocolResolvers` set on the
`ApplicationContext` were lost when Devtools is used as the customized
`ResourceLoader` did not copy any customization made to the default
resource loader.

This commit makes sure to copy any `ProtocolResolver` set on the context.

Closes gh-9331
2017-06-06 16:04:12 +02:00
Phillip Webb b9fd99e268 Polish 2017-06-02 13:47:28 -07:00
Oleg Vyukov ff3b6b09bd Fix OptionalLiveReloadServer create bean
Closes gh-8595
2017-06-02 17:35:14 +02:00
Stephane Nicoll 934d33685a Polish
See gh-8879
2017-04-11 09:40:54 +02:00
Stephane Nicoll 16afb8a973 Polish "Add support for HotSwapAgent to devtools"
Closes gh-8683
2017-04-10 14:18:23 +02:00
Bretislav Wajtr b368693d80 Add support for HotSwapAgent to devtools
HotSwapAgent is an open source competition to JRebel. This commit adds
"org.hotswap.agent.HotswapAgent" to the list of known Java agent based
class reloaders. This causes same behavior as when JRebel is used: a full
restart is NOT triggered when any class changes, however LiveReload event
is still triggered.

See gh-8683
2017-04-10 14:18:23 +02:00
Andy Wilkinson ac3071670f Merge branch '1.4.x' into 1.5.x 2017-04-07 14:17:08 +01:00
Andy Wilkinson ceb80614e5 Polishing 2017-04-07 14:13:55 +01:00
Andy Wilkinson bccbbc145e Merge branch '1.4.x' into 1.5.x 2017-04-07 13:49:19 +01:00
Andy Wilkinson 60505a4fae Don't shut down "in-memory" DB running as a server on DevTools restart
Closes gh-8702
2017-04-07 13:47:40 +01:00
Andy Wilkinson 155d55097f Merge branch '1.4.x' into 1.5.x 2017-04-04 12:21:43 +01:00
Andy Wilkinson 47de05b52c Update Devtools to ignore manifest Class-Path entries that do not exist
Closes gh-8623
2017-04-04 12:15:51 +01:00
Andy Wilkinson 627edc0f7a Use a different approach to disable HATEOAS Objenesis instance's cache
Previously, reflection was used to set the OBJENESIS field of
DummyInvocationUtils with an Objenesis instance that does not use
caching. This has stopped working as the field is now declared final.

This commit updates the approach take by HateoasObjenesisCacheDisabler
to disable Objenesis's cache. Rather than changing the value of the
OBJENESIS field on DummyInvocationUtils, the cache field on the
ObjenesisStd instance is set to null instead. This has the desired
effect of disabling Objenesis's caching.

See gh-3784
Closes gh-8335
2017-02-28 12:24:19 +00:00
Phillip Webb ca1540cefe Update header copyright for changed files 2017-02-27 20:41:18 -08:00
Johnny Lim 0adab8a2be Use logical 'and' instead of bitwise 'and'
Closes gh-8198
2017-02-06 10:35:13 +01:00
Stephane Nicoll 505e7f75ea Polish contribution
Closes gh-8089
2017-01-25 11:01:53 +01:00
dreis d58f38f6f6 Use String.replace() with single char if possible
See gh-8089
2017-01-25 11:01:52 +01:00
Phillip Webb 2c89d9918f Relocate AutoConfigurations from root package
Move PropertyPlaceholder and MessageSource auto-configuration from the
root package to the `context` subpackage.

Fixes gh-8071
2017-01-23 17:32:45 -08:00
Andy Wilkinson 531cf5d4f6 Merge branch '1.4.x' into 1.5.x 2017-01-19 09:28:14 +00:00
Andy Wilkinson 6a0fb8e44c Update DevTools' ResourceLoader to delegate to user's custom loader
Previously, when DevTools' was used it would set the application
context's ResourceLoader and overwrite any custom ResourceLoader that
had been configured. On the rare occasion when the user had customized
the ResourceLoader this meant that the customization was lost and
certain resources would become unavailable.

This commit updates DevTools' ResourceLoader to delegate a custom
ResourceLoader if one has been configured. If one has not been
configured it delegates as before, i.e. to
WebApplicationContextResourceLoader for web applications and to
DefaultResourceLoader for all others apps.

Closes gh-8010
2017-01-19 09:28:09 +00:00
Andy Wilkinson 6cab03de0b Merge branch '1.4.x' into 1.5.x 2017-01-17 10:39:09 +00:00
Andy Wilkinson 69320180d9 Make FileSystemWatcherTests.waitsForPollingInterval more robust
The intent of the test is to:

1. Make a change
2. Sleep for long enough for that change to be picked up
3. Make another change
4. Stop that watcher after 1 further scan has been performed
5. Assert that a further scan was performed by checking that two
   separate sets of changes (step 1 and step 3) have been picked up

Previously, step 2 relied on simply sleeping for a period of time
longer than the polling interval. In reality, the polling interval
is only a minimum time between scans and the actual time between them
depends on thread scheduling, GC pauses, etc. This lead to the
test failing intermittently if the scan didn't happen in a timely
manner.

This commit removes the sleep and replaces it with a while loop that
waits for first change to be picked up. This ensures that the second
change will be detected separately from the first and that two
separate change sets should always be available once the watcher has
stopped.

See gh-7782
2017-01-17 10:30:47 +00:00
Johnny Lim f915ae197a Polish 2017-01-04 09:53:45 +01:00
Phillip Webb b76978ff7e Try to prevent Travis build failures
Update LiveReloadServerTests which seems to be failing intermittently
on Travis.
2016-12-30 12:22:37 -08:00
Phillip Webb aacf5d660f Update copyright year for changed files 2016-12-30 11:53:51 -08:00
Phillip Webb 8b69856fc9 Polish 2016-12-28 15:23:26 -08:00
Phillip Webb 97d7ffd8e8 Merge branch '1.4.x' into 1.5.x 2016-12-28 14:48:05 -08:00
Phillip Webb 61c931943f Fix Devtools PatternResolver Servlet support
Update ClassLoaderFilesResourcePatternResolver to support servlet
resources when it's being used with a WebApplicationContext.

Prior to commit 918e122ddc a `ResourceLoader` was not added to the
`ApplicationContext`, meaning that servlet resources could be found by
virtue of the protected `getResourceByPath()` method. Following commit
918e122ddc, the context `ResourceLoader` is set, meaning that all calls
to `getResource` delegate to the `ResourceLoader` and the
`ApplicationContext` methods are not invoked. Since the devtools
`ResourceLoader` wasn't Servlet aware, servlet resources could not
be found.

Fixes gh-7752
2016-12-28 14:25:11 -08:00
Phillip Webb d05357e036 Migrate to Tomcat WebSocket client
Move samples and tests from Jetty websocket client to Tomcat since the
upcoming Jetty release contains a bug in `JsrSession`
(https://github.com/eclipse/jetty.project/issues/1202).

See gh-7599
2016-12-24 11:24:30 -08:00
Phillip Webb 5299db3806 Fix deadlock when calling LiveReloadServer.stop()
Update LiveReloadServer so that different synchronization blocks are
used for the sockets and connection lists. Prior to this commit calling
`LiveReloadServer.stop()` would always result in a 60 second delay since
`stop()` owned the monitor add `removeConnection()` (called from a
different thread) needs it to remove the active connection.

Fixes gh-7749
2016-12-24 11:06:09 -08:00
Hrishikesh Joshi c2992e3736 Add more debug logging to DevTools
Add debug logging for the included and excluded URL patterns and
matching URLs.

Fixes gh-7478
Closes gh-7544
2016-12-20 21:16:41 -08:00
Phillip Webb 4b9cba351b Merge branch '1.4.x' into 1.5.x 2016-12-19 12:36:57 -08:00