// Don't shutdown GlassFishRuntime, as that can bring the OSGi framework down which is wrong
// when we are embedded inside an existing runtime. So, just stop the glassfish instance that
// we are supposed to stop. Leave any cleanup to some other code.
GlassFish gfKernel = habitat.getComponent(GlassFish.class);
if (gfKernel != null) {
gfKernel.stop();
}
}
catch (Throwable t) {
// ignore
}