My application running in JBoss 6 AS contains a below code snippet related to shutting down of JBoss server. Now, am migrating to Wildfly 8 AS and could not find a module or api within Wildfly AS to find the class JMXKernelMBean
.
JMXKernelMBean<?,?> jmxKernelMBean = (JMXKernelMBean<?,?>) MBeanServerInvocationHandler.
.newProxyInstance(
MBeanServerLocator.locateJBoss(),
new ObjectName("jboss.system:type=Server"),
JMXKernelMBean.class,
false);
jmxKernelMBean.shutDown();
Can anyone please help about the api or module used in Wildfly 8 for the same purpose of shutting down the server. Many thanks.
Calling System.exit() will calls the JVM's shutdown hooks, including the one Wildfly installs that triggers clean shutdown.