@Override public void dispose(){
  if (receiveThread != null) {
    receiveThread.interrupt();
    try {
      receiveThread.join();
    }
 catch (    InterruptedException e) {
    }
    receiveThread=null;
  }
  if (serialPort != null) {
    serialPort.close();
    serialPort=null;
  }
  logger.info("Stopped ZWave serial handler");
  super.dispose();
}

@ Override public void dispose ( ) { if ( receiveThread != null ) { receiveThread . interrupt ( ) ; try { receiveThread . join ( ) ; } catch ( InterruptedException e ) { } receiveThread = null ; } if ( serialPort != null ) { serialPort . close ( ) ; serialPort = null ; } logger . info ( "Stopped ZWave serial handler" ) ; super . dispose ( ) ; }
closes the connection to the zwave controller .
