if (this.cancelState()) { final String newThreadName = this.getName() + ".recover()"; logger.debug("{} thread {}", newThreadName, Thread.currentThread().getName());
if (this.cancelState()) {
/** * Recover jmdns when there is an error. */ public void recover() { logger.finer(this.getName() + "recover()"); // We have an IO error so lets try to recover if anything happens lets close it. // This should cover the case of the IP address changing under our feet if (this.isClosing() || this.isClosed() || this.isCanceling() || this.isCanceled()) { return; } // We need some definite lock here as we may have multiple timer running in the same thread that will not be stopped by the reentrant lock // in the state object. This is only a problem in this case as we are going to execute in seperate thread so that the timer can clear. synchronized (_recoverLock) { // Stop JmDNS // This protects against recursive calls if (this.cancelState()) { logger.finer(this.getName() + "recover() thread " + Thread.currentThread().getName()); Thread recover = new Thread(this.getName() + ".recover()") { /** * {@inheritDoc} */ @Override public void run() { __recover(); } }; recover.start(); } } }
/** * Recover jmdns when there is an error. */ public void recover() { logger.finer(this.getName() + "recover()"); // We have an IO error so lets try to recover if anything happens lets close it. // This should cover the case of the IP address changing under our feet if (this.isClosing() || this.isClosed() || this.isCanceling() || this.isCanceled()) { return; } // We need some definite lock here as we may have multiple timer running in the same thread that will not be stopped by the reentrant lock // in the state object. This is only a problem in this case as we are going to execute in seperate thread so that the timer can clear. synchronized (_recoverLock) { // Stop JmDNS // This protects against recursive calls if (this.cancelState()) { logger.finer(this.getName() + "recover() thread " + Thread.currentThread().getName()); Thread recover = new Thread(this.getName() + ".recover()") { /** * {@inheritDoc} */ @Override public void run() { __recover(); } }; recover.start(); } } }
/** * Recover jmdns when there is an error. */ public void recover() { logger.finer(this.getName() + "recover()"); // We have an IO error so lets try to recover if anything happens lets close it. // This should cover the case of the IP address changing under our feet if (this.isClosing() || this.isClosed() || this.isCanceling() || this.isCanceled()) { return; } // We need some definite lock here as we may have multiple timer running in the same thread that will not be stopped by the reentrant lock // in the state object. This is only a problem in this case as we are going to execute in seperate thread so that the timer can clear. synchronized (_recoverLock) { // Stop JmDNS // This protects against recursive calls if (this.cancelState()) { logger.finer(this.getName() + "recover() thread " + Thread.currentThread().getName()); Thread recover = new Thread(this.getName() + ".recover()") { /** * {@inheritDoc} */ @Override public void run() { __recover(); } }; recover.start(); } } }