Class DefaultRestartInitializer
java.lang.Object
org.springframework.boot.devtools.restart.DefaultRestartInitializer
- All Implemented Interfaces:
RestartInitializer
Default
RestartInitializer that only enable initial restart when running a
standard "main" method. Skips initialization when running "fat" jars (included
exploded) or when running from a test.- Since:
- 1.3.0
- Author:
- Phillip Webb, Andy Wilkinson
-
Field Summary
Fields inherited from interface org.springframework.boot.devtools.restart.RestartInitializer
NONE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionURL[]getInitialUrls(Thread thread) Return the initial set of URLs for theRestarterornullif no initial restart is required.protected URL[]Return the URLs that should be used with initialization.protected booleanisDevelopmentClassLoader(ClassLoader classLoader) Returns whether the givenclassLoaderis one that is typically used during development.protected booleanReturns if the thread is for a main invocation.protected booleanisMainThread(Thread thread) Returns whether the giventhreadis considered to be the main thread.
-
Constructor Details
-
DefaultRestartInitializer
public DefaultRestartInitializer()
-
-
Method Details
-
getInitialUrls
Description copied from interface:RestartInitializerReturn the initial set of URLs for theRestarterornullif no initial restart is required.- Specified by:
getInitialUrlsin interfaceRestartInitializer- Parameters:
thread- the source thread- Returns:
- initial URLs or
null
-
isMain
Returns if the thread is for a main invocation. By defaultchecks the name of the threadandthe context classloader.- Parameters:
thread- the thread to check- Returns:
trueif the thread is a main invocation- See Also:
-
isMainThread
Returns whether the giventhreadis considered to be the main thread.- Parameters:
thread- the thread to check- Returns:
trueif it's the main thread, otherwisefalse- Since:
- 2.4.0
-
isDevelopmentClassLoader
Returns whether the givenclassLoaderis one that is typically used during development.- Parameters:
classLoader- the ClassLoader to check- Returns:
trueif it's a ClassLoader typically used during development, otherwisefalse- Since:
- 2.4.0
-
getUrls
Return the URLs that should be used with initialization.- Parameters:
thread- the source thread- Returns:
- the URLs
-