/** * Kills all threads/processes lauched by this thread and prepares it for shutdown. You may use * this method as a reinitialization technique ( you'll have to call start afterwards) */ public void stop() { try { try { detector.shutDown(); } catch (Exception ex) { logger.debug("Failed to properly shutdown a stun detector: " + ex.getMessage()); } detector = null; useStun = false; // remove the listeners NetaddrActivator.getConfigurationService() .removeVetoableChangeListener(PROP_STUN_SERVER_ADDRESS, this); NetaddrActivator.getConfigurationService() .removeVetoableChangeListener(PROP_STUN_SERVER_PORT, this); } finally { logger.logExit(); } }