protected void stopService() throws Exception { applicationStatusSource.getSystemStatus().setState( SystemState.STOPPING ); // Due to no dependency mechanism in NX for components, we need to fire off a hint about shutdown first eventBus.post( new NexusStoppingEvent( this ) ); nexusScheduler.shutdown(); eventBus.post( new NexusStoppedEvent( this ) ); nexusConfiguration.dropInternals(); securitySystem.stop(); applicationStatusSource.getSystemStatus().setState( SystemState.STOPPED ); // Now a cleanup, to kill dangling thread of HttpClients CustomMultiThreadedHttpConnectionManager.shutdownAll(); getLogger().info( "Stopped {}", getNexusNameForLogs()); }