if(up_handler != null && up_handler.isAlive()) { try { up_handler.join(THREAD_JOIN_TIMEOUT); } catch(Exception ex) { } if(up_handler != null && up_handler.isAlive()) { up_handler.interrupt(); try { up_handler.join(THREAD_JOIN_TIMEOUT); } catch(Exception ex) { } if(up_handler != null && up_handler.isAlive()) if(log.isErrorEnabled()) log.error("up_handler thread for " + getName() + " was interrupted (in order to be terminated), but is still alive"); } } up_handler=null;
if (up_handler != null && up_handler.isAlive()) { try { up_handler.join(THREAD_JOIN_TIMEOUT); } catch (Exception ex) { } if (up_handler != null && up_handler.isAlive()) { up_handler.interrupt(); try { up_handler.join(THREAD_JOIN_TIMEOUT); } catch (Exception ex) { } if (up_handler != null && up_handler.isAlive()) { if (log.isErrorEnabled()) { log.error("up_handler thread for " + getName() + " was interrupted (in order to be terminated), but is still alive"); } } } } up_handler = null;
    public void stopInternal() {        up_queue.close(false);  // this should terminate up_handler thread        if(up_handler != null && up_handler.isAlive()) {            try {                up_handler.join(THREAD_JOIN_TIMEOUT);            }            catch(Exception ex) {            }            if(up_handler != null && up_handler.isAlive()) {                up_handler.interrupt();  // still alive ? let's just kill it without mercy...                try {                    up_handler.join(THREAD_JOIN_TIMEOUT);                }                catch(Exception ex) {                }                if(up_handler != null && up_handler.isAlive())                    if(log.isErrorEnabled()) log.error("up_handler thread for " + getName() +                                                           " was interrupted (in order to be terminated), but is still alive");            }        }        up_handler=null;        down_queue.close(false); // this should terminate down_handler thread        if(down_handler != null && down_handler.isAlive()) {            try {                down_handler.join(THREAD_JOIN_TIMEOUT);            }            catch(Exception ex) {            }            if(down_handler != null && down_handler.isAlive()) {                down_handler.interrupt(); // still alive ? let's just kill it without mercy...                try {                    down_handler.join(THREAD_JOIN_TIMEOUT);                }                catch(Exception ex) {                }                if(down_handler != null && down_handler.isAlive())                    if(log.isErrorEnabled()) log.error("down_handler thread for " + getName() +                                                           " was interrupted (in order to be terminated), but is is still alive");            }        }        down_handler=null;    }