public Swarm stop ( ) throws Exception { if ( this . server == null ) { throw SwarmMessages . MESSAGES . containerNotStarted ( "stop()" ) ; } this . server . stop ( ) ; this . server = null ; Module module = Module . getBootModuleLoader ( ) . loadModule ( CONTAINER_MODULE_NAME ) ; Class < ? > shutdownClass = module . getClassLoader ( ) . loadClass ( "org.wildfly.swarm.container.runtime.WeldShutdownImpl" ) ; WeldShutdown shutdown = ( WeldShutdown ) shutdownClass . newInstance ( ) ; shutdown . shutdown ( ) ; return this ; }
Stop the container first undeploying all deployments .