forked from hawtio/hawtio
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(deploy): enable JVMList MBean in hawtio-default for Connect disc…
…overy support
- Loading branch information
Showing
4 changed files
with
45 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
deploy/hawtio-default/src/main/java/io/hawt/HawtioDefaultContextListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package io.hawt; | ||
|
||
import jakarta.servlet.ServletContextEvent; | ||
|
||
import io.hawt.HawtioContextListener; | ||
import io.hawt.jvm.local.JVMList; | ||
|
||
public class HawtioDefaultContextListener extends HawtioContextListener { | ||
private final JVMList jvmList; | ||
|
||
public HawtioDefaultContextListener() { | ||
super(); | ||
this.jvmList = new JVMList(); | ||
} | ||
|
||
public void contextInitialized(ServletContextEvent servletContextEvent) { | ||
super.contextInitialized(servletContextEvent); | ||
try { | ||
jvmList.init(); | ||
} catch (Exception e) { | ||
throw createServletException(e); | ||
} | ||
} | ||
|
||
public void contextDestroyed(ServletContextEvent servletContextEvent) { | ||
super.contextDestroyed(servletContextEvent); | ||
try { | ||
jvmList.destroy(); | ||
} catch (Exception e) { | ||
throw createServletException(e); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters