@Override public void dispose() { // stop our duration counter if (timeCounterJob != null && !timeCounterJob.isCancelled()) { timeCounterJob.cancel(true); timeCounterJob = null; } if (squeezeBoxServerHandler != null) { squeezeBoxServerHandler.removePlayerCache(mac); } logger.debug("Thing {} disposed.", getThing().getUID()); super.dispose(); }
/* * (non-Javadoc) * * @see org.eclipse.smarthome.core.thing.binding.BaseThingHandler#dispose() */ @Override public void dispose() { logger.debug("Disposing MAX! device {} {}.", getThing().getUID(), maxDeviceSerial); if (refreshingActuals) { refreshActualsRestore(); } if (refreshActualsJob != null && !refreshActualsJob.isCancelled()) { refreshActualsJob.cancel(true); refreshActualsJob = null; } if (bridgeHandler != null) { logger.trace("Clear MAX! device {} {} from bridge.", getThing().getUID(), maxDeviceSerial); bridgeHandler.clearDeviceList(); bridgeHandler.unregisterDeviceStatusListener(this); bridgeHandler = null; } updateStatus(ThingStatus.OFFLINE); logger.debug("Disposed MAX! device {} {}.", getThing().getUID(), maxDeviceSerial); super.dispose(); }