Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
12045598
Commit
12045598
authored
Nov 12, 2015
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refine agent reloader detection
Fixes gh-4366
parent
6ae02196
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
7 deletions
+22
-7
AgentReloader.java
.../springframework/boot/devtools/restart/AgentReloader.java
+22
-7
No files found.
spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/AgentReloader.java
View file @
12045598
...
@@ -16,6 +16,10 @@
...
@@ -16,6 +16,10 @@
package
org
.
springframework
.
boot
.
devtools
.
restart
;
package
org
.
springframework
.
boot
.
devtools
.
restart
;
import
java.util.Collections
;
import
java.util.LinkedHashSet
;
import
java.util.Set
;
import
org.springframework.util.ClassUtils
;
import
org.springframework.util.ClassUtils
;
/**
/**
...
@@ -26,6 +30,15 @@ import org.springframework.util.ClassUtils;
...
@@ -26,6 +30,15 @@ import org.springframework.util.ClassUtils;
*/
*/
public
abstract
class
AgentReloader
{
public
abstract
class
AgentReloader
{
private
static
final
Set
<
String
>
AGENT_CLASSES
;
static
{
Set
<
String
>
agentClasses
=
new
LinkedHashSet
<
String
>();
agentClasses
.
add
(
"org.zeroturnaround.javarebel.Integration"
);
agentClasses
.
add
(
"org.zeroturnaround.javarebel.ReloaderFactory"
);
AGENT_CLASSES
=
Collections
.
unmodifiableSet
(
agentClasses
);
}
private
AgentReloader
()
{
private
AgentReloader
()
{
}
}
...
@@ -34,15 +47,17 @@ public abstract class AgentReloader {
...
@@ -34,15 +47,17 @@ public abstract class AgentReloader {
* @return true if agent reloading is active
* @return true if agent reloading is active
*/
*/
public
static
boolean
isActive
()
{
public
static
boolean
isActive
()
{
return
isJRebelActive
();
return
isActive
(
null
)
||
isActive
(
AgentReloader
.
class
.
getClassLoader
())
||
isActive
(
ClassLoader
.
getSystemClassLoader
());
}
}
/**
private
static
boolean
isActive
(
ClassLoader
classLoader
)
{
* Determine if JRebel is active.
for
(
String
agentClass
:
AGENT_CLASSES
)
{
* @return true if JRebel is active
if
(
ClassUtils
.
isPresent
(
agentClass
,
classLoader
))
{
*/
return
true
;
public
static
boolean
isJRebelActive
()
{
}
return
ClassUtils
.
isPresent
(
"org.zeroturnaround.javarebel.ReloaderFactory"
,
null
);
}
return
false
;
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment