Skip to content

Commit

Permalink
Reflectively try to restart agent, since not all JDKs have this.
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Jul 24, 2017
1 parent 3c21a91 commit 304342c
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -84,7 +84,7 @@ public boolean tryShutdownAgent() {

public boolean tryRestartAgent() {
try {
sun.management.Agent.startAgent();
Class.forName("sun.management.Agent").getDeclaredMethod("startAgent").invoke(null);
return true;
} catch (Exception e) {
return false;
Expand Down

0 comments on commit 304342c

Please sign in to comment.